yt-dlp: [vk] Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)"))

Checklist

  • I’m reporting that yt-dlp is broken on a supported site
  • I’ve verified that I have updated yt-dlp to nightly or master (update instructions)
  • I’ve checked that all provided URLs are playable in a browser with the same IP and same login details
  • I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
  • I’ve searched known issues, the FAQ, and the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I’ve read about sharing account credentials and I’m willing to share it if required

Region

europe

Provide a description that is worded well enough to be understood

vk.com seems to have a new dialog box that asks the user to confirm that he is not a bot…

EDIT BY MAINTAINER: There seems to be a rate-limit that when exceeded triggers the antibot measures

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['-vU', 'https://vkvideo.ru/video2019924_456239473']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2025.03.31 from yt-dlp/yt-dlp [5e457af57]
[debug] Python 3.13.3 (CPython x86_64 64bit) - macOS-10.14.6-x86_64-i386-64bit-Mach-O (OpenSSL 3.5.0 8 Apr 2025)
[debug] exe versions: ffmpeg 4.4.5 (setts), ffprobe 4.4.5
[debug] Optional libraries: pycrypto-3.21.0, sqlite3-3.49.1
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Plugin directories: none
[debug] Loaded 1850 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2025.03.31 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2025.03.31 from yt-dlp/yt-dlp)
[vk] Extracting URL: https://vkvideo.ru/video2019924_456239473
[vk] 2019924_456239473: Downloading JSON metadata
ERROR: [vk] 2019924_456239473: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 748, in extract
    ie_result = self._real_extract(url)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/vk.py", line 367, in _real_extract
    payload = self._download_payload('al_video', video_id, data)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/vk.py", line 79, in _download_payload
    code, payload = self._download_json(
                    ~~~~~~~~~~~~~~~~~~~^
        endpoint, video_id, data=urlencode_postdata(data), fatal=fatal,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
            'X-Requested-With': 'XMLHttpRequest',
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        })['payload']
        ^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1145, in download_content
    res = getattr(self, download_handle.__name__)(url_or_request, video_id, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1110, in download_handle
    return parse(self, content, video_id, transform_source=transform_source, fatal=fatal, errnote=errnote), urlh
           ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1098, in parse
    return getattr(ie, parser)(content, *args, **kwargs)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1085, in _parse_json
    self.__print_error('Failed to parse JSON' if errnote is None else errnote, fatal, video_id, ve)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1068, in __print_error
    raise ExtractorError(f'{video_id}: {errnote}', cause=err)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/utils/_utils.py", line 567, in decode
    return super().decode(s)
           ~~~~~~~~~~~~~~^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/decoder.py", line 345, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/decoder.py", line 363, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1082, in _parse_json
    return json.loads(
           ~~~~~~~~~~^
        json_string, cls=LenientJSONDecoder, strict=False, transform_source=transform_source, **parser_kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/__init__.py", line 359, in loads
    return cls(**kw).decode(s)
           ~~~~~~~~~~~~~~~~^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/utils/_utils.py", line 575, in decode
    raise type(e)(f'{e.msg} in {s[e.pos - 10:e.pos + 10]!r}', s, e.pos)
json.decoder.JSONDecodeError: Expecting value in '': line 1 column 1 (char 0)

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

Still the same situation — browser: ok, yt-dlp: fail. Dump file attached.


[dump.zip](https://github.com/user-attachments/files/19870620/dump.zip)

[dump.zip](https://github.com/user-attachments/files/19870657/dump.zip)

[debug] Command-line config: ['-vU', '--write-pages', 'https://vkvideo.ru/video2019924_456239473']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2025.03.31 from yt-dlp/yt-dlp [5e457af57]
[debug] Python 3.13.3 (CPython x86_64 64bit) - macOS-10.14.6-x86_64-i386-64bit-Mach-O (OpenSSL 3.5.0 8 Apr 2025)
[debug] exe versions: ffmpeg 4.4.5 (setts), ffprobe 4.4.5
[debug] Optional libraries: pycrypto-3.21.0, sqlite3-3.49.1
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Plugin directories: none
[debug] Loaded 1850 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2025.03.31 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2025.03.31 from yt-dlp/yt-dlp)
[vk] Extracting URL: https://vkvideo.ru/video2019924_456239473
[vk] 2019924_456239473: Downloading JSON metadata
[vk] Saving request to 2019924_456239473_9fc25b283f3e3cb5b815f972f66796e9_https_-_vk.com_challenge.htmlhash429=lHyGAmjiHNBl3pscGKCneTQNom3Mzdqkyvgz1cgyXtusTfMZ6pTLRbTVUwitsRp5YmiRP4lVD-992o8Ebp1-oUL0fOZbN1TwdKEPokoEfee-NIIDNNHj___6ed8cf59d68d07b812bd46138bb9131c.dump
ERROR: [vk] 2019924_456239473: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 748, in extract
    ie_result = self._real_extract(url)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/vk.py", line 367, in _real_extract
    payload = self._download_payload('al_video', video_id, data)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/vk.py", line 79, in _download_payload
    code, payload = self._download_json(
                    ~~~~~~~~~~~~~~~~~~~^
        endpoint, video_id, data=urlencode_postdata(data), fatal=fatal,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
            'X-Requested-With': 'XMLHttpRequest',
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        })['payload']
        ^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1145, in download_content
    res = getattr(self, download_handle.__name__)(url_or_request, video_id, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1110, in download_handle
    return parse(self, content, video_id, transform_source=transform_source, fatal=fatal, errnote=errnote), urlh
           ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1098, in parse
    return getattr(ie, parser)(content, *args, **kwargs)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1085, in _parse_json
    self.__print_error('Failed to parse JSON' if errnote is None else errnote, fatal, video_id, ve)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1068, in __print_error
    raise ExtractorError(f'{video_id}: {errnote}', cause=err)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/utils/_utils.py", line 567, in decode
    return super().decode(s)
           ~~~~~~~~~~~~~~^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/decoder.py", line 345, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/decoder.py", line 363, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1082, in _parse_json
    return json.loads(
           ~~~~~~~~~~^
        json_string, cls=LenientJSONDecoder, strict=False, transform_source=transform_source, **parser_kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/__init__.py", line 359, in loads
    return cls(**kw).decode(s)
           ~~~~~~~~~~~~~~~~^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/utils/_utils.py", line 575, in decode
    raise type(e)(f'{e.msg} in {s[e.pos - 10:e.pos + 10]!r}', s, e.pos)
json.decoder.JSONDecodeError: Expecting value in '': line 1 column 1 (char 0)

dump.zip

Today, the same video, but with a different wan ip, the same error. Browser works fine.

[debug] Command-line config: ['-vU', 'https://vkvideo.ru/video2019924_456239473']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2025.03.31 from yt-dlp/yt-dlp [5e457af57]
[debug] Python 3.13.3 (CPython x86_64 64bit) - macOS-10.14.6-x86_64-i386-64bit-Mach-O (OpenSSL 3.5.0 8 Apr 2025)
[debug] exe versions: ffmpeg 4.4.5 (setts), ffprobe 4.4.5
[debug] Optional libraries: pycrypto-3.21.0, sqlite3-3.49.1
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Plugin directories: none
[debug] Loaded 1850 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2025.03.31 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2025.03.31 from yt-dlp/yt-dlp)
[vk] Extracting URL: https://vkvideo.ru/video2019924_456239473
[vk] 2019924_456239473: Downloading JSON metadata
ERROR: [vk] 2019924_456239473: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 748, in extract
    ie_result = self._real_extract(url)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/vk.py", line 367, in _real_extract
    payload = self._download_payload('al_video', video_id, data)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/vk.py", line 79, in _download_payload
    code, payload = self._download_json(
                    ~~~~~~~~~~~~~~~~~~~^
        endpoint, video_id, data=urlencode_postdata(data), fatal=fatal,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
            'X-Requested-With': 'XMLHttpRequest',
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        })['payload']
        ^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1145, in download_content
    res = getattr(self, download_handle.__name__)(url_or_request, video_id, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1110, in download_handle
    return parse(self, content, video_id, transform_source=transform_source, fatal=fatal, errnote=errnote), urlh
           ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1098, in parse
    return getattr(ie, parser)(content, *args, **kwargs)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1085, in _parse_json
    self.__print_error('Failed to parse JSON' if errnote is None else errnote, fatal, video_id, ve)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1068, in __print_error
    raise ExtractorError(f'{video_id}: {errnote}', cause=err)

  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/utils/_utils.py", line 567, in decode
    return super().decode(s)
           ~~~~~~~~~~~~~~^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/decoder.py", line 345, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/decoder.py", line 363, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/extractor/common.py", line 1082, in _parse_json
    return json.loads(
           ~~~~~~~~~~^
        json_string, cls=LenientJSONDecoder, strict=False, transform_source=transform_source, **parser_kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/__init__.py", line 359, in loads
    return cls(**kw).decode(s)
           ~~~~~~~~~~~~~~~~^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/yt_dlp/utils/_utils.py", line 575, in decode
    raise type(e)(f'{e.msg} in {s[e.pos - 10:e.pos + 10]!r}', s, e.pos)
json.decoder.JSONDecodeError: Expecting value in '': line 1 column 1 (char 0)

You should have led with that, instead of sending me on a wild goose chase with those unrelated broken URLs. After all, you did attest to this in the original post:

  • I’ve checked that all provided URLs are playable in a browser with the same IP and same login details

…which obviously wasn’t true. Now I’ve wasted a bunch of my time debunking your unrelated logs.


Anyways, I can’t reproduce the error with https://vkvideo.ru/video2019924_456239473, which tells me it’s some sort of rate-limit you’ve exceeded that has triggered the antibot mechanism. Chill on the downloading for a day and see if that helps.