# encoding=utf-8
# Author: <NAME>
# Description: Factory pattern for MediaNewsCrawler

import logging
from src.crawler.media import (
    appledaily,
    bcc,
    bnext,
    chinatimes,
    cmmedia,
    cna,
    cnews,
    ctee,
    ctitv,
    cts,
    ctv,
    cnyes,
    digitimes,
    ebc,
    epochtimes,
    era,
    ettoday,
    ftv,
    kairos,
    ltn,
    mirror,
    moneydj,
    moneyudn,
    mypeoplevol,
    newtalk,
    nownews,
    pchome,
    peoplenews,
    pts,
    rti,
    setn,
    sina,
    storm,
    taiwanhot,
    taronews,
    technews,
    thenewslens,
    ttv,
    tvbs,
    udn,
    upmedia,
    ustv,
    wantrich,
    wealth,
    worldjournal,
    yahoo,
)

logger = logging.getLogger(__name__)


def MediaNewsCrawlerFactory(media_name: str):

    LOCALIZERS = {
        "appledaily": appledaily.AppleDailyNewsCrawler,
        "bcc": bcc.BCCNewsCrawler,
        "bnext": bnext.BnextNewsCrawler,
        "chinatimes": chinatimes.ChinatimesNewsCrawler,
        "cmmedia": cmmedia.CMMediaNewsCrawler,
        "cna": cna.CNANewsCrawler,
        "cnews": cnews.CNewsNewsCrawler,
        "ctee": ctee.CTEENewsCrawler,
        "ctitv": ctitv.CTITVNewsCrawler,
        "cts": cts.CTSNewsCrawler,
        "ctv": ctv.CTVNewsCrawler,
        "cnyes": cnyes.CNYESNewsCrawler,
        "digitimes": digitimes.DigitimesNewsCrawler,
        "ebc": ebc.EBCNewsCrawler,
        "epochtimes": epochtimes.EpochTimesNewsCrawler,
        "era": era.ERANewsCrawler,
        "ettoday": ettoday.ETtodayNewsCrawler,
        "ftv": ftv.FTVNewsCrawler,
        "kairos": kairos.KairosNewsCrawler,
        "ltn": ltn.LTNNewsCrawler,
        "mirror": mirror.MirrorNewsCrawler,
        "moneydj": moneydj.MoneyDJNewsCrawler,
        "moneyudn": moneyudn.MoneyUDNNewsCrawler,
        "mypeoplevol": mypeoplevol.MyPeopleVolNewsCrawler,
        "newtalk": newtalk.NewTalkNewsCrawler,
        "nownews": nownews.NowNewsNewsCrawler,
        "pchome": pchome.PChomeNewsCrawler,
        "peoplenews": peoplenews.PeopleNewsNewsCrawler,
        "pts": pts.PTSNewsCrawler,
        "rti": rti.RTINewsCrawler,
        "setn": setn.SETNNewsCrawler,
        "sina": sina.SINANewsCrawler,
        "storm": storm.StormNewsCrawler,
        "taiwanhot": taiwanhot.TaiwanHotNewsCrawler,
        "taronews": taronews.TaroNewsNewsCrawler,
        "technews": technews.TechnewsNewsCrawler,
        "thenewslens": thenewslens.TheNewsLensNewsCrawler,
        "ttv": ttv.TTVNewsCrawler,
        "tvbs": tvbs.TVBSNewsCrawler,
        "udn": udn.UDNNewsCrawler,
        "upmedia": upmedia.UpMediaNewsCrawler,
        "ustv": ustv.USTVNewsCrawler,
        "wantrich": wantrich.WantRichNewsCrawler,
        "wealth": wealth.WealthNewsCrawler,
        "worldjournal": worldjournal.WorldJournalNewsCrawler,
        "yahoo": yahoo.YahooNewsCrawler,
    }
    return LOCALIZERS[media_name]()

# encoding=utf-8
# Author: <NAME>
# Description: Factory pattern for MediaNewsCrawler

import logging
from src.crawler.media import (
    appledaily,
    bcc,
    bnext,
    chinatimes,
    cmmedia,
    cna,
    cnews,
    ctee,
    ctitv,
    cts,
    ctv,
    cnyes,
    digitimes,
    ebc,
    epochtimes,
    era,
    ettoday,
    ftv,
    kairos,
    ltn,
    mirror,
    moneydj,
    moneyudn,
    mypeoplevol,
    newtalk,
    nownews,
    pchome,
    peoplenews,
    pts,
    rti,
    setn,
    sina,
    storm,
    taiwanhot,
    taronews,
    technews,
    thenewslens,
    ttv,
    tvbs,
    udn,
    upmedia,
    ustv,
    wantrich,
    wealth,
    worldjournal,
    yahoo,
)

logger = logging.getLogger(__name__)


def MediaNewsCrawlerFactory(media_name: str):

    LOCALIZERS = {
        "appledaily": appledaily.AppleDailyNewsCrawler,
        "bcc": bcc.BCCNewsCrawler,
        "bnext": bnext.BnextNewsCrawler,
        "chinatimes": chinatimes.ChinatimesNewsCrawler,
        "cmmedia": cmmedia.CMMediaNewsCrawler,
        "cna": cna.CNANewsCrawler,
        "cnews": cnews.CNewsNewsCrawler,
        "ctee": ctee.CTEENewsCrawler,
        "ctitv": ctitv.CTITVNewsCrawler,
        "cts": cts.CTSNewsCrawler,
        "ctv": ctv.CTVNewsCrawler,
        "cnyes": cnyes.CNYESNewsCrawler,
        "digitimes": digitimes.DigitimesNewsCrawler,
        "ebc": ebc.EBCNewsCrawler,
        "epochtimes": epochtimes.EpochTimesNewsCrawler,
        "era": era.ERANewsCrawler,
        "ettoday": ettoday.ETtodayNewsCrawler,
        "ftv": ftv.FTVNewsCrawler,
        "kairos": kairos.KairosNewsCrawler,
        "ltn": ltn.LTNNewsCrawler,
        "mirror": mirror.MirrorNewsCrawler,
        "moneydj": moneydj.MoneyDJNewsCrawler,
        "moneyudn": moneyudn.MoneyUDNNewsCrawler,
        "mypeoplevol": mypeoplevol.MyPeopleVolNewsCrawler,
        "newtalk": newtalk.NewTalkNewsCrawler,
        "nownews": nownews.NowNewsNewsCrawler,
        "pchome": pchome.PChomeNewsCrawler,
        "peoplenews": peoplenews.PeopleNewsNewsCrawler,
        "pts": pts.PTSNewsCrawler,
        "rti": rti.RTINewsCrawler,
        "setn": setn.SETNNewsCrawler,
        "sina": sina.SINANewsCrawler,
        "storm": storm.StormNewsCrawler,
        "taiwanhot": taiwanhot.TaiwanHotNewsCrawler,
        "taronews": taronews.TaroNewsNewsCrawler,
        "technews": technews.TechnewsNewsCrawler,
        "thenewslens": thenewslens.TheNewsLensNewsCrawler,
        "ttv": ttv.TTVNewsCrawler,
        "tvbs": tvbs.TVBSNewsCrawler,
        "udn": udn.UDNNewsCrawler,
        "upmedia": upmedia.UpMediaNewsCrawler,
        "ustv": ustv.USTVNewsCrawler,
        "wantrich": wantrich.WantRichNewsCrawler,
        "wealth": wealth.WealthNewsCrawler,
        "worldjournal": worldjournal.WorldJournalNewsCrawler,
        "yahoo": yahoo.YahooNewsCrawler,
    }
    return LOCALIZERS[media_name]()

# encoding=utf-8 # Author: <NAME> # Description: Factory pattern for MediaNewsCrawler