ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.41k stars 10.04k forks source link

CBS.com downloads with broken audio? #27972

Open RedPenguin2 opened 3 years ago

RedPenguin2 commented 3 years ago

Checklist

Verbose log


youtube-dl -v "https://www.cbs.com/shows/the-late-show-with-stephen-colbert/video/CmEfTFE9yg9zaG8PdEbzNjuPizMvkxxs/the-late-show-1-21-21-priyanka-chopra-jonas-derek-delgaudio-frank-oz-/"[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.cbs.com/shows/the-late-show-with-stephen-colbert/video/CmEfTFE9yg9zaG8PdEbzNjuPizMvkxxs/the-late-show-1-21-21-priyanka-chopra-jonas-derek-delgaudio-frank-oz-/']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.01.24.1
[debug] Python version 2.7.18 (CPython) - Linux-5.4.0-64-generic-x86_64-with-Ubuntu-20.04-focal
[debug] exe versions: ffmpeg N-55618-ga0acc44106-static, ffprobe 4.2.4, rtmpdump 2.4
[debug] Proxy map: {}
[CBS] CmEfTFE9yg9zaG8PdEbzNjuPizMvkxxs: Downloading XML
[CBS] CmEfTFE9yg9zaG8PdEbzNjuPizMvkxxs: Downloading StreamPack SMIL data
[CBS] CmEfTFE9yg9zaG8PdEbzNjuPizMvkxxs: Downloading m3u8 information[CBS] CmEfTFE9yg9zaG8PdEbzNjuPizMvkxxs: Downloading JSON metadata
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on u'https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_,2228,4628,3128,1628,848,503,000.mp4.csmil/index_1_av.m3u8?null=0&id=AgBILSzeF8iS3EbCD2Bc7p4gff4p%2fLU6G8Gm+Q5RMVxWAXA5H+N1sCMhBdoyrh7aXog8WyDFe7sXTw%3d%3d&hdntl=exp=1611731910~acl=%2fi%2ftemp_hd_gallery_video%2fCBS_Production_Outlet_VMS%2fvideo_robot%2fCBS_Production_Entertainment%2f2021%2f01%2f14%2f1843949635926%2fCBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80'
[download] Destination: The Late Show - 1_21_21 (Priyanka Chopra Jonas, Derek DelGaudio, Frank Oz)-CmEfTFE9yg9zaG8PdEbzNjuPizMvkxxs.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers 'Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3718.1 Safari/537.36
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Cookie: _alid_=Xk/dBima+aRc5AOa3A05iw==; hdntl=exp=1611731910~acl=%2fi%2ftemp_hd_gallery_video%2fCBS_Production_Outlet_VMS%2fvideo_robot%2fCBS_Production_Entertainment%2f2021%2f01%2f14%2f1843949635926%2fCBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80
' -i 'https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_,2228,4628,3128,1628,848,503,000.mp4.csmil/index_1_av.m3u8?null=0&id=AgBILSzeF8iS3EbCD2Bc7p4gff4p%2fLU6G8Gm+Q5RMVxWAXA5H+N1sCMhBdoyrh7aXog8WyDFe7sXTw%3d%3d&hdntl=exp=1611731910~acl=%2fi%2ftemp_hd_gallery_video%2fCBS_Production_Outlet_VMS%2fvideo_robot%2fCBS_Production_Entertainment%2f2021%2f01%2f14%2f1843949635926%2fCBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80' -c copy -f mp4 '-bsf:a' aac_adtstoasc 'file:The Late Show - 1_21_21 (Priyanka Chopra Jonas, Derek DelGaudio, Frank Oz)-CmEfTFE9yg9zaG8PdEbzNjuPizMvkxxs.mp4.part'
ffmpeg version N-55618-ga0acc44106-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      56. 63.100 / 56. 63.100
  libavcodec     58.115.102 / 58.115.102
  libavformat    58. 65.101 / 58. 65.101
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7. 95.100 /  7. 95.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[tcp @ 0x5bc1300] Starting connection attempt to 23.200.147.220 port 443
[tcp @ 0x5bc1300] Successfully connected to 23.200.147.220 port 443
[hls @ 0x5bbc9c0] Skip ('#EXT-X-ALLOW-CACHE:YES')
[hls @ 0x5bbc9c0] Skip ('#EXT-X-VERSION:3')
[hls @ 0x5bbc9c0] HLS request for url 'https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_,2228,4628,3128,1628,848,503,000.mp4.csmil/segment1_1_av.ts?null=0&id=AgBILSzeF8iS3EbCD2Bc7p4gff4p%2fLU6G8Gm+Q5RMVxWAXA5H+N1sCMhBdoyrh7aXog8WyDFe7sXTw%3d%3d&hdntl=exp=1611731910~acl=/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80', offset 0, playlist 0[hls @ 0x5bbc9c0] Opening 'https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_,2228,4628,3128,1628,848,503,000.mp4.csmil/crypt.key?null=0&id=AgBILSzeF8iS3EbCD2Bc7p4gff4p%2fLU6G8Gm+Q5RMVxWAXA5H+N1sCMhBdoyrh7aXog8WyDFe7sXTw%3d%3d&hdntl=exp=1611731910~acl=/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80' for reading
[tcp @ 0x5f43f40] Starting connection attempt to 23.200.147.220 port 443
[tcp @ 0x5f43f40] Successfully connected to 23.200.147.220 port 443
[AVIOContext @ 0x6276540] Statistics: 16 bytes read, 0 seeks
[hls @ 0x5bbc9c0] Opening 'crypto+https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_,2228,4628,3128,1628,848,503,000.mp4.csmil/segment1_1_av.ts?null=0&id=AgBILSzeF8iS3EbCD2Bc7p4gff4p%2fLU6G8Gm+Q5RMVxWAXA5H+N1sCMhBdoyrh7aXog8WyDFe7sXTw%3d%3d&hdntl=exp=1611731910~acl=/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80' for reading
[tcp @ 0x5f51680] Starting connection attempt to 23.200.147.220 port 443
[tcp @ 0x5f51680] Successfully connected to 23.200.147.220 port 443
[h264 @ 0x5f38dc0] Reinit context to 1920x1088, pix_fmt: yuv420p
Input #0, hls, from 'https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_,2228,4628,3128,1628,848,503,000.mp4.csmil/index_1_av.m3u8?null=0&id=AgBILSzeF8iS3EbCD2Bc7p4gff4p%2fLU6G8Gm+Q5RMVxWAXA5H+N1sCMhBdoyrh7aXog8WyDFe7sXTw%3d%3d&hdntl=exp=1611731910~acl=%2fi%2ftemp_hd_gallery_video%2fCBS_Production_Outlet_VMS%2fvideo_robot%2fCBS_Production_Entertainment%2f2021%2f01%2f14%2f1843949635926%2fCBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80':
  Duration: 00:40:40.83, start: 0.100667, bitrate: 0 kb/s
  Program 0 
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Video: h264 (High), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 29.97 tbr, 90k tbn, 59.94 tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
Output #0, mp4, to 'file:The Late Show - 1_21_21 (Priyanka Chopra Jonas, Derek DelGaudio, Frank Oz)-CmEfTFE9yg9zaG8PdEbzNjuPizMvkxxs.mp4.part':
  Metadata:
    encoder         : Lavf58.65.101
    Stream #0:0: Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 1920x1080 (0x0) [SAR 1:1 DAR 16:9], q=2-31, 29.97 tbr, 90k tbn, 90k tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=frame=  120 fps=0.0 q=-1.0 size=    2048kB time=00:00:03.97 bitrate=frame=  253 fps=250 q=-1.0 size=    5120kB time=00:00:08.46 bitrate=[AVIOContext @ 0x627fd80] Statistics: 6679828 bytes read, 0 seeks
[hls @ 0x5bbc9c0] HLS request for url 'https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_,2228,4628,3128,1628,848,503,000.mp4.csmil/segment2_1_av.ts?null=0&id=AgBILSzeF8iS3EbCD2Bc7p4gff4p%2fLU6G8Gm+Q5RMVxWAXA5H+N1sCMhBdoyrh7aXog8WyDFe7sXTw%3d%3d&hdntl=exp=1611731910~acl=/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80', offset 0, playlist 0[hls @ 0x5bbc9c0] Opening 'crypto+https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_,2228,4628,3128,1628,848,503,000.mp4.csmil/segment2_1_av.ts?null=0&id=AgBILSzeF8iS3EbCD2Bc7p4gff4p%2fLU6G8Gm+Q5RMVxWAXA5H+N1sCMhBdoyrh7aXog8WyDFe7sXTw%3d%3d&hdntl=exp=1611731910~acl=/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80' for reading
[tcp @ 0x63108c0] Starting connection attempt to 23.200.147.220 port 443
[tcp @ 0x63108c0] Successfully connected to 23.200.147.220 port 443
frame=  331 fps=217 q=-1.0 size=    6656kB time=00:00:11.05 bitrate=frame=  444 fps=219 q=-1.0 size=    9472kB time=00:00:14.82 bitrate=[AVIOContext @ 0x6176c00] Statistics: 6285780 bytes read, 0 seeks
[hls @ 0x5bbc9c0] HLS request for url 'https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_,2228,4628,3128,1628,848,503,000.mp4.csmil/segment3_1_av.ts?null=0&id=AgBILSzeF8iS3EbCD2Bc7p4gff4p%2fLU6G8Gm+Q5RMVxWAXA5H+N1sCMhBdoyrh7aXog8WyDFe7sXTw%3d%3d&hdntl=exp=1611731910~acl=/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80', offset 0, playlist 0[hls @ 0x5bbc9c0] Opening 'crypto+https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_,2228,4628,3128,1628,848,503,000.mp4.csmil/segment3_1_av.ts?null=0&id=AgBILSzeF8iS3EbCD2Bc7p4gff4p%2fLU6G8Gm+Q5RMVxWAXA5H+N1sCMhBdoyrh7aXog8WyDFe7sXTw%3d%3d&hdntl=exp=1611731910~acl=/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80' for reading
^C[tcp @ 0x616bb80] Starting connection attempt to 23.200.147.220 port 443
[tcp @ 0x616bb80] Successfully connected to 23.200.147.220 port 443
Not writing 'clli' atom. No content light level info.
Not writing 'mdcv' atom. Missing mastering metadata.
frame=  599 fps=218 q=-1.0 Lsize=   12296kB time=00:00:20.01 bitrate=5033.8kbits/s speed=7.28x    
video:11963kB audio:307kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.213757%
Input file #0 (https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2021/01/14/1843949635926/CBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_,2228,4628,3128,1628,848,503,000.mp4.csmil/index_1_av.m3u8?null=0&id=AgBILSzeF8iS3EbCD2Bc7p4gff4p%2fLU6G8Gm+Q5RMVxWAXA5H+N1sCMhBdoyrh7aXog8WyDFe7sXTw%3d%3d&hdntl=exp=1611731910~acl=%2fi%2ftemp_hd_gallery_video%2fCBS_Production_Outlet_VMS%2fvideo_robot%2fCBS_Production_Entertainment%2f2021%2f01%2f14%2f1843949635926%2fCBS_COLBERT_1036_CONTENT_CIAN_vantage_436979_*~data=hdntl~hmac=538b6dd5a223a7568758cbeb4505d0f590fb20eb5b77bd91ac949a4d14561a80):
  Input stream #0:0 (video): 599 packets read (12249863 bytes); 
  Input stream #0:1 (audio): 939 packets read (321003 bytes); 
  Total: 1538 packets (12570866 bytes) demuxed
Output file #0 (file:The Late Show - 1_21_21 (Priyanka Chopra Jonas, Derek DelGaudio, Frank Oz)-CmEfTFE9yg9zaG8PdEbzNjuPizMvkxxs.mp4.part):
  Output stream #0:0 (video): 599 packets muxed (12249863 bytes); 
  Output stream #0:1 (audio): 939 packets muxed (314430 bytes); 
  Total: 1538 packets (12564293 bytes) muxed
[AVIOContext @ 0x5f850c0] Statistics: 2 seeks, 51 writeouts
[AVIOContext @ 0x614e5c0] Statistics: 36848 bytes read, 0 seeks
[AVIOContext @ 0x5ecad80] Statistics: 156101 bytes read, 0 seeks
Exiting normally, received signal 2.

ERROR: Interrupted by user

Description

It downloads the episodes just fine from a link grabbing standpoint and dumping to hard drive.

Yet, I keep having some sort of random audio drift on various episodes. In that episode, right around 00:05:30, the audio randomly looses sync and starts to repeat itself once or twice then maybe 30 seconds later it's back to normal.

I have tried upgrading my ffmpeg and using different audio players including VLC, Media Player Classic, and Kodi.

Not all episodes seem to do this but a majority do but I'd say it started only in October and affected more and more over time.

RedPenguin2 commented 3 years ago

I may have made some progress but I have to watch more episodes downloaded now to verify.

I was using the ffmpeg versions from johnvansickle but temporarily removed them and went back to the default one from Ubuntu Repos and so far the 5min 30sec error is gone in that video.

Mr-Jake commented 3 years ago

I have also experienced this, but always thought it to be a CBS problem since it only occurs a small percentage of the time.

Did you try using HLS native instead of ffmpeg?

You could download each video twice and compare the CRCs of the files. If the CRC is a match, you have a good download. If the CRCs are different, download the video again until you have a match. I find this method faster and easier than having to watch each video where you could easily miss something.

RedPenguin2 commented 3 years ago

Did you try using HLS native instead of ffmpeg?

You could download each video twice and compare the CRCs of the files. If the CRC is a match, you have a good download. If the CRCs are different, download the video again until you have a match. I find this method faster and easier than having to watch each video where you could easily miss something.

I have just now tried the native option, forgot about it from the past.

I did also try downloading a video twice and got the exact same md5sum.

I will have to see how it goes as I watch episodes but so far it looks promising. It seems like Kodi is "liking" or playing the videos somewhat better using native. It appears to seek easier and resume from pause a lot smoother.

RedPenguin2 commented 3 years ago

Well it looks like so far for CBS, at least on my machine, - - hls-prefer-native is required.

I've watched at least 5, probably more episodes now and have not seen any audio issues like I mentioned in the OP.

I had some moments where I thought they returned but it was due to temporary player/network issues and not the videos during those times.

I guess for whatever reason there is something just not 100% compatible with CBS and ffmpeg. I know I've had that with other servers in the past but I never found out exactly why.

ryandesign commented 3 years ago

I've also been experiencing what I believe is this same issue with downloads from CBS for the past several months. I've hesitated to report it because of the intermittent nature of the problem. I encountered it today when downloading Monday's and Tuesday's episodes of The Late Show with Stephen Colbert. I then tried --hls-prefer-native for Wednesday's episode and did not encounter the problem, but since the problem is intermittent, I will continue to use --hls-prefer-native for future downloads and will report back if the problem occurs when using that flag.

As far as I understand it, the video is stored on the server as hundreds of ten-second chunks which are downloaded one after another and then combined. The way that I would describe the problem is that from time to time, the video portion of a chunk is mistakenly paired with the audio portion of the previous chunk. (You hear the same ten seconds of audio twice, but the video doesn't match it the second time it plays.) Then, the video freezes for ten seconds while the correct audio portion of the chunk plays. Then everything plays normally again until the next such error. The length of the complete file is thus too long by the number of errors times the length of a chunk. Seemingly at random, a file might download with no errors, or I might see dozens of errors in a single file.

If downloads normally happen at 20x, then each ten-second chunk downloads in half a second, so each line of download output is printed half a second apart. But sometimes there will be a noticeable pause of a second or five seconds or ten seconds, and I believe that such pauses coincide with the occurrence of the errors though I have not proved this and would not know whether it is a symptom or a cause.

I have experienced the issue on two different Macs, with macOS High Sierra 10.13.6 and macOS Big Sur 11.0.1, with different versions of Python 3.7/3.8/3.9.

ryandesign commented 3 years ago

Happened again with the latest Colbert episode from 3/4/2021, with youtube-dl 2021.03.03 running under Python 3.9.2. I was using --hls-prefer-native but it was apparently ignored because the output contained:

WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg

As suggested elsewhere, I installed the pycrypto module and then hlsnative downloads were possible again.

RedPenguin2 commented 3 years ago

Happened again with the latest Colbert episode from 3/4/2021, with youtube-dl 2021.03.03 running under Python 3.9.2. I was using --hls-prefer-native but it was apparently ignored because the output contained:

WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg

As suggested elsewhere, I installed the pycrypto module and then hlsnative downloads were possible again.

Thanks for the info!

I know on my Ubuntu PC, it should be 1-2-3.

I know it will probably be more fun on Windows. I did find pre-built binaries for Windows but I have to see how you tell streamlink where it is.

I like how so many say Windows is more user friendly but for stuff like this, I find Windows more work....

RedPenguin2 commented 3 years ago

I am having a strange issue that I do not know how to explain.

I have youtube-dl latest, on both my Ubuntu and Win 10 PCs and they have both always worked, no problem at all.

At first I thought it was the --hls-prefer-native but even using ffmpeg produces the exact same result.

For some reason, the Win 10 youtube-dl appears to download a CBS episode perfectly but the Ubuntu version will claim it downloaded 100% but end up with some strange 15-100MB or so file that is a blob with broken video and no audio.

ryandesign commented 3 years ago

I will continue to use --hls-prefer-native for future downloads and will report back if the problem occurs when using that flag.

I have now observed the problem occur more than once when using --hls-prefer-native so using that flag is not a solution or workaround.

sometimes there will be a noticeable pause of a second or five seconds or ten seconds, and I believe that such pauses coincide with the occurrence of the errors though I have not proved this and would not know whether it is a symptom or a cause.

I can now confirm this observation. Here is a log I made of a download, piping the output of youtube-dl through ts -i %.T to show how long each line took. Corruptions seem to coincide with the lines that start with "00:00:1"—lines that took longer than 10 seconds.

putnam commented 3 years ago

I am able to repro this as well. It is non-deterministic in nature so there is no one video URL we can share that will repro, only that it will eventually do so. It's also really tricky to detect whether it happens, until you watch an affected file. Excellent work narrowing it down, @ryandesign

I also attempted to download through an alternative method and experienced similar random audio hiccups and haven't had time to dig deeper to understand why these don't affect playback in CBS/Paramount's own web player.

Jessecar96 commented 3 years ago

I'm also having this issue when downloading from cbs/paramount+. I'm able to find out if one failed by looking at the file and comparing the subtitles to the audio later in the video. If they don't match then there's a glitch somewhere in it. I've noticed this only happens sometimes after downloading a bunch of episodes. I'm thinking it's some kind of weird rate limiting but I haven't been able to stay within it with anything I tried.

ryandesign commented 3 years ago

I don't believe it's rate-limiting since it can happen on the first video I download. It's just random. For all I know, maybe it's just that one of the Paramount Plus content delivery servers is misbehaving and it's just random chance which server you connect to.

I've been trying to remember to use the --keep-fragments option so that when I encounter the issue I can examine the fragments to see if the problem is already present in the fragments or is just a result of combining. I now have two downloads of the same episode: one with many occurrences of the problem and one with no problems. But the individual fragments don't appear to be valid mp4 files by themselves that VLC will recognize.

I used diff -rq to compare the "good" and "bad" set of fragments, but it reports that all fragments differ, so that's no help.

I got more insight by comparing the fragment sizes. In both the "good" and "bad" directories I made a text file of file sizes (BSD stat (e.g. macOS): stat -f '%z %N' *Frag*; GNU stat (e.g. Linux): stat -c '%s %n' *Frag*) Diffing the "good" and "bad" file size files showed 25 fragments differ in size, with the "bad" fragments slightly larger than the "good" ones, which is consistent with my previous observations that the "bad" versions contain extra data in the form of repeated audio. Looking at my timing log from downloading the "bad" version, there were 37 lines that took longer than 10 seconds. (There are many more [download] log lines than there are fragments—244 fragments, 3411 [download] log lines—so some of these lines must be for the same fragment).

RedPenguin2 commented 3 years ago

I'm also having this issue when downloading from cbs/paramount+. I'm able to find out if one failed by looking at the file and comparing the subtitles to the audio later in the video. If they don't match then there's a glitch somewhere in it. I've noticed this only happens sometimes after downloading a bunch of episodes. I'm thinking it's some kind of weird rate limiting but I haven't been able to stay within it with anything I tried.

I just wanted to say TY again for this!

I wanted to get some shows but was leery of downloading & converting corrupted files. I knew there would be ways to check it but hated to do time-consuming checks but this method seems to work 1-2-3.

My first episode was perfect but my second one was unbelievably off, as the subtitles were not even close to matching.

RedPenguin2 commented 3 years ago

I am not 100% sure what this has to do with the issue but I noticed for some reason, if an episode says download in like 10 minutes, it normally will be good. If it says it will take like 20 minutes+ to download then it will be broken.

Sipherdrakon commented 3 years ago

I am able to repro this as well. It is non-deterministic in nature so there is no one video URL we can share that will repro, only that it will eventually do so. It's also really tricky to detect whether it happens, until you watch an affected file. Excellent work narrowing it down, @ryandesign

I also attempted to download through an alternative method and experienced similar random audio hiccups and haven't had time to dig deeper to understand why these don't affect playback in CBS/Paramount's own web player.

Still having this same issue. I tried with the subtitle trick, but it still means I have to open each file. But I thought maybe with the audio loop it would effect the duration. Which it seems to. Looking at the duration from a specific video on the website vs. the duration of the downloaded file there was a 30 second discrepancy which would account for the audio loopback and subsequent video freeze. So testing a batch script (only thing I am relatively familiar with) to get the duration from the json printed from yt-dlp and duration from mediainfo to delete videos outside of a 2 second difference in the durations. Also experimenting with socket timeouts for anything longer than 5 seconds as I was looking through the comments and a long delay seems to potentially be the culprit in the audio loopback and video freeze.

UPDATE Don't use the socket-timeout and continue options together. They make a giant mess of the resulting video and audio. It was a nice thought to have it timeout when the download lags but picking up from that and continuing the download leads to a very horrible looking video that is completely unwatchable.

RedPenguin2 commented 3 years ago

I know this isn't a fix for the actual issue but it's a nice workaround.

I found this script on the youtube-dl subreddit:

https://github.com/Grandfather-Paradox/paramount-dl

It's a bash (also Cygwin) script that batch downloads from paramount+ or CBS and compares the duration after and if it's not a match, it redownloads until good.

Sometimes you have to redownload like 3 times but eventually you end up with good files.

Sipherdrakon commented 3 years ago

I know this isn't a fix for the actual issue but it's a nice workaround.

I found this script on the youtube-dl subreddit:

https://github.com/Grandfather-Paradox/paramount-dl

It's a bash (also Cygwin) script that batch downloads from paramount+ or CBS and compares the duration after and if it's not a match, it redownloads until good.

Sometimes you have to redownload like 3 times but eventually you end up with good files.

Thanks for the link. I will use it for further testing, but for now try downloading using yt-dlp and specifically their aria2c downloader. Jump to the discussion over on the link I provided. It's mostly just me working through the problem since everyone seems willing to add their criticism without helping to combat the issue. But I have done a test of ffmpeg,native,and aria2c downloaders with verification on increased duration of downloaded files and their relevant ratio of good vs corrupt videos. I have come to the localized conclusion that aria2c might be the best working downloader to deal with the audio loopback and video freeze we have all been experiencing. Will try to migrate the bash script to something a little more windows friendly and test it on a much larger set of videos.

nothing2obvi commented 2 years ago

I know this isn't a fix for the actual issue but it's a nice workaround.

I found this script on the youtube-dl subreddit:

https://github.com/Grandfather-Paradox/paramount-dl

It's a bash (also Cygwin) script that batch downloads from paramount+ or CBS and compares the duration after and if it's not a match, it redownloads until good.

Sometimes you have to redownload like 3 times but eventually you end up with good files.

Wow, thanks for this. I've been going crazy trying to find a solution to this problem. Cheers!

benfugate commented 2 years ago

https://github.com/benfugate/paramountdl-dockerized I sped up Grandfather-Paradox's solution script, if anybody is interested. I changed up some things so seasons download concurrently.

I also 'dockerized' his script, so there's no need to install dependencies anymore. Although, I did add instructions for how to run without docker for those who are into that sort of thing.

The episodes are also now named based on their season and episode number (s1e1.mkv) instead of their paramount names which I had to go through and manually rename for my organization tools.

benfugate commented 2 years ago

If anyone can provide example example URL with the problem, I think I have a fix for this

I have had it on almost anything I haven't already downloaded at least once. Big Brother had many issues (per episode) throughout season 6 for me. One example I can see was redownloaded in yesterday's log was Picard, S02E02.

Commenter in which I am replying too has removed all their comments from this thread

ryandesign commented 2 years ago

There is no specific URL guaranteed to exhibit the problem. It occurs randomly with seemingly any CBS download URL.

putnam commented 2 years ago

As has been discussed numerous times in this thread, it is non-deterministic and doesn't affect any one single video. It's an artifact of using the service itself. I suggest reading the issue again, and if you need a repro you can simply download the same episode of a random show on the site repeatedly until it occurs. It won't take long.

If you want to contribute, maybe fork the repo, commit your change, or just discuss here what you think it is so we can help get to a solution together. It's not a race.

On Sat, Mar 12, 2022 at 9:11 PM Zombo @.***> wrote:

Maybe one of us can help you publish it

I dont need help publishing, I need help getting a test case

— Reply to this email directly, view it on GitHub https://github.com/ytdl-org/youtube-dl/issues/27972#issuecomment-1066012205, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAASBT4EHUYGWZPKXJQI3ZDU7VMFPANCNFSM4WS7NOQA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>