|
@@ -240,5 +240,26 @@ def xigua_search_v2(keyword, sensitive_words):
|
|
|
'user-agent': FakeUserAgent().chrome
|
|
|
}
|
|
|
response = requests.request("GET", url, headers=headers, params=params)
|
|
|
-
|
|
|
- print(json.dumps(response.json()['data']['data'], ensure_ascii=False, indent=4))
|
|
|
+ try:
|
|
|
+ recall_list = response.json()['data']['data']
|
|
|
+ if recall_list:
|
|
|
+ for obj in recall_list:
|
|
|
+ if obj['type'] == "video":
|
|
|
+ title = obj['data']['title']
|
|
|
+ url = obj['data']['group_id']
|
|
|
+ duration = obj['data']['video_time']
|
|
|
+ watch_count = obj['data']['video_watch_count']
|
|
|
+ if sensitive_flag(sensitive_words, title) and duration <= 300:
|
|
|
+ try:
|
|
|
+ res = XiGuaFunctions().get_video_info(url)
|
|
|
+ if res:
|
|
|
+ return [res]
|
|
|
+ else:
|
|
|
+ continue
|
|
|
+ except Exception as e:
|
|
|
+ print(e)
|
|
|
+ return []
|
|
|
+ else:
|
|
|
+ return []
|
|
|
+ except Exception as e:
|
|
|
+ return []
|