瀏覽代碼

update 西瓜和YouTube类名修改,防止冲突

lierqiang 2 年之前
父節點
當前提交
2b110b5316

+ 2 - 2
xigua/xigua_main/run_xigua_search.py

@@ -8,14 +8,14 @@ import time
 
 
 sys.path.append(os.getcwd())
 sys.path.append(os.getcwd())
 from common.common import Common
 from common.common import Common
-from xigua.xigua_search.xigua_search import Search
+from xigua.xigua_search.xigua_search import XiguaSearch
 from common.feishu import Feishu
 from common.feishu import Feishu
 
 
 
 
 def main(log_type, crawler, strategy, oss_endpoint, env, machine):
 def main(log_type, crawler, strategy, oss_endpoint, env, machine):
     try:
     try:
         Common.logger(log_type, crawler).info('开始抓取 西瓜视频 搜索\n')
         Common.logger(log_type, crawler).info('开始抓取 西瓜视频 搜索\n')
-        Search.get_search_videos(log_type, crawler, strategy, oss_endpoint, env, machine)
+        XiguaSearch.get_search_videos(log_type, crawler, strategy, oss_endpoint, env, machine)
         Common.del_logs(log_type, crawler)
         Common.del_logs(log_type, crawler)
         Common.logger(log_type, crawler).info('抓取完一轮,休眠 1 分钟\n')
         Common.logger(log_type, crawler).info('抓取完一轮,休眠 1 分钟\n')
     except Exception as e:
     except Exception as e:

+ 1 - 1
xigua/xigua_search/xigua_search.py

@@ -24,7 +24,7 @@ from common.publish import Publish
 from common.userAgent import get_random_user_agent, random_user_agent
 from common.userAgent import get_random_user_agent, random_user_agent
 
 
 
 
-class Search:
+class XiguaSearch:
     platform = "西瓜视频"
     platform = "西瓜视频"
     tag = "西瓜视频爬虫,搜索爬虫策略"
     tag = "西瓜视频爬虫,搜索爬虫策略"
 
 

+ 9 - 9
youtube/youtube_follow/youtube_follow_api.py

@@ -48,7 +48,7 @@ def format_nums(data):
     return count
     return count
 
 
 
 
-class Follow:
+class YoutubeFollow:
     # 翻页参数
     # 翻页参数
     continuation = ''
     continuation = ''
     # 抓取平台
     # 抓取平台
@@ -1174,14 +1174,14 @@ class Follow:
 
 
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
-    # print(Follow.get_browse_id('follow', 'youtube', '@chinatravel5971', "local"))
-    # print(Follow.get_user_from_feishu('follow', 'youtube', 'c467d7', 'dev', 'local'))
-    # print(Follow.get_user_from_feishu('follow', 'youtube', 'c467d7', 'prod', 'prod'))
-    # Follow.get_out_user_info('follow', 'youtube', 'UC08jgxf119fzynp2uHCvZIg', '@weitravel')
-    # Follow.get_video_info('follow', 'youtube', 'OGVK0IXBIhI')
-    # Follow.get_follow_videos('follow', 'youtube', 'youtube_follow', 'out', 'dev', 'local')
-    # print(Follow.filter_emoji("姐妹倆一唱一和,完美配合,終於把大慶降服了😅😅#萌娃搞笑日常"))
-    # Follow.repeat_video('follow', 'youtube', 4, "dev", "local")
+    # print(YoutubeFollow.get_browse_id('follow', 'youtube', '@chinatravel5971', "local"))
+    # print(YoutubeFollow.get_user_from_feishu('follow', 'youtube', 'c467d7', 'dev', 'local'))
+    # print(YoutubeFollow.get_user_from_feishu('follow', 'youtube', 'c467d7', 'prod', 'prod'))
+    # YoutubeFollow.get_out_user_info('follow', 'youtube', 'UC08jgxf119fzynp2uHCvZIg', '@weitravel')
+    # YoutubeFollow.get_video_info('follow', 'youtube', 'OGVK0IXBIhI')
+    # YoutubeFollow.get_follow_videos('follow', 'youtube', 'youtube_follow', 'out', 'dev', 'local')
+    # print(YoutubeFollow.filter_emoji("姐妹倆一唱一和,完美配合,終於把大慶降服了😅😅#萌娃搞笑日常"))
+    # YoutubeFollow.repeat_video('follow', 'youtube', 4, "dev", "local")
     # title = "'西部巡游220丨两人一车环游中国半年,需要花费多少钱? 2万公里吃住行费用总结'"
     # title = "'西部巡游220丨两人一车环游中国半年,需要花费多少钱? 2万公里吃住行费用总结'"
     # title = "'Insanely Crowded Shanghai Yu Garden Lantern Festival Walk Tour 2023 人气爆棚的上海豫园元宵节漫步之行 4K'"
     # title = "'Insanely Crowded Shanghai Yu Garden Lantern Festival Walk Tour 2023 人气爆棚的上海豫园元宵节漫步之行 4K'"
     # print(title.strip().replace("\\", "").replace(" ", "").replace("\n", "").replace("/", "").replace("\r", "").replace("&NBSP", "").replace("&", ""))
     # print(title.strip().replace("\\", "").replace(" ", "").replace("\n", "").replace("/", "").replace("\r", "").replace("&NBSP", "").replace("&", ""))

+ 1 - 1
youtube/youtube_follow/youtube_follow_scheduling.py

@@ -35,7 +35,7 @@ def format_nums(data):
     return count
     return count
 
 
 
 
-class Follow:
+class YoutubeFollowSchedule:
     # 翻页参数
     # 翻页参数
     continuation = ''
     continuation = ''
     # 抓取平台
     # 抓取平台

+ 2 - 2
youtube/youtube_main/run_youtube_follow.py

@@ -7,13 +7,13 @@ import sys
 import time
 import time
 sys.path.append(os.getcwd())
 sys.path.append(os.getcwd())
 from common.common import Common
 from common.common import Common
-from youtube.youtube_follow.youtube_follow_api import Follow
+from youtube.youtube_follow.youtube_follow_api import YoutubeFollow
 
 
 
 
 def main(log_type, crawler, strategy, oss_endpoint, env, machine):
 def main(log_type, crawler, strategy, oss_endpoint, env, machine):
     while True:
     while True:
         Common.logger(log_type, crawler).info('开始抓取youtube定向榜\n')
         Common.logger(log_type, crawler).info('开始抓取youtube定向榜\n')
-        Follow.get_follow_videos(log_type, crawler, strategy, oss_endpoint, env, machine)
+        YoutubeFollow.get_follow_videos(log_type, crawler, strategy, oss_endpoint, env, machine)
         Common.del_logs(log_type, crawler)
         Common.del_logs(log_type, crawler)
         Common.logger(log_type, crawler).info('抓取完一轮,休眠 1 分钟\n')
         Common.logger(log_type, crawler).info('抓取完一轮,休眠 1 分钟\n')
         time.sleep(60)
         time.sleep(60)

+ 2 - 2
youtube/youtube_main/run_youtube_follow_scheduling.py

@@ -7,7 +7,7 @@ import sys
 
 
 sys.path.append(os.getcwd())
 sys.path.append(os.getcwd())
 from common.common import Common
 from common.common import Common
-from youtube.youtube_follow.youtube_follow_scheduling import Follow
+from youtube.youtube_follow.youtube_follow_scheduling import YoutubeFollowSchedule
 
 
 
 
 def main(log_type, crawler, task, oss_endpoint, env):
 def main(log_type, crawler, task, oss_endpoint, env):
@@ -16,7 +16,7 @@ def main(log_type, crawler, task, oss_endpoint, env):
     Common.logger(log_type, crawler).info(f"{task}\n")
     Common.logger(log_type, crawler).info(f"{task}\n")
     try:
     try:
         Common.logger(log_type, crawler).info('开始抓取 youtube视频 定向榜\n')
         Common.logger(log_type, crawler).info('开始抓取 youtube视频 定向榜\n')
-        Follow.get_follow_videos(log_type=log_type,
+        YoutubeFollowSchedule.get_follow_videos(log_type=log_type,
                                            crawler=crawler,
                                            crawler=crawler,
                                            task=task,
                                            task=task,
                                            oss_endpoint=oss_endpoint,
                                            oss_endpoint=oss_endpoint,