|
@@ -1,3 +1,5 @@
|
|
|
|
+from datetime import datetime
|
|
|
|
+
|
|
from loguru import logger
|
|
from loguru import logger
|
|
from common.aliyun_log import AliyunLogger
|
|
from common.aliyun_log import AliyunLogger
|
|
from common.feishu_utils import Feishu
|
|
from common.feishu_utils import Feishu
|
|
@@ -116,12 +118,12 @@ class Top:
|
|
channel_account_id = None
|
|
channel_account_id = None
|
|
tag_transport_channel = None
|
|
tag_transport_channel = None
|
|
data = json.loads(data)
|
|
data = json.loads(data)
|
|
- AliyunLogger.logging()
|
|
+ AliyunLogger.logging(data['channel'], data, "开始获取","开始获取")
|
|
channel_id = data['channel']
|
|
channel_id = data['channel']
|
|
url_id, data_channel = sqlCollect.get_channle_id(data['videoid'])
|
|
url_id, data_channel = sqlCollect.get_channle_id(data['videoid'])
|
|
if not url_id:
|
|
if not url_id:
|
|
logger.info(f"[+] 任务{data},没有该视频信息")
|
|
logger.info(f"[+] 任务{data},没有该视频信息")
|
|
- AliyunLogger.logging(data['channel'], data, "没有该视频信息",None)
|
|
+ AliyunLogger.logging(data['channel'], data, "没有该视频信息","没有该视频信息")
|
|
return
|
|
return
|
|
if "&vid=" in url_id or "?modal_id=" in url_id:
|
|
if "&vid=" in url_id or "?modal_id=" in url_id:
|
|
host = urlparse(url_id).netloc
|
|
host = urlparse(url_id).netloc
|
|
@@ -142,7 +144,7 @@ class Top:
|
|
logger.info(f"[+] {url_id}开始获取快手视频链接")
|
|
logger.info(f"[+] {url_id}开始获取快手视频链接")
|
|
channel_account_id= self.get_text_ks_video(url=url_id)
|
|
channel_account_id= self.get_text_ks_video(url=url_id)
|
|
if not channel_account_id:
|
|
if not channel_account_id:
|
|
- AliyunLogger.logging(data['channel'], data, "没有获取到视频用户ID,等待重新获取",None)
|
|
+ AliyunLogger.logging(data['channel'], data, "没有获取到视频用户ID,等待重新获取","没有获取到视频用户ID,等待重新获取")
|
|
in_job_video_data("task:top_all_data", json.dumps(data, ensure_ascii=False, indent=4))
|
|
in_job_video_data("task:top_all_data", json.dumps(data, ensure_ascii=False, indent=4))
|
|
return
|
|
return
|
|
data["channel_account_id"] = channel_account_id
|
|
data["channel_account_id"] = channel_account_id
|
|
@@ -155,7 +157,8 @@ class Top:
|
|
AliyunLogger.logging(data['channel'], data, "获取成功等待写入改造任务", channel_account_id)
|
|
AliyunLogger.logging(data['channel'], data, "获取成功等待写入改造任务", channel_account_id)
|
|
in_job_video_data(redis_data, json.dumps(data, ensure_ascii=False, indent=4))
|
|
in_job_video_data(redis_data, json.dumps(data, ensure_ascii=False, indent=4))
|
|
logger.info(f"[+] 开始写入飞书表格")
|
|
logger.info(f"[+] 开始写入飞书表格")
|
|
-
|
|
+ current_time = datetime.now()
|
|
|
|
+ formatted_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
|
|
values = [
|
|
values = [
|
|
[
|
|
[
|
|
data['uid'],
|
|
data['uid'],
|
|
@@ -168,7 +171,8 @@ class Top:
|
|
data['title'],
|
|
data['title'],
|
|
data['dt'],
|
|
data['dt'],
|
|
channel_account_id,
|
|
channel_account_id,
|
|
- tag_transport_channel
|
|
+ tag_transport_channel,
|
|
|
|
+ formatted_time
|
|
]
|
|
]
|
|
]
|
|
]
|
|
Feishu.insert_columns("KUIksoqZkhvZOrtqA1McPwObn7d", "57c076", "ROWS", 1, 2)
|
|
Feishu.insert_columns("KUIksoqZkhvZOrtqA1McPwObn7d", "57c076", "ROWS", 1, 2)
|