question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to download JSON metadata error on yt

See original GitHub issue

Checklist

  • I’m reporting a broken site support issue
  • I’ve verified that I’m running youtube-dl version 2021.02.22 – youtube-dl is up-to-date (2021.02.22)
  • 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] System config: []
[debug] User config: ['--download-archive', 'archive.txt', '-i', '-w', '-c', '--no-mtime', '--restrict-filenames', '--prefer-ffmpeg', '--min-sleep-interval', '2', '--max-sleep-interval', '20', '-o', '%(title)s.%(ext)s']
[debug] Custom config: []
[debug] Command-line args: ['--download-archive', 'foodwishes.txt', '--verbose', '-i', '-q', '--no-warnings', '--restrict-filenames', '--add-metadata', '--min-sleep-interval', '1.5', '--max-sleep-interval', '7', '-o', '%(title)s.%(ext)s', 'https://www.youtube.com/user/foodwishes']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.02.22
[debug] Python version 3.8.3 (CPython) - Linux-4.18.0-240.10.1.el8_3.x86_64-x86_64-with-glibc2.2.5
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4
[debug] Proxy map: {}
ERROR: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 632, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2275, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib64/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib64/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib64/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib64/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)

ERROR: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 632, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2275, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib64/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib64/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib64/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib64/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)

Description

Simple download of a fav playlist from yt. It has been working for years and after updating to 02.22, it seems to have broken this morning.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
JaKXzcommented, Mar 3, 2021

Hi, sorry to comment on a closed issue, but I’m seeing a similar issue with recent updates (2021.03.02) as well:

verbose output
❯ mpv https://www.youtube.com/playlist\?list\=PLAbMhAYRuCUhawCEV2oXZGrienoKTN16X --ytdl-raw-options=verbose=true
[ytdl_hook] [debug] System config: []
[ytdl_hook] [debug] User config: []
[ytdl_hook] [debug] Custom config: []
[ytdl_hook] [debug] Command-line args: ['--no-warnings', '-J', '--flat-playlist', '--sub-format', 'ass/srt/best', '--format', 'bestvideo[height<=?1080][fps<=?60][vcodec!=?vp9]+bestaudio/best', '--verbose', 'true', '--all-subs', '--no-playlist', '--', 'https://www.youtube.com/playlist?list=PLAbMhAYRuCUhawCEV2oXZGrienoKTN16X']
[ytdl_hook] [debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[ytdl_hook] [debug] youtube-dl version 2021.03.02
[ytdl_hook] [debug] Python version 3.9.2 (CPython) - macOS-10.14.6-x86_64-i386-64bit
[ytdl_hook] [debug] exe versions: ffmpeg 4.3.2, ffprobe 4.3.2, rtmpdump 2.4
[ytdl_hook] [debug] Proxy map: {}
[ytdl_hook] ERROR: 'true' is not a valid URL. Set --default-search "ytsearch" (or run  youtube-dl "ytsearch:true" ) to search YouTube
[ytdl_hook] Traceback (most recent call last):
[ytdl_hook]   File "/usr/local/Cellar/youtube-dl/2021.3.2/libexec/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 806, in wrapper
[ytdl_hook]     return func(self, *args, **kwargs)
[ytdl_hook]   File "/usr/local/Cellar/youtube-dl/2021.3.2/libexec/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 827, in __extract_info
[ytdl_hook]     ie_result = ie.extract(url)
[ytdl_hook]   File "/usr/local/Cellar/youtube-dl/2021.3.2/libexec/lib/python3.9/site-packages/youtube_dl/extractor/common.py", line 532, in extract
[ytdl_hook]     ie_result = self._real_extract(url)
[ytdl_hook]   File "/usr/local/Cellar/youtube-dl/2021.3.2/libexec/lib/python3.9/site-packages/youtube_dl/extractor/generic.py", line 2381, in _real_extract
[ytdl_hook]     raise ExtractorError(
[ytdl_hook] youtube_dl.utils.ExtractorError: 'true' is not a valid URL. Set --default-search "ytsearch" (or run  youtube-dl "ytsearch:true" ) to search YouTube
[ytdl_hook] youtube-dl failed: unexpected error occurred
Failed to recognize file format.

Exiting... (Errors when loading file)

Then I tried setting --default-search=ytsearch as suggested and got a little further but still seeing the same error:

❯ mpv https://www.youtube.com/playlist\?list\=PLAbMhAYRuCUhawCEV2oXZGrienoKTN16X --ytdl-raw-options=verbose=true,default-search=ytsearch

Playing: https://youtu.be/Al_Rm2jEOLU
[ytdl_hook] failed to parse JSON data: error
Failed to recognize file format.
2reactions
coletdjnzcommented, Mar 3, 2021

If you add retries for the 404 in most causes it seems to eventually sort itself out, so I’m thinking this is probably server side. Wonder if this has any similarity to #28194… Edit: though right now there seems to be an influx in 404s, where I’m trying hundreds of retries while in the browser there’s no problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[ARTE.tv] Unable to download JSON metadata #30919 - GitHub
I've found a very easy workaround for this arte.tv problem with their API. No need to do any updates, download new PY files,...
Read more >
Help with error "Unable to download JSON metadata" - Reddit
I get this. Unable to download JSON metadata: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>);. I try this yt-dlp ...
Read more >
youtube-dl Unable to download JSON metadata: HTTP Error ...
Unable to download JSON metadata: HTTP Error 403: Forbidden. What is the problem ? I Used last version of Youtube-dl youtube-dl -u ...
Read more >
Bug#816654: youtube-dl: SSL error with vimeo URLs
Package: youtube-dl. Version: 2016.02.22-1. When attempting to download from vimeo I am getting the following error:
Read more >
problem with youtube-dl [closed] - Ask Ubuntu
I got the same error when trying to download the same Udemy video using the latest version of youtube-dl. – karel. Nov 5,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found