Repository: youtube-dl
Issue: Vimeo - Failed to parse JSON caused by JSONDecodeError
Labels: broken-IE,patch-available

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2021.12.17. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that all URLs and arguments with special characters are properly quoted or escaped as explained in http://yt-dl.org/escape.
- Search the bugtracker for similar issues: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Read bugs section in FAQ: http://yt-dl.org/reporting
- Finally, put x into all relevant boxes (like this [x])
-->

- [X ] I'm reporting a broken site support issue
- [X] I've verified that I'm running youtube-dl version **2021.12.17**
- [X ] I've checked that all provided URLs are alive and playable in a browser
- [ X] I've checked that all URLs and arguments with special characters are properly quoted or escaped
- [ X] I've searched the bugtracker for similar bug reports including closed ones
- [ X] I've read bugs section in FAQ


## Verbose log

<!--
Provide the complete verbose output of youtube-dl that clearly demonstrates the problem.
Add the `-v` flag to your command line you run youtube-dl with (`youtube-dl -v <your command line>`), copy the WHOLE output and insert it below. It should look similar to this:
 [debug] System config: []
 [debug] User config: []
 [debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
 [debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
 [debug] youtube-dl version 2021.12.17
 [debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
 [debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
 [debug] Proxy map: {}
 <more lines>
-->

```

python2 -m youtube_dl -v -F 'https://player.vimeo.com/video/762862842'

[debug] System config: []
[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: b8a86dcf1
[debug] Python 2.7.18 (CPython x86_64 64bit) - Linux-5.15.0-73-generic-x86_64-with-LinuxMint-20.3-una - OpenSSL 1.1.1f  31 Mar 2020 - glibc 2.29
[debug] exe versions: ffmpeg 4.2.7, ffprobe 4.2.7, rtmpdump 2.4
[debug] Proxy map: {}
[vimeo] 762862842: Downloading webpage
ERROR: 762862842: Failed to parse JSON  (caused by ValueError('Extra data: line 1 column 12467 - line 2 column 1291 (char 12466 - 13766)',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "youtube_dl/extractor/common.py", line 907, in _parse_json
    return json.loads(json_string)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 367, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column 12467 - line 2 column 1291 (char 12466 - 13766)
Traceback (most recent call last):
  File "youtube_dl/YoutubeDL.py", line 825, in wrapper
    return func(self, *args, **kwargs)
  File "youtube_dl/YoutubeDL.py", line 846, in __extract_info
    ie_result = ie.extract(url)
  File "youtube_dl/extractor/common.py", line 535, in extract
    ie_result = self._real_extract(url)
  File "youtube_dl/extractor/vimeo.py", line 677, in _real_extract
    r'(?s)\b(?:playerC|c)onfig\s*=\s*({.+?})\s*[;\n]', webpage, 'info section'), video_id)
  File "youtube_dl/extractor/common.py", line 911, in _parse_json
    raise ExtractorError(errmsg, cause=ve)
ExtractorError: 762862842: Failed to parse JSON  (caused by ValueError('Extra data: line 1 column 12467 - line 2 column 1291 (char 12466 - 13766)',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

```


## Description

<!--
Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

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) )