Prechádzať zdrojové kódy

Merge branch '2025-04-01-luojunhui-fix-channels-crawler' of luojunhui/LongArticlesJob into master

luojunhui 3 týždňov pred
rodič
commit
ef536bdb07
1 zmenil súbory, kde vykonal 11 pridanie a 3 odobranie
  1. 11 3
      tasks/crawler_channel_account_videos.py

+ 11 - 3
tasks/crawler_channel_account_videos.py

@@ -158,9 +158,17 @@ class CrawlerChannelAccountVideos:
                 break
 
             response_data = response["data"]
-            current_last_buffer = response_data["lastBuffer"]  # 更新分页游标
-            has_more = response_data["continueFlag"]  # 是否还有下一页
-            video_list = response_data["object"]
+            response_data_type = type(response_data)
+            if response_data_type is dict:
+                current_last_buffer = response_data.get["lastBuffer"]  # 更新分页游标
+                has_more = response_data["continueFlag"]  # 是否还有下一页
+                video_list = response_data["object"]
+            elif response_data_type is list:
+                has_more = False
+                video_list = response_data
+                video_list = video_list
+            else:
+                return
 
             if not video_list:
                 break