mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-10-02 12:58:12 +08:00
feat: 小红书增加指定帖子爬取功能
fix: 修复程序一些异常 bug refactor: 优化部分代码逻辑
This commit is contained in:
@@ -23,11 +23,13 @@ class CrawlerFactory:
|
||||
async def main():
|
||||
# define command line params ...
|
||||
parser = argparse.ArgumentParser(description='Media crawler program.')
|
||||
parser.add_argument('--platform', type=str, help='Media platform select (xhs|dy)', choices=["xhs", "dy"],
|
||||
parser.add_argument('--platform', type=str, help='Media platform select (xhs | dy)', choices=["xhs", "dy"],
|
||||
default=config.PLATFORM)
|
||||
parser.add_argument('--lt', type=str, help='Login type (qrcode | phone | cookie)',
|
||||
choices=["qrcode", "phone", "cookie"], default=config.LOGIN_TYPE)
|
||||
|
||||
parser.add_argument('--type', type=str, help='crawler type (search | detail)',
|
||||
choices=["search","detail"],default=config.CRAWLER_TYPE)
|
||||
# init account pool
|
||||
account_pool = proxy_account_pool.create_account_pool()
|
||||
|
||||
@@ -40,7 +42,8 @@ async def main():
|
||||
crawler.init_config(
|
||||
platform=args.platform,
|
||||
login_type=args.lt,
|
||||
account_pool=account_pool
|
||||
account_pool=account_pool,
|
||||
crawler_type=args.type
|
||||
)
|
||||
await crawler.start()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user