|
@@ -231,31 +231,31 @@ class KuaiShouRecommend:
|
|
|
response.close()
|
|
|
except Exception as e:
|
|
|
Common.logger(log_type, crawler).error(f"get_videoList:{e}\n")
|
|
|
- return
|
|
|
+ continue
|
|
|
# Common.logger(log_type, crawler).info(f"get_videoList:{response.text}\n")
|
|
|
if response.status_code != 200:
|
|
|
Common.logger(log_type, crawler).warning(f"get_videoList_response:{response.text}\n")
|
|
|
- return
|
|
|
+ continue
|
|
|
elif 'data' not in response.json():
|
|
|
Common.logger(log_type, crawler).warning(f"get_videoList_response:{response.json()}\n")
|
|
|
- return
|
|
|
+ continue
|
|
|
elif 'visionNewRecoFeed' not in response.json()['data']:
|
|
|
Common.logger(log_type, crawler).warning(f"get_videoList_response:{response.json()['data']}\n")
|
|
|
- return
|
|
|
+ continue
|
|
|
elif 'feeds' not in response.json()['data']['visionNewRecoFeed']:
|
|
|
Common.logger(log_type, crawler).warning(
|
|
|
f"get_videoList_response:{response.json()['data']['visionNewRecoFeed']}\n")
|
|
|
- return
|
|
|
+ continue
|
|
|
elif len(response.json()['data']['visionNewRecoFeed']['feeds']) == 0:
|
|
|
Common.logger(log_type, crawler).info("没有更多视频啦 ~\n")
|
|
|
- return
|
|
|
+ continue
|
|
|
else:
|
|
|
feeds = response.json()['data']['visionNewRecoFeed']['feeds']
|
|
|
# pcursor = response.json()['data']['visionNewRecoFeed']['pcursor']
|
|
|
for i in range(len(feeds)):
|
|
|
if 'photo' not in feeds[i]:
|
|
|
Common.logger(log_type, crawler).warning(f"get_videoList:{feeds[i]}\n")
|
|
|
- break
|
|
|
+ continue
|
|
|
|
|
|
# video_title
|
|
|
if 'caption' not in feeds[i]['photo']:
|
|
@@ -269,12 +269,12 @@ class KuaiShouRecommend:
|
|
|
and 'manifest' not in feeds[i]['photo'] \
|
|
|
and 'manifestH265' not in feeds[i]['photo']:
|
|
|
Common.logger(log_type, crawler).warning(f"get_videoList:{feeds[i]['photo']}\n")
|
|
|
- break
|
|
|
+ continue
|
|
|
videoResource = feeds[i]['photo']['videoResource']
|
|
|
|
|
|
if 'h264' not in videoResource and 'hevc' not in videoResource:
|
|
|
Common.logger(log_type, crawler).warning(f"get_videoList:{videoResource}\n")
|
|
|
- break
|
|
|
+ continue
|
|
|
|
|
|
# video_id
|
|
|
if 'h264' in videoResource and 'videoId' in videoResource['h264']:
|