Skip to content
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

JSONDecodeError('Expecting value: line 1 column 1 (char 0)') #26937

Closed
finlaysawyer opened this issue Oct 19, 2020 · 7 comments
Closed

JSONDecodeError('Expecting value: line 1 column 1 (char 0)') #26937

finlaysawyer opened this issue Oct 19, 2020 · 7 comments
Labels

Comments

@finlaysawyer
Copy link

@finlaysawyer finlaysawyer commented Oct 19, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.09.20
  • 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 bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

[debug] Encodings: locale cp1252, fs utf-8, out UTF-8, pref cp1252
[debug] youtube-dl version 2020.09.20
[debug] Git HEAD: 793ad69
[debug] Python version 3.7.9 (CPython) - Windows-10-10.0.19041-SP0
[debug] exe versions: ffmpeg git-2020-08-06-2c35797, ffprobe git-2020-08-06-2c35797
[debug] Proxy map: {}
[youtube:search] query "ladbroke grove": Downloading page 1
ERROR: query "ladbroke grove": Failed to parse JSON  (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')); 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 "D:\dev\DiscordBot\venv\lib\site-packages\youtube_dl\extractor\common.py", line 904, in _parse_json
    return json.loads(json_string)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "D:\dev\DiscordBot\venv\lib\site-packages\youtube_dl\extractor\common.py", line 904, in _parse_json
    return json.loads(json_string)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 355, 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 "D:\dev\DiscordBot\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "D:\dev\DiscordBot\venv\lib\site-packages\youtube_dl\extractor\common.py", line 532, in extract
    ie_result = self._real_extract(url)
  File "D:\dev\DiscordBot\venv\lib\site-packages\youtube_dl\extractor\common.py", line 3004, in _real_extract
    return self._get_n_results(query, 1)
  File "D:\dev\DiscordBot\venv\lib\site-packages\youtube_dl\extractor\youtube.py", line 3204, in _get_n_results
    query={'spf': 'navigate'})
  File "D:\dev\DiscordBot\venv\lib\site-packages\youtube_dl\extractor\common.py", line 897, in _download_json
    expected_status=expected_status)
  File "D:\dev\DiscordBot\venv\lib\site-packages\youtube_dl\extractor\common.py", line 881, in _download_json_handle
    fatal=fatal), urlh
  File "D:\dev\DiscordBot\venv\lib\site-packages\youtube_dl\extractor\common.py", line 908, in _parse_json
    raise ExtractorError(errmsg, cause=ve)
youtube_dl.utils.ExtractorError: query "ladbroke grove": Failed to parse JSON  (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')); 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

Hello, I am using the method ydl.extract_info(f"ytsearch:ladbroke grove", download=False) and I am receiving this error for essentially every possible search term. There were a few other issues but I could not find anything related to YouTube requests or a solution.

@tameTNT tameTNT mentioned this issue Oct 19, 2020
6 of 6 tasks complete
@tameTNT
Copy link

@tameTNT tameTNT commented Oct 19, 2020

I have had this same issue all day. Repeatedly attempting the same operation however seems to work for some reason - it appears to be some sort of luck game as to whether the error occurs. Is YouTube serving different content perhaps depending on time of request? Sometimes it downloads up to 4 videos or so back to back without any error before then erroring after every attempt for next 6 attempts for example.

@elliotnash
Copy link

@elliotnash elliotnash commented Oct 19, 2020

I'm also getting the same error, restarting my program seems to get it working but every couple startups its completely broken

@isp96
Copy link

@isp96 isp96 commented Oct 20, 2020

Same here, been getting these seemingly randomly over the past week+

@tameTNT
Copy link

@tameTNT tameTNT commented Oct 20, 2020

Something must have changed overnight since I am not getting this error at all anymore using the exact same program as yesterday. 🤔 Can anyone else confirm?

@elliotnash
Copy link

@elliotnash elliotnash commented Oct 20, 2020

still getting this, youtube seems to be randomly deciding if it wants to give out a properly formatted json file or not

@nwroot
Copy link

@nwroot nwroot commented Oct 20, 2020

This issue is still happening, it can also be reproduced with youtube-dl 'ytsearch:<anything>' -F, it fails with the same JSONDecodeError exception on latest version.

@neotherack
Copy link

@neotherack neotherack commented Oct 21, 2020

same here

@dstftw dstftw closed this Oct 21, 2020
@dstftw dstftw added the duplicate label Oct 21, 2020
@ytdl-org ytdl-org locked and limited conversation to collaborators Oct 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.