|
|
@@ -77,7 +77,8 @@ class CrawlerGzhFansBase(CrawlerGzhFansConst):
|
|
|
# 获取账号列表
|
|
|
async def get_account_list_from_database(self):
|
|
|
query = """
|
|
|
- SELECT gh_id, account_name, app_id, app_secret, cursor_openid, cursor_timestamp, crawl_history_status
|
|
|
+ SELECT gh_id, account_name, app_id, app_secret, cursor_openid, cursor_timestamp,
|
|
|
+ crawl_history_status, binding_status
|
|
|
FROM gzh_account_info WHERE status = %s;
|
|
|
"""
|
|
|
return await self.pool.async_fetch(query=query, params=(self.AVAILABLE_STATUS,))
|
|
|
@@ -437,6 +438,8 @@ class CrawlerGzhFans(CrawlerGzhFansBase):
|
|
|
if not user_info_list:
|
|
|
return
|
|
|
|
|
|
+ print(json.dumps(user_info_list, ensure_ascii=False, indent=4))
|
|
|
+
|
|
|
semaphore = asyncio.Semaphore(10)
|
|
|
tasks = [
|
|
|
self.save_single_union_user(account_info["gh_id"], user_info, semaphore)
|
|
|
@@ -461,8 +464,9 @@ class CrawlerGzhFans(CrawlerGzhFansBase):
|
|
|
)
|
|
|
|
|
|
case "get_union_ids":
|
|
|
+ binding_accounts = [i for i in account_list if i['binding_status'] == self.AVAILABLE_STATUS]
|
|
|
return await run_tasks_with_asyncio_task_group(
|
|
|
- task_list=account_list,
|
|
|
+ task_list=binding_accounts,
|
|
|
handler=self.get_union_ids_for_each_account,
|
|
|
max_concurrency=self.MAX_CONCURRENCY,
|
|
|
fail_fast=False,
|