|
@@ -27,7 +27,7 @@ class douyinAuthor():
|
|
"""
|
|
"""
|
|
@classmethod
|
|
@classmethod
|
|
def get_videoUserId(cls):
|
|
def get_videoUserId(cls):
|
|
- select_user_sql = f"""select user_id from video_user_id where channel = "抖音";"""
|
|
|
|
|
|
+ select_user_sql = f"""select user_id, channel from video_user_id where channel LIKE '%抖音%' ORDER BY id DESC;"""
|
|
user_list = MysqlHelper.get_values(select_user_sql, "prod")
|
|
user_list = MysqlHelper.get_values(select_user_sql, "prod")
|
|
return user_list
|
|
return user_list
|
|
|
|
|
|
@@ -65,12 +65,14 @@ class douyinAuthor():
|
|
cookie = Material.get_douyin_cookie()
|
|
cookie = Material.get_douyin_cookie()
|
|
# 读取飞书表格,更新数据库用户主页id
|
|
# 读取飞书表格,更新数据库用户主页id
|
|
Material.insert_user()
|
|
Material.insert_user()
|
|
|
|
+ Material.insert_pinjie_user()
|
|
# 获取 用户主页id
|
|
# 获取 用户主页id
|
|
user_list = cls.get_videoUserId()
|
|
user_list = cls.get_videoUserId()
|
|
if len(user_list) == 0:
|
|
if len(user_list) == 0:
|
|
return
|
|
return
|
|
for i in user_list:
|
|
for i in user_list:
|
|
account_id = i[0].replace('(', '').replace(')', '').replace(',', '')
|
|
account_id = i[0].replace('(', '').replace(')', '').replace(',', '')
|
|
|
|
+ channel = i[1].replace('(', '').replace(')', '').replace(',', '')
|
|
Common.logger("douyin").info(f"用户主页ID:{account_id}")
|
|
Common.logger("douyin").info(f"用户主页ID:{account_id}")
|
|
next_cursor = 0
|
|
next_cursor = 0
|
|
while True:
|
|
while True:
|
|
@@ -144,7 +146,11 @@ class douyinAuthor():
|
|
break
|
|
break
|
|
continue
|
|
continue
|
|
video_url = data[i].get('video').get('play_addr').get('url_list')[0] # 视频链接
|
|
video_url = data[i].get('video').get('play_addr').get('url_list')[0] # 视频链接
|
|
- oss_object_key = Oss.video_sync_upload_oss(video_url, video_id, account_id, "douyin")
|
|
|
|
|
|
+ if channel == "抖音-拼接类":
|
|
|
|
+ channel_name = 'dypinjie'
|
|
|
|
+ else:
|
|
|
|
+ channel_name = 'douyin'
|
|
|
|
+ oss_object_key = Oss.video_sync_upload_oss(video_url, video_id, account_id, channel_name)
|
|
status = oss_object_key.get("status")
|
|
status = oss_object_key.get("status")
|
|
# 发送 oss
|
|
# 发送 oss
|
|
oss_object_key = oss_object_key.get("oss_object_key")
|
|
oss_object_key = oss_object_key.get("oss_object_key")
|