|
@@ -60,7 +60,8 @@ class douyinAuthor():
|
|
|
|
|
|
"""抖音读取数据 将数据存储到oss上"""
|
|
|
@classmethod
|
|
|
- def get_videoList(cls, cookie):
|
|
|
+ def get_videoList(cls):
|
|
|
+ cookie = Material.get_douyin_cookie()
|
|
|
# 读取飞书表格,更新数据库用户主页id
|
|
|
Material.insert_user()
|
|
|
# 获取 用户主页id
|
|
@@ -118,14 +119,14 @@ class douyinAuthor():
|
|
|
Feishu.bot('recommend', '抖音', '抖音cookie失效,请及时更换~')
|
|
|
# 如果返回空信息,则随机睡眠 600, 1200 秒
|
|
|
time.sleep(random.randint(600, 1200))
|
|
|
- job_douyin_data()
|
|
|
+ continue
|
|
|
elif len(data) == 0:
|
|
|
Common.logger().info(
|
|
|
f"接口请求失败,请更换cookie")
|
|
|
Feishu.bot('recommend', '抖音', '抖音cookie失效,请及时更换~')
|
|
|
# 如果返回空信息,则随机睡眠 600, 1200 秒
|
|
|
time.sleep(random.randint(600, 1200))
|
|
|
- job_douyin_data()
|
|
|
+ continue
|
|
|
count = 0
|
|
|
for i in range(len(data)):
|
|
|
try:
|
|
@@ -155,8 +156,3 @@ class douyinAuthor():
|
|
|
except Exception as e:
|
|
|
Common.logger().warning(f"抓取单条视频异常:{e}\n")
|
|
|
continue
|
|
|
-
|
|
|
- @classmethod
|
|
|
- def get_token(cls):
|
|
|
- cookie = Material.get_douyin_cookie()
|
|
|
- douyinAuthor.get_videoList(cookie)
|