|
@@ -64,20 +64,20 @@ class SPH:
|
|
url = "http://8.217.190.241:8888/crawler/wei_xin/shi_pin_hao/blogger"
|
|
url = "http://8.217.190.241:8888/crawler/wei_xin/shi_pin_hao/blogger"
|
|
next_cursor = ""
|
|
next_cursor = ""
|
|
list = []
|
|
list = []
|
|
- for i in range(10):
|
|
|
|
- headers = {
|
|
|
|
- 'Content-Type': 'application/json'
|
|
|
|
- }
|
|
|
|
- payload = json.dumps({
|
|
|
|
- "account_id": account_id,
|
|
|
|
- "cursor": next_cursor
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
|
|
+ # for i in range(10):
|
|
|
|
+ headers = {
|
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
|
+ }
|
|
|
|
+ payload = json.dumps({
|
|
|
|
+ "account_id": account_id,
|
|
|
|
+ "cursor": next_cursor
|
|
|
|
+ })
|
|
|
|
+ try:
|
|
response = requests.request("POST", url, headers=headers, data=payload)
|
|
response = requests.request("POST", url, headers=headers, data=payload)
|
|
time.sleep(random.randint(1, 5))
|
|
time.sleep(random.randint(1, 5))
|
|
res_json = response.json()
|
|
res_json = response.json()
|
|
if res_json['code'] == 0:
|
|
if res_json['code'] == 0:
|
|
- next_cursor = res_json['data']['next_cursor']
|
|
|
|
|
|
+ # next_cursor = res_json['data']['next_cursor']
|
|
data_lsit = res_json['data']['data']
|
|
data_lsit = res_json['data']['data']
|
|
for obj in data_lsit:
|
|
for obj in data_lsit:
|
|
objectId = obj['id']
|
|
objectId = obj['id']
|
|
@@ -113,7 +113,7 @@ class SPH:
|
|
|
|
|
|
continue
|
|
continue
|
|
AliyunLogger.logging(channel_id, name, url_id, objectId, "符合规则等待改造", "2004", log_data)
|
|
AliyunLogger.logging(channel_id, name, url_id, objectId, "符合规则等待改造", "2004", log_data)
|
|
- all_data = {"video_id": objectId, "cover": cover, "video_url": video_url, "rule": video_percent, "old_title": old_title, "decode_key":decode_key}
|
|
|
|
|
|
+ all_data = {"video_id": objectId, "cover": cover, "video_url": video_url, "rule": video_percent, "old_title": old_title, "decode_key": decode_key}
|
|
list.append(all_data)
|
|
list.append(all_data)
|
|
if len(list) == int(number):
|
|
if len(list) == int(number):
|
|
Common.logger(mark).info(f"获取视频号视频总数:{len(list)}\n")
|
|
Common.logger(mark).info(f"获取视频号视频总数:{len(list)}\n")
|
|
@@ -124,10 +124,9 @@ class SPH:
|
|
Common.logger("sph").info(
|
|
Common.logger("sph").info(
|
|
f"不符合规则:{task_mark},用户主页id:{url_id},视频id{objectId} ,分享:{share_cnt},点赞:{like_cnt}")
|
|
f"不符合规则:{task_mark},用户主页id:{url_id},视频id{objectId} ,分享:{share_cnt},点赞:{like_cnt}")
|
|
continue
|
|
continue
|
|
-
|
|
|
|
-
|
|
|
|
- return list
|
|
|
|
- return []
|
|
|
|
|
|
+ return list
|
|
|
|
+ except Exception:
|
|
|
|
+ return list
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|