|
@@ -165,7 +165,7 @@ class GongzhonghaoFollow:
|
|
driver.implicitly_wait(10)
|
|
driver.implicitly_wait(10)
|
|
# Common.logger(log_type, crawler).info('打开文章链接')
|
|
# Common.logger(log_type, crawler).info('打开文章链接')
|
|
driver.get(article_url)
|
|
driver.get(article_url)
|
|
- time.sleep(2)
|
|
|
|
|
|
+ time.sleep(1)
|
|
|
|
|
|
if len(driver.find_elements(By.XPATH, '//div[@class="js_video_poster video_poster"]/*[2]')) != 0:
|
|
if len(driver.find_elements(By.XPATH, '//div[@class="js_video_poster video_poster"]/*[2]')) != 0:
|
|
video_url = driver.find_element(
|
|
video_url = driver.find_element(
|
|
@@ -333,6 +333,11 @@ class GongzhonghaoFollow:
|
|
# 获取视频时长
|
|
# 获取视频时长
|
|
ffmpeg_dict = Common.ffmpeg(log_type, crawler,
|
|
ffmpeg_dict = Common.ffmpeg(log_type, crawler,
|
|
f"./{crawler}/videos/{video_dict['video_title']}/video.mp4")
|
|
f"./{crawler}/videos/{video_dict['video_title']}/video.mp4")
|
|
|
|
+ if ffmpeg_dict is None:
|
|
|
|
+ # 删除视频文件夹
|
|
|
|
+ shutil.rmtree(f"./{crawler}/videos/{video_dict['video_title']}")
|
|
|
|
+ Common.logger(log_type, crawler).info("视频size=0,删除成功\n")
|
|
|
|
+ return
|
|
video_dict["video_width"] = ffmpeg_dict["width"]
|
|
video_dict["video_width"] = ffmpeg_dict["width"]
|
|
video_dict["video_height"] = ffmpeg_dict["height"]
|
|
video_dict["video_height"] = ffmpeg_dict["height"]
|
|
video_dict["duration"] = ffmpeg_dict["duration"]
|
|
video_dict["duration"] = ffmpeg_dict["duration"]
|