ソースを参照

视频号抓取任务

luojunhui 3 ヶ月 前
コミット
7bdcfca1b8

+ 0 - 5
applications/utils/download_video.py

@@ -92,11 +92,6 @@ def download_sph_video(download_url, key):
                     if chunk:  # filter out keep-alive chunks
                     if chunk:  # filter out keep-alive chunks
                         f.write(chunk)
                         f.write(chunk)
 
 
-        # 判断视频的大小
-        if os.path.getsize(encrypted_path) > 100 * 1024 * 1024:
-            os.remove(encrypted_path)
-            raise ValueError("Video size is too large")
-
         decrypt_sph_video(encrypted_path, key, decrypted_path)
         decrypt_sph_video(encrypted_path, key, decrypted_path)
         os.remove(encrypted_path)
         os.remove(encrypted_path)
         return decrypted_path
         return decrypted_path

+ 1 - 1
tasks/crawler_channel_account_videos.py

@@ -81,7 +81,7 @@ class CrawlerChannelAccountVideos:
             return
             return
 
 
         video_length = video['objectDesc']['media'][0]['VideoPlayLen']
         video_length = video['objectDesc']['media'][0]['VideoPlayLen']
-        if video_length and int(video_length) > 300:
+        if video_length and int(video_length) > 240:
             print("video to large")
             print("video to large")
             return
             return