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
131.68k stars 9.97k forks source link

rtve.es:alacarta (alias rtve.es:play) doesn't work #31276

Open s-nt-s opened 2 years ago

s-nt-s commented 2 years ago

Checklist

Verbose log

$ youtube-dl -v https://www.rtve.es/alacarta/videos/somos-documentales/avion-novias/6704549/
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.rtve.es/alacarta/videos/somos-documentales/avion-novias/6704549/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.6.9 (CPython) - Linux-5.4.0-126-generic-x86_64-with-LinuxMint-19.3-tricia
[debug] exe versions: ffmpeg 4.1.3-0ppa1, ffprobe 4.1.3-0ppa1
[debug] Proxy map: {}
[rtve.es:alacarta] Fetching manager info
[rtve.es:alacarta] 6704549: Downloading JSON metadata
[rtve.es:alacarta] 6704549: Downloading url information
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/__init__.py", line 475, in main
    _real_main(argv)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/__init__.py", line 465, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 2069, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 808, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/rtve.py", line 153, in _real_extract
    formats = self._extract_png_formats(video_id)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/rtve.py", line 127, in _extract_png_formats
    for quality, video_url in self._decrypt_url(png):
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/rtve.py", line 90, in _decrypt_url
    quality, url_data = text.split(b'%%')
ValueError: not enough values to unpack (expected 2, got 1)

Description

The real url is https://www.rtve.es/play/videos/somos-documentales/avion-novias/6704549/ but as it's said in others issues it needed change play by alacarta.

dirkf commented 2 years ago

Actually, that's not quite enough. ValueError: not enough values to unpack (expected 2, got 1) persists even if the RTVE extractor from the git master is tweaked to handle /play/ URLs.

The issue is fixed by the new PR #31241, which supersedes PR #29816. From the UK I get some 403s that may not occur in RTVE's region, or under some other circumstance.

$ python -m youtube_dl -v -F 'https://www.rtve.es/play/videos/somos-documentales/avion-novias/6704549/'
[debug] System config: [u'--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://www.rtve.es/play/videos/somos-documentales/avion-novias/6704549/']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: f838f3805
[debug] Python version 2.7.17 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[rtve.es:play] Fetching manager info
[rtve.es:play] 6704549: Downloading JSON metadata
[rtve.es:play] 6704549: Downloading url information
[rtve.es:play] 6704549: Downloading m3u8 information
WARNING: Failed to download m3u8 information: HTTP Error 403: Unauthorized
[rtve.es:play] 6704549: Downloading MPD manifest
WARNING: Failed to download MPD manifest: HTTP Error 403: Unauthorized
[info] Available formats for 6704549:
format code  extension  resolution note
0            mp4        unknown   
$
s-nt-s commented 1 year ago

ok, I did:

git clone -b rtve-fixes https://github.com/mildsunrise/youtube-dl youtube-dl-rtve-fixes

python3 youtube-dl-rtve-fixes/youtube_dl/__main__.py https://www.rtve.es/play/videos/somos-documentales/avion-novias/6704549/

and work it.

Why master haven't integrate this fix yet?

Thanks.

dirkf commented 1 year ago

Neither the PR author nor I have progressed it.

felisucoibi commented 1 year ago

ok, I did:

git clone -b rtve-fixes https://github.com/mildsunrise/youtube-dl youtube-dl-rtve-fixes

python3 youtube-dl-rtve-fixes/youtube_dl/__main__.py https://www.rtve.es/play/videos/somos-documentales/avion-novias/6704549/

and work it.

Why master haven't integrate this fix yet?

Thanks.

seems gets 720p and not 1080p?

oscarfv commented 1 year ago

This works, but I can't figure out how to download the original version audio. For instance, for this video:

https://www.rtve.es/play/videos/el-comisario-montalbano/voz-violin/6636027/

-F lists some video formats and an audio format, none of them have the original version audio, but that's selectable on the web player of the URL above.

dirkf commented 1 year ago

Please post comments on the PR in the PR itself.