yt-dlp: [Broken] HLS: acodec of video+audio format not detected correctly (rai livestream)
Checklist
- I’m reporting a broken site support
- I’ve verified that I’m running yt-dlp version 2021.09.02
- I’ve checked that all provided URLs are alive and playable in a browser
- I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
- I’ve searched the bugtracker for similar issues including closed ones
Verbose log
[debug] Command-line config: ['https://www.raiplay.it/dirette/rai1', '-v']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] yt-dlp version 2021.09.02 (exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.18363-SP0
[debug] exe versions: ffmpeg 2021-04-20-git-718e03e5f2-essentials_build-www.gyan.dev, ffprobe 2021-04-20-git-718e03e5f2-essentials_build-www.gyan.dev
[debug] Optional libraries: mutagen, pycryptodome, sqlite, websockets
[debug] Proxy map: {}
[debug] [RaiPlayLive] Extracting URL: https://www.raiplay.it/dirette/rai1
[RaiPlayLive] rai1: Downloading video JSON
[RaiPlayLive] rai1: Downloading XML metadata for platform mon
[RaiPlayLive] rai1: Downloading m3u8 information
[RaiPlayLive] rai1: Downloading XML metadata for platform flash
[RaiPlayLive] rai1: Downloading XML metadata for platform native
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: best/bestvideo+bestaudio
[info] 48cc9aec-d6f0-4e53-843e-23565b24cd82: Downloading 1 format(s): hls-2793+hls-aac-Lingua_Originale
[debug] Invoking downloader on "https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_2400/exp=1630756721~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=70c6c7d3d07c7f124eda42e0a8810ace6085092477cf25331bf57e3f53f5139b/chunklist.m3u8?aka_me_session_id=AAAAAAAAAABxXzNhAAAAANK+8C3BR0b353VDxIsAe8CtqF0HHpZmBGKe450GJxy9HuI4P2sn%2fJrtfc6f7oEhJrINUEIUmvBC&aka_media_format_type=hls", "https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/engrai1_160/exp=1630756721~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=70c6c7d3d07c7f124eda42e0a8810ace6085092477cf25331bf57e3f53f5139b/chunklist_ao.m3u8?aka_me_session_id=AAAAAAAAAABxXzNhAAAAANK+8C3BR0b353VDxIsAe8CtqF0HHpZmBGKe450GJxy9HuI4P2sn%2fJrtfc6f7oEhJrINUEIUmvBC&aka_media_format_type=hls"
[download] Destination: Diretta di Rai 1 2021-09-03 13_58 [48cc9aec-d6f0-4e53-843e-23565b24cd82].mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3706.6 Safari/537.36
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-us,en;q=0.5
" -i "https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_2400/exp=1630756721~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=70c6c7d3d07c7f124eda42e0a8810ace6085092477cf25331bf57e3f53f5139b/chunklist.m3u8?aka_me_session_id=AAAAAAAAAABxXzNhAAAAANK+8C3BR0b353VDxIsAe8CtqF0HHpZmBGKe450GJxy9HuI4P2sn%2fJrtfc6f7oEhJrINUEIUmvBC&aka_media_format_type=hls" -i "https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/engrai1_160/exp=1630756721~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=70c6c7d3d07c7f124eda42e0a8810ace6085092477cf25331bf57e3f53f5139b/chunklist_ao.m3u8?aka_me_session_id=AAAAAAAAAABxXzNhAAAAANK+8C3BR0b353VDxIsAe8CtqF0HHpZmBGKe450GJxy9HuI4P2sn%2fJrtfc6f7oEhJrINUEIUmvBC&aka_media_format_type=hls" -c copy -map "0:v:0" -map "1:a:0" -f mpegts "file:Diretta di Rai 1 2021-09-03 13_58 [48cc9aec-d6f0-4e53-843e-23565b24cd82].mp4.part"
ffmpeg version 2021-04-20-git-718e03e5f2-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil 56. 73.100 / 56. 73.100
libavcodec 58.136.101 / 58.136.101
libavformat 58. 78.100 / 58. 78.100
libavdevice 58. 14.100 / 58. 14.100
libavfilter 7.111.100 / 7.111.100
libswscale 5. 10.100 / 5. 10.100
libswresample 3. 10.100 / 3. 10.100
libpostproc 55. 10.100 / 55. 10.100
[tcp @ 0000018af4de2cc0] Starting connection attempt to 2001:b00:1:c::210:1148 port 443
[tcp @ 0000018af4de2cc0] Successfully connected to 2001:b00:1:c::210:1148 port 443
[hls @ 0000018af4ddec80] Skip ('#EXT-X-VERSION:3')
[hls @ 0000018af4ddec80] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
[hls @ 0000018af4ddec80] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-09-03T08:58:37.859+00:00')
[hls @ 0000018af4ddec80] HLS request for url 'https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_2400/exp=1630756721~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=70c6c7d3d07c7f124eda42e0a8810ace6085092477cf25331bf57e3f53f5139b/j4f6045g/00000113/media_216225.ts?aka_me_session_id=AAAAAAAAAABxXzNhAAAAANK+8C3BR0b353VDxIsAe8CtqF0HHpZmBGKe450GJxy9HuI4P2sn%2fJrtfc6f7oEhJrINUEIUmvBC&aka_msn=216225&aka_hls_version=3&aka_media_format_type=hls', offset 0, playlist 0
[hls @ 0000018af4ddec80] Opening 'https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_2400/exp=1630756721~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=70c6c7d3d07c7f124eda42e0a8810ace6085092477cf25331bf57e3f53f5139b/serve.key?aka_me_session_id=AAAAAAAAAABxXzNhAAAAANK+8C3BR0b353VDxIsAe8CtqF0HHpZmBGKe450GJxy9HuI4P2sn%2fJrtfc6f7oEhJrINUEIUmvBC' for reading
[tcp @ 0000018af6b19280] Starting connection attempt to 2001:b00:1:c::210:1148 port 443
[tcp @ 0000018af6b19280] Successfully connected to 2001:b00:1:c::210:1148 port 443
[AVIOContext @ 0000018af4e9c800] Statistics: 16 bytes read, 0 seeks
[hls @ 0000018af4ddec80] Opening 'crypto+https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_2400/exp=1630756721~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=70c6c7d3d07c7f124eda42e0a8810ace6085092477cf25331bf57e3f53f5139b/j4f6045g/00000113/media_216225.ts?aka_me_session_id=AAAAAAAAAABxXzNhAAAAANK+8C3BR0b353VDxIsAe8CtqF0HHpZmBGKe450GJxy9HuI4P2sn%2fJrtfc6f7oEhJrINUEIUmvBC&aka_msn=216225&aka_hls_version=3&aka_media_format_type=hls' for reading
[tcp @ 0000018af4e95200] Starting connection attempt to 2001:b00:1:c::210:1148 port 443
[tcp @ 0000018af4e95200] Successfully connected to 2001:b00:1:c::210:1148 port 443
[mpegts @ 0000018af6b6ad40] parser not found for codec timed_id3, packets or times may be invalid.
[h264 @ 0000018af6d3ba80] Reinit context to 1280x720, pix_fmt: yuv420p
Input #0, hls, from 'https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_2400/exp=1630756721~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=70c6c7d3d07c7f124eda42e0a8810ace6085092477cf25331bf57e3f53f5139b/chunklist.m3u8?aka_me_session_id=AAAAAAAAAABxXzNhAAAAANK+8C3BR0b353VDxIsAe8CtqF0HHpZmBGKe450GJxy9HuI4P2sn%2fJrtfc6f7oEhJrINUEIUmvBC&aka_media_format_type=hls':
Duration: N/A, start: 62488.103933, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 0
Stream #0:0: Data: timed_id3 (ID3 / 0x20334449)
Metadata:
variant_bitrate : 0
Stream #0:1: Video: h264 (Main), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, left), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Metadata:
variant_bitrate : 0
Stream #0:2: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp
Metadata:
variant_bitrate : 0
[tcp @ 0000018af4e84180] Starting connection attempt to 2001:b00:1:c::210:1148 port 443
[tcp @ 0000018af4e84180] Successfully connected to 2001:b00:1:c::210:1148 port 443
[https @ 0000018af75e2d00] HTTP error 403 Forbidden
https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/engrai1_160/exp=1630756721~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=70c6c7d3d07c7f124eda42e0a8810ace6085092477cf25331bf57e3f53f5139b/chunklist_ao.m3u8?aka_me_session_id=AAAAAAAAAABxXzNhAAAAANK+8C3BR0b353VDxIsAe8CtqF0HHpZmBGKe450GJxy9HuI4P2sn%2fJrtfc6f7oEhJrINUEIUmvBC&aka_media_format_type=hls: Server returned 403 Forbidden (access denied)
[AVIOContext @ 0000018af4e27c40] Statistics: 364528 bytes read, 0 seeks
[AVIOContext @ 0000018af4de5080] Statistics: 242507 bytes read, 0 seeks
ERROR: ffmpeg exited with code 1
File "yt_dlp\__main__.py", line 19, in <module>
File "yt_dlp\__init__.py", line 776, in main
File "yt_dlp\__init__.py", line 766, in _real_main
File "yt_dlp\YoutubeDL.py", line 2894, in download
File "yt_dlp\YoutubeDL.py", line 1207, in extract_info
File "yt_dlp\YoutubeDL.py", line 1214, in wrapper
File "yt_dlp\YoutubeDL.py", line 1252, in __extract_info
File "yt_dlp\YoutubeDL.py", line 1298, in process_ie_result
File "yt_dlp\YoutubeDL.py", line 2320, in process_video_result
File "yt_dlp\YoutubeDL.py", line 2747, in process_info
File "yt_dlp\YoutubeDL.py", line 2461, in dl
File "yt_dlp\downloader\common.py", line 386, in download
File "yt_dlp\downloader\external.py", line 75, in real_download
File "yt_dlp\downloader\common.py", line 170, in report_error
File "yt_dlp\YoutubeDL.py", line 818, in report_error
File "yt_dlp\YoutubeDL.py", line 774, in trouble
Description
Trying to download a livestream using yt-dlp on raiplay.it but error occurs. VOD links work as intended.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 25 (18 by maintainers)
Commits related to this issue
- [extractor/common] Added ability to force CODECS for malformed m3u8 manifest - fixes #887 A+V stream getting recognized as only V - fixes #2918 and https://github.com/ytdl-org/youtube-dl/issues/2783... — committed to nixxo/yt-dlp by nixxo 2 years ago
- [extractor/rai] fix #9154 and #887 — committed to nixxo/yt-dlp by nixxo 4 months ago
- [ie/rai] Fix m3u8 formats extraction (#9291) Closes #887 Authored by: nixxo — committed to yt-dlp/yt-dlp by nixxo 4 months ago
This weekend I’ll give it a look and see what is possible to do.
@nixxo, what do you think, can you add that regex to rai.py? As it currently stands the rai.py extractor is effectively broken without it.
I can confirm that with #5924 , yt-dlp correctly identifies this malformed? m3u8 as video only and therefore the merge works. cd yt-dlp-path git fetch https://github.com/yt-dlp/yt-dlp pull/5924/head:pr/5924 git checkout pr/5924
yt-dlp -F https://www.raiplay.it/video/2024/02/Sanremo-2024---74-Festival-della-Canzone-Italiana---Serata-Finale-del-10022024-c31c3075-13ab-4c3b-9133-91391eab7efb.html hls-aac-Audiodescrizione mp4 audio only │ m3u8 │ audio only unknown [Audiodescrizione] Audiodescrizione hls-aac-Italiano mp4 audio only │ m3u8 │ audio only unknown [Italiano] Italiano hls-1800 mp4 1024x576 │ ~ 3.85GiB 1758k m3u8 │ unknown 1758k video only hls-2400 mp4 1280x720 │ ~ 5.13GiB 2344k m3u8 │ unknown 2344k video only hls-3600 mp4 1600x900 │ ~ 7.70GiB 3516k m3u8 │ unknown 3516k video only hls-5000 mp4 1920x1080 │ ~11.41GiB 5210k m3u8 │ unknown 5210k video only
yt-dlp -g -f hls-1800+hls-aac-Italiano https://www.raiplay.it/video/2024/02/Sanremo-2024---74-Festival-della-Canzone-Italiana---Serata-Finale-del-10022024-c31c3075-13ab-4c3b-9133-91391eab7efb.html https://vod9-rai-it.akamaized.net/podcastcdn/raiuno/raiuno_multiaudio_nogeo/22348652_,1800,2400,3600,5000/chunklist_b1758000_vo_slita_t64MTgwMA==.m3u8 https://vod9-rai-it.akamaized.net/podcastcdn/raiuno/raiuno_multiaudio_nogeo/22348652_,1800,2400,3600,5000/chunklist_b192400_ao_slItaliano_t64SXRhbGlhbm9fYXVkaW8=.m3u8
undo: git checkout master git branch -D pr/5924 #git pull
No, it was not written in https://github.com/yt-dlp/yt-dlp/commit/310c2ed2c648f4e1254e27d0e8901d629828b2ba, but in https://github.com/yt-dlp/yt-dlp/commit/cb2520802d7b8efdc71d6d97aeca984b5f878716. The other commit only moved the code around. The issue is, I also have no idea what this piece of code is supposed to do. I can confirm that removing it fixes this manifest, but we don’t know if it breaks something else