소스 검색

抖音运行脚本优化

zhangyong 1 년 전
부모
커밋
d9f942dddf
1개의 변경된 파일20개의 추가작업 그리고 2개의 파일을 삭제
  1. 20 2
      douyin_run.py

+ 20 - 2
douyin_run.py

@@ -1,4 +1,22 @@
+
+import schedule
+import time
+import os
+import sys
+sys.path.append(os.getcwd())
+
 from video_capture.douyin.douyin_author.douyin_author import douyinAuthor
 
-if __name__ == '__main__':
-    douyinAuthor.get_videoList()
+
+
+
+def job_douyin_data():
+    douyinAuthor.get_videoList()
+
+# 设置下午2点运行任务
+schedule.every().day.at("14:00").do(job_douyin_data)
+
+
+while True:
+    schedule.run_pending()
+    time.sleep(1)