12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- import os
- import sys
- import schedule
- import time
- sys.path.append(os.getcwd())
- from common import Common, Feishu
- from common.sql_help import sql
- from video_stitching.video_stitching import VideoStitching
- flag = True
- def job_video_stitching():
- global flag
- dy_yinmei_count = sql.get_dy_yinmei_account_id()
-
-
-
- ks_yinmei_count = sql.get_ks_yinmei_account_id()
- pjdouyin_account_id = sql.get_pjdouyin_account_id()
- ksdouyin_account_id = sql.get_ksdouyin_account_id()
- if int(ks_yinmei_count) < 10:
- Common.logger("video").info("开始执行-快手")
- video_type = "音画美文"
- channel_type = "kuaishou"
- VideoStitching.video_stitching(video_type, ks_yinmei_count, channel_type)
- elif int(dy_yinmei_count) < 10:
- Common.logger("video").info("开始执行-抖音")
- video_type = "音画美文"
- channel_type = "douyin"
- VideoStitching.video_stitching(video_type, dy_yinmei_count, channel_type)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- count = int(dy_yinmei_count + ks_yinmei_count)
- Common.logger("video").info(f"视频生成条数为:{count}")
- if count == 20:
- if flag:
- Feishu.bot('recommend', '拼接视频', '自制视频拼接完成啦,共计20条~')
- flag = False
- if count == 0:
- flag = True
- def job_feishu_bot():
-
- dy_yinmei_count = sql.get_dy_yinmei_account_id()
-
- ks_yinmei_count = sql.get_ks_yinmei_account_id()
-
- pjdouyin_account_id = sql.get_pjdouyin_account_id()
- ksdouyin_account_id = sql.get_ksdouyin_account_id()
- count = int(dy_yinmei_count + ks_yinmei_count)
- if count < 30:
- Feishu.bot('recommend', '拼接视频', f'视频生成异常,不符合预期,请检查\n目前生成数量如下:\n抖音-拼接类:{dy_yinmei_count}条 \n快手-拼接类:{ks_yinmei_count}条')
- schedule.every(15).minutes.do(job_video_stitching)
- schedule.every().day.at("13:30").do(job_feishu_bot)
- while True:
- schedule.run_pending()
- time.sleep(1)
|