|
@@ -7,7 +7,7 @@ import cffi
|
|
|
import requests
|
|
|
from urllib.parse import urlencode
|
|
|
|
|
|
-from common import Common, AliyunLogger
|
|
|
+from common import Common, AliyunLogger, Feishu
|
|
|
from common.sql_help import sqlCollect
|
|
|
|
|
|
|
|
@@ -314,7 +314,7 @@ class PQ:
|
|
|
data, enc_length = None, 0
|
|
|
for i in range(3):
|
|
|
try:
|
|
|
- response = requests.get(url=video_url, timeout=5)
|
|
|
+ response = requests.get(url=video_url, timeout=10)
|
|
|
data = response.content
|
|
|
data_length = int(response.headers.get("Content-Range", 0))
|
|
|
enc_length = int(response.headers.get('X-enclen', 131072))
|
|
@@ -323,6 +323,22 @@ class PQ:
|
|
|
except TimeoutError:
|
|
|
continue
|
|
|
if not data:
|
|
|
+ v_id = video["video_id"]
|
|
|
+ sqlCollect.update_shp_dd_vid_4(v_id)
|
|
|
+ from_user_name = video['from_user_name'] # 来源用户
|
|
|
+ from_group_name = video['from_group_name'] # 来源群组
|
|
|
+ source = video['source'] # 渠道
|
|
|
+ text = (
|
|
|
+ f"**渠道**: {source}\n"
|
|
|
+ f"**来源用户**: {from_user_name}\n"
|
|
|
+ f"**来源群组**: {from_group_name}\n"
|
|
|
+ f"**原视频链接**: {video['video_url']}\n"
|
|
|
+ f"**原视频封面**: {video['cover']}\n"
|
|
|
+ f"**原视频标题**: {video['old_title']}\n"
|
|
|
+ )
|
|
|
+ Feishu.finish_bot(text,
|
|
|
+ "https://open.feishu.cn/open-apis/bot/v2/hook/493b3d4c-5fae-4a9d-980b-1dd86636524e",
|
|
|
+ "【 视频下载失败 】")
|
|
|
return None
|
|
|
video_url = cls.decrypt_video(data=data, decode_key=decode_key, enc_length=enc_length)
|
|
|
|