|
@@ -98,14 +98,14 @@ class DownloadSendtime:
|
|
|
v_video_cover = data["cover_url"]
|
|
|
if "items" not in data["play_info"]:
|
|
|
if len(data["play_info"]) > 2:
|
|
|
- download_url_up = data["play_info"][2]["play_url"]
|
|
|
+ download_url_sendtime = data["play_info"][2]["play_url"]
|
|
|
else:
|
|
|
- download_url_up = data["play_info"][0]["play_url"]
|
|
|
+ download_url_sendtime = data["play_info"][0]["play_url"]
|
|
|
else:
|
|
|
if len(data["play_info"]["items"]) > 2:
|
|
|
- download_url_up = data["play_info"]["items"][2]["play_url"]
|
|
|
+ download_url_sendtime = data["play_info"]["items"][2]["play_url"]
|
|
|
else:
|
|
|
- download_url_up = data["play_info"]["items"][0]["play_url"]
|
|
|
+ download_url_sendtime = data["play_info"]["items"][0]["play_url"]
|
|
|
|
|
|
# 判断基本规则
|
|
|
if download_video_id not in [j for i in Feishu.get_values_batch("20ce0c") for j in i]\
|
|
@@ -114,7 +114,7 @@ class DownloadSendtime:
|
|
|
and v_play_cnt_sendtime != "" and v_comment_cnt != "" and v_liked_cnt != "" \
|
|
|
and v_shared_cnt != "" and v_width != "" and v_height != "" \
|
|
|
and v_send_date != "" and v_username != "" and v_user_cover != "" \
|
|
|
- and v_video_cover != "" and download_url_up != "":
|
|
|
+ and v_video_cover != "" and download_url_sendtime != "":
|
|
|
# 满足下载条件:当前时间 - 发布时间 <= 3天,播放量大于1万
|
|
|
if int(time.time()) - int(v_send_date) <= 604800:
|
|
|
if int(v_play_cnt_sendtime) >= 10000:
|
|
@@ -124,7 +124,7 @@ class DownloadSendtime:
|
|
|
# 下载封面
|
|
|
Common.download_method("cover", download_video_title, v_video_cover)
|
|
|
# 下载视频
|
|
|
- Common.download_method("video", download_video_title, download_url_up)
|
|
|
+ Common.download_method("video", download_video_title, download_url_sendtime)
|
|
|
# 保存视频信息到 "./files/{视频标题}/videoinfo.txt"
|
|
|
with open(r"./videos/" + download_video_title +
|
|
|
"/" + "info.txt", "a", encoding="utf8") as f_a2:
|
|
@@ -139,9 +139,10 @@ class DownloadSendtime:
|
|
|
str(v_send_date) + "\n" +
|
|
|
str(v_username) + "\n" +
|
|
|
str(v_user_cover) + "\n" +
|
|
|
- str(download_url_up) + "\n" +
|
|
|
+ str(download_url_sendtime) + "\n" +
|
|
|
str(v_video_cover) + "\n" +
|
|
|
str(sendtime_session))
|
|
|
+ Common.logger().info("==========视频信息已保存至info.txt==========")
|
|
|
|
|
|
# 上传该视频
|
|
|
Common.logger().info("开始上传视频:{}", download_video_title)
|
|
@@ -153,8 +154,25 @@ class DownloadSendtime:
|
|
|
# 看一看+ ,视频ID工作表,插入首行
|
|
|
Feishu.insert_columns("20ce0c")
|
|
|
# 看一看+ ,视频ID工作表,首行写入数据
|
|
|
- Feishu.update_values("20ce0c", download_video_id, "", "", "",
|
|
|
- "", "", "", "", "", "", "", "", "", "", "")
|
|
|
+ upload_time = int(time.time())
|
|
|
+ Feishu.update_values("20ce0c",
|
|
|
+ str(time.strftime("%Y-%m-%d %H:%M:%S",
|
|
|
+ time.localtime(upload_time))),
|
|
|
+ str(download_video_id),
|
|
|
+ str(v_play_cnt_sendtime),
|
|
|
+ str(download_video_title),
|
|
|
+ str(v_duration),
|
|
|
+ str(v_comment_cnt),
|
|
|
+ str(v_liked_cnt),
|
|
|
+ str(v_shared_cnt),
|
|
|
+ str(v_resolution),
|
|
|
+ str(time.strftime("%Y-%m-%d %H:%M:%S",
|
|
|
+ time.localtime(int(v_send_date)))),
|
|
|
+ str(v_username),
|
|
|
+ str(v_user_cover),
|
|
|
+ str(v_video_cover),
|
|
|
+ str(download_url_sendtime),
|
|
|
+ str(sendtime_session))
|
|
|
|
|
|
# 从云文档删除该视频信息:https://w42nne6hzg.feishu.cn/sheets/shtcngRPoDYAi24x52j2nDuHMih?sheet=SdCHOM
|
|
|
Common.logger().info("从云文档删除该视频信息:{}", download_video_title)
|