1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- import os
- import sys
- import oss2
- import schedule
- import time
- sys.path.append(os.getcwd())
- from common import Common, Feishu
- from video_capture.kuaishou.kuaishou_author.kuaishou_author import kuaishouAuthor
- from common.sql_help import sql
- from video_stitching.video_stitching import VideoStitching
- from video_capture.douyin.douyin_author.douyin_author import douyinAuthor
- #
- # flag = True
- # def job_video_stitching():
- # global flag
- # dy_yinmei_count = sql.get_dy_yinmei_account_id()
- # koubo_count = sql.get_koubo_account_id()
- # ks_yinmei_count = sql.get_ks_yinmei_account_id()
- # if int(dy_yinmei_count) < 10:
- # Common.logger().info("开始执行")
- # video_type = "音画美文"
- # channel_type = "douyin"
- # VideoStitching.video_stitching(video_type, dy_yinmei_count, channel_type)
- # elif int(ks_yinmei_count) < 10:
- # Common.logger().info("开始执行")
- # video_type = "音画美文"
- # channel_type = "kuaishou"
- # VideoStitching.video_stitching(video_type, ks_yinmei_count, channel_type)
- # elif int(koubo_count) < 10:
- # Common.logger().info("开始执行")
- # video_type = "口播--美文类"
- # channel_type = "koubo"
- # VideoStitching.video_stitching(video_type, koubo_count, channel_type)
- # count = int(dy_yinmei_count + koubo_count + ks_yinmei_count)
- # if count == 30:
- # if flag:
- # Feishu.bot('recommend', '拼接视频', '自制视频拼接完成啦,共计30条~')
- # flag = False
- # if count == 0:
- # flag = True
- #
- # def job_feishu_bot():
- # dy_yinmei_count = sql.get_dy_yinmei_account_id()
- # koubo_count = sql.get_koubo_account_id()
- # ks_yinmei_count = sql.get_ks_yinmei_account_id()
- # count = int(dy_yinmei_count + koubo_count + ks_yinmei_count)
- # if count < 30:
- # Feishu.bot('recommend', '拼接视频', f'视频生成异常,不符合预期,请检查\n目前生成数量如下:\n抖音视频拼接:{dy_yinmei_count}条 \n快手视频拼接:{ks_yinmei_count}条\n口播视频拼接:{koubo_count}条')
- #
- # def job_douyin_data():
- # douyinAuthor.get_videoList()
- #
- # def job_kuaishou_data():
- # kuaishouAuthor.get_kuaishou_videoList()
- #
- # # 每5个小时执行一次
- # schedule.every(5).hours.do(job_douyin_data)
- #
- # # 每3个小时执行一次
- # schedule.every(3).hours.do(job_kuaishou_data)
- #
- # # 每15分钟执行一次
- # schedule.every(15).minutes.do(job_video_stitching)
- #
- # # 每天下午1:30执行任务
- # schedule.every().day.at("13:30").do(job_feishu_bot)
- #
- # while True:
- # schedule.run_pending()
- # time.sleep(1)
- OSS_ACCESS_KEY_ID = "LTAIP6x1l3DXfSxm"
- OSS_ACCESS_KEY_SECRET = "KbTaM9ars4OX3PMS6Xm7rtxGr1FLon"
- OSS_BUCKET_ENDPOINT = "oss-cn-hangzhou-internal.aliyuncs.com"# 内网地址
- OSS_BUCKET_NAME = "art-crawler"
- koubo_count = 1
- video_type = "口播--美文类"
- channel_type = "koubo"
- auth = oss2.Auth(OSS_ACCESS_KEY_ID, OSS_ACCESS_KEY_SECRET)
- bucket = oss2.Bucket(auth, OSS_BUCKET_ENDPOINT, OSS_BUCKET_NAME)
- if video_type == "口播--美文类":
- bucket.get_object_to_file("koubo/fo1", f'./video_stitching/video_material/koubo.mp4')
- print("完成")
- # VideoStitching.video_stitching(video_type, koubo_count, channel_type)
|