-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vimeo - Failed to parse JSON caused by JSONDecodeError #32271
Comments
Only incidentally. Vimeo has changed some part of the page (again) and we're not matching it properly. yt-dlp succeeds with this page because it has a special "lenient" JSON parser that ignores extra data. Fix options:
Fix#3 is the best in the long term but fix#1 is easy: --- old/youtube_dl/extractor/vimeo.py
+++ new/youtube_dl/extractor/vimeo.py
@@ -674,7 +674,7 @@
if '//player.vimeo.com/video/' in url:
config = self._parse_json(self._search_regex(
- r'(?s)\b(?:playerC|c)onfig\s*=\s*({.+?})\s*[;\n]', webpage, 'info section'), video_id)
+ r'(?s)\b(?:playerC|c)onfig\s*=\s*(\{.+?})\s*(?:[;\n]|</script>)', webpage, 'info section'), video_id)
if config.get('view') == 4:
config = self._verify_player_video_password(
redirect_url, video_id, headers) You can apply this to your checked-out yt-dl module to get this result: $ python -m youtube_dl -v -F 'https://player.vimeo.com/video/762862842'
[debug] System config: [u'--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://player.vimeo.com/video/762862842']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 5966b4309
[debug] Python 2.7.18 (CPython i686 32bit) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial - OpenSSL 1.1.1t 7 Feb 2023 - glibc 2.15
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[vimeo] 762862842: Downloading webpage
[vimeo] 762862842: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 762862842: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 762862842: Downloading fastly_skyfire m3u8 information
[vimeo] 762862842: Downloading fastly_skyfire m3u8 information
[vimeo] 762862842: Downloading akfire_interconnect_quic MPD information
[vimeo] 762862842: Downloading akfire_interconnect_quic MPD information
[vimeo] 762862842: Downloading fastly_skyfire MPD information
[vimeo] 762862842: Downloading fastly_skyfire MPD information
[info] Available formats for 762862842:
format code extension resolution note
hls-akfire_interconnect_quic_sep-audio-medium-audio mp4 audio only
hls-fastly_skyfire_sep-audio-medium-audio mp4 audio only
dash-akfire_interconnect_quic_sep-audio-f73b48d3 m4a audio only DASH audio 64k , m4a_dash container, mp4a.40.2 (24000Hz)
dash-fastly_skyfire_sep-audio-f73b48d3 m4a audio only DASH audio 64k , m4a_dash container, mp4a.40.2 (24000Hz)
dash-akfire_interconnect_quic_sep-audio-c4b195b3 m4a audio only DASH audio 67k , m4a_dash container, opus (48000Hz)
dash-fastly_skyfire_sep-audio-c4b195b3 m4a audio only DASH audio 67k , m4a_dash container, opus (48000Hz)
dash-akfire_interconnect_quic_sep-audio-33b5709a m4a audio only DASH audio 99k , m4a_dash container, opus (48000Hz)
dash-fastly_skyfire_sep-audio-33b5709a m4a audio only DASH audio 99k , m4a_dash container, opus (48000Hz)
dash-akfire_interconnect_quic_sep-audio-ea18f4fb m4a audio only DASH audio 127k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-fastly_skyfire_sep-audio-ea18f4fb m4a audio only DASH audio 127k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-akfire_interconnect_quic_sep-audio-449c0d17 m4a audio only DASH audio 191k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-fastly_skyfire_sep-audio-449c0d17 m4a audio only DASH audio 191k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-akfire_interconnect_quic_sep-audio-bf242b57 m4a audio only DASH audio 255k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-fastly_skyfire_sep-audio-bf242b57 m4a audio only DASH audio 255k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-akfire_interconnect_quic_sep-video-f73b48d3 mp4 426x240 DASH video 341k , mp4_dash container, avc1.640015, 25fps, video only
dash-fastly_skyfire_sep-video-f73b48d3 mp4 426x240 DASH video 341k , mp4_dash container, avc1.640015, 25fps, video only
hls-akfire_interconnect_quic_sep-435 mp4 426x240 435k , avc1.640015, 25.0fps, video only
hls-fastly_skyfire_sep-435 mp4 426x240 435k , avc1.640015, 25.0fps, video only
dash-akfire_interconnect_quic_sep-video-ea18f4fb mp4 640x360 DASH video 777k , mp4_dash container, avc1.64001E, 25fps, video only
dash-fastly_skyfire_sep-video-ea18f4fb mp4 640x360 DASH video 777k , mp4_dash container, avc1.64001E, 25fps, video only
hls-akfire_interconnect_quic_sep-809 mp4 640x360 809k , avc1.64001E, 25.0fps, video only
hls-fastly_skyfire_sep-809 mp4 640x360 809k , avc1.64001E, 25.0fps, video only
hls-akfire_interconnect_quic_sep-1357 mp4 960x540 1357k , avc1.64001F, 25.0fps, video only
hls-fastly_skyfire_sep-1357 mp4 960x540 1357k , avc1.64001F, 25.0fps, video only
dash-akfire_interconnect_quic_sep-video-bf242b57 mp4 960x540 DASH video 1614k , mp4_dash container, avc1.64001F, 25fps, video only
dash-fastly_skyfire_sep-video-bf242b57 mp4 960x540 DASH video 1614k , mp4_dash container, avc1.64001F, 25fps, video only
http-240p mp4 426x240 25fps
hls-akfire_interconnect_quic-372 mp4 426x240 372k , avc1.640015, 25.0fps, mp4a.40.2
hls-fastly_skyfire-372 mp4 426x240 372k , avc1.640015, 25.0fps, mp4a.40.2
dash-akfire_interconnect_quic-video-f73b48d3 mp4 426x240 DASH video 405k , mp4_dash container, avc1.640015, 25fps, mp4a.40.2 (24000Hz)
dash-fastly_skyfire-video-f73b48d3 mp4 426x240 DASH video 405k , mp4_dash container, avc1.640015, 25fps, mp4a.40.2 (24000Hz)
http-360p mp4 640x360 25fps
hls-akfire_interconnect_quic-809 mp4 640x360 809k , avc1.64001E, 25.0fps, mp4a.40.2
hls-fastly_skyfire-809 mp4 640x360 809k , avc1.64001E, 25.0fps, mp4a.40.2
dash-akfire_interconnect_quic-video-ea18f4fb mp4 640x360 DASH video 904k , mp4_dash container, avc1.64001E, 25fps, mp4a.40.2 (48000Hz)
dash-fastly_skyfire-video-ea18f4fb mp4 640x360 DASH video 904k , mp4_dash container, avc1.64001E, 25fps, mp4a.40.2 (48000Hz)
http-540p mp4 960x540 25fps
hls-akfire_interconnect_quic-1485 mp4 960x540 1485k , avc1.64001F, 25.0fps, mp4a.40.2
hls-fastly_skyfire-1485 mp4 960x540 1485k , avc1.64001F, 25.0fps, mp4a.40.2
dash-akfire_interconnect_quic-video-bf242b57 mp4 960x540 DASH video 1869k , mp4_dash container, avc1.64001F, 25fps, mp4a.40.2 (48000Hz)
dash-fastly_skyfire-video-bf242b57 mp4 960x540 DASH video 1869k , mp4_dash container, avc1.64001F, 25fps, mp4a.40.2 (48000Hz) (best)
$ |
Same problem here, the patch above is working. Thanks @dirkf |
The patch should have been committed by now ... |
Would be good, but is not. |
I mean, I should have done it. Will happen, but some prior QA is needed. |
Checklist
Verbose log
Description
I have this issue not only with Python 2.7 but also Python 3.8
I have cloned git repository to be 100% I have the most recent version and the error still persists
I fails for public Vimeo videos. Actually I was able to download this video in the past.
Maybe this issue has something in common with issue #32258 ([VK] video not downloading (Failed to parse JSON) )
The text was updated successfully, but these errors were encountered: