|
@@ -1,7 +1,7 @@
|
|
|
import json
|
|
import json
|
|
|
-from typing import List, Dict
|
|
|
|
|
-from datetime import datetime, timedelta
|
|
|
|
|
|
|
+from typing import List
|
|
|
|
|
|
|
|
|
|
+from datetime import datetime, timedelta
|
|
|
from odps.types import Record
|
|
from odps.types import Record
|
|
|
|
|
|
|
|
from app.infra.shared.tools import fetch_from_odps
|
|
from app.infra.shared.tools import fetch_from_odps
|
|
@@ -13,15 +13,13 @@ class VideoDecodeUtils:
|
|
|
@staticmethod
|
|
@staticmethod
|
|
|
def get_top_head_videos(execute_dt):
|
|
def get_top_head_videos(execute_dt):
|
|
|
uv_threshold = 500
|
|
uv_threshold = 500
|
|
|
- # dt = (datetime.today() - timedelta(days=1)).strftime("%Y%m%d")
|
|
|
|
|
- dt = execute_dt
|
|
|
|
|
query = f"""
|
|
query = f"""
|
|
|
WITH top_video AS
|
|
WITH top_video AS
|
|
|
(
|
|
(
|
|
|
SELECT dt, channel, 合作方名,包名,公众号名,hotsencetype, videoid, rootsourceid,title,`merge二级品类`
|
|
SELECT dt, channel, 合作方名,包名,公众号名,hotsencetype, videoid, rootsourceid,title,`merge二级品类`
|
|
|
,COUNT(DISTINCT mid) AS 访问uv
|
|
,COUNT(DISTINCT mid) AS 访问uv
|
|
|
FROM loghubods.opengid_base_data
|
|
FROM loghubods.opengid_base_data
|
|
|
- WHERE dt = '{dt}'
|
|
|
|
|
|
|
+ WHERE dt = '{execute_dt}'
|
|
|
AND hotsencetype != 1167
|
|
AND hotsencetype != 1167
|
|
|
AND videoid IS NOT NULL
|
|
AND videoid IS NOT NULL
|
|
|
AND usersharedepth = 0
|
|
AND usersharedepth = 0
|
|
@@ -82,3 +80,7 @@ class VideoDecodeUtils:
|
|
|
response = await fetch_piaoquan_video_list_detail(video_list=[video_id])
|
|
response = await fetch_piaoquan_video_list_detail(video_list=[video_id])
|
|
|
video_path = response["data"][0]["ossVideoPath"]
|
|
video_path = response["data"][0]["ossVideoPath"]
|
|
|
return video_path
|
|
return video_path
|
|
|
|
|
+
|
|
|
|
|
+ @staticmethod
|
|
|
|
|
+ def get_yesterday_dt():
|
|
|
|
|
+ return (datetime.today() - timedelta(days=1)).strftime("%Y%m%d")
|