1234567891011121314151617181920212223242526272829303132333435363738394041 |
- """
- @author: luojunhui
- @description: try to get some more accounts
- """
- from tasks.crawler_accounts_by_association import ChannelsAccountCrawler
- from tasks.crawler_accounts_by_association import ToutiaoAccountCrawler
- from tasks.crawler_accounts_by_association import HaoKanAccountCrawler
- from tasks.crawler_accounts_by_association import GzhAccountCrawler
- from tasks.generate_search_keys import get_association_title_list_in_multi_threads
- def deal_each_platform(platform: str) -> None:
- """
- deal each platform
- :param platform: str, channels or toutiao
- """
- match platform:
- case "toutiao":
- crawler = ToutiaoAccountCrawler()
- case "sph":
- crawler = ChannelsAccountCrawler()
- case "hksp":
- crawler = HaoKanAccountCrawler()
- case "gzh":
- crawler = GzhAccountCrawler()
- case _:
- raise RuntimeError("platform error")
- # start process
- crawler.deal()
- if __name__ == "__main__":
- # get_association_title_list_in_multi_threads()
- get_association_title_list_in_multi_threads()
- # get each platform
- platform_list = ["sph", "hksp", "toutiao", "gzh"]
- for platform_id in platform_list:
- deal_each_platform(platform=platform_id)
|