jitenbot/bot/crawlers/factory.py

19 lines
654 B
Python
Raw Permalink Normal View History

2023-05-06 18:15:38 +00:00
from bot.targets import Targets
from bot.crawlers.crawlers import JitenonKokugoCrawler
from bot.crawlers.crawlers import JitenonYojiCrawler
from bot.crawlers.crawlers import JitenonKotowazaCrawler
from bot.crawlers.crawlers import Smk8Crawler
from bot.crawlers.crawlers import Daijirin2Crawler
2023-05-06 21:55:00 +00:00
def new_crawler(target):
2023-05-06 18:15:38 +00:00
crawler_map = {
Targets.JITENON_KOKUGO: JitenonKokugoCrawler,
Targets.JITENON_YOJI: JitenonYojiCrawler,
Targets.JITENON_KOTOWAZA: JitenonKotowazaCrawler,
Targets.SMK8: Smk8Crawler,
Targets.DAIJIRIN2: Daijirin2Crawler,
}
2023-05-06 21:55:00 +00:00
return crawler_map[target](target)