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.

sporadic error: Unable to extract yt initial data

See original GitHub issue

Checklist

  • I’m reporting a broken site support
  • I’ve verified that I’m running youtube-dl version 2021.03.31
  • 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 issues including closed ones

Similar to #28585 – I’m in Europe (Germany) too.

Verbose log

$ youtube-dl -v --playlist-end 2 https://www.youtube.com/c/ClashOfClans/videos
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--playlist-end', '2', 'https://www.youtube.com/c/ClashOfClans/videos']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.03.31
[debug] Python version 3.9.2 (CPython) - Linux-5.11.10-arch1-1-x86_64-with-glibc2.33
[debug] exe versions: ffmpeg 4.3.2, ffprobe 4.3.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube:tab] ClashOfClans: Downloading webpage
ERROR: Unable to extract yt initial data; 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 "/usr/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 806, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 827, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.9/site-packages/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib/python3.9/site-packages/youtube_dl/extractor/youtube.py", line 2694, in _real_extract
    data = self._extract_yt_initial_data(item_id, webpage)
  File "/usr/lib/python3.9/site-packages/youtube_dl/extractor/youtube.py", line 284, in _extract_yt_initial_data
    self._search_regex(
  File "/usr/lib/python3.9/site-packages/youtube_dl/extractor/common.py", line 1012, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract yt initial data; 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

In about every second/third try, the above command fails as shown above. So in order to download successfully, I have to execute this command a few times. It doesn’t seem to matter which playlist is given – it happens with a lot of them.

This looks like #28585: I’m in Europe (Germany) too. But that one is closed already – too early IMHO.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
remitaminecommented, Mar 31, 2021

passing any value for the Cookie header causes the extraction to work as expected:

youtube-dl --add-header 'Cookie:' https://www.youtube.com/c/ClashOfClans/videos
[youtube:tab] ClashOfClans: Downloading webpage
[download] Downloading playlist: Clash of Clans - Videos
[youtube:tab] Downloading page 1
[youtube:tab] Downloading page 2
[youtube:tab] Downloading page 3
...
youtube-dl https://www.youtube.com/c/ClashOfClans/videos
[youtube:tab] ClashOfClans: Downloading webpage
ERROR: Unable to extract yt initial data; 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.
0reactions
dstftwcommented, Apr 1, 2021

@dstftw Why are you closing this bug?

Today it failed for me in 95% of the tries. After editing the cookie file (passed with the --cookies option) to include this line

.youtube.com TRUE / FALSE 2145916800 CONSENT YES+DE.de

… it worked for me again. This workaround could be added to youtube-dl, couldn’t it?

It’s already fixed. Bothet to check releases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

youtube-dl: ERROR: Unable to extract yt initial data
ERROR : Unable to extract yt initial data; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version;...
Read more >
Youtube_dl : ERROR : YouTube said: Unable to extract video ...
The simplest & quickest way to solve this issue without running around and trying a thousand different solutions is to completely remove Youtube...
Read more >
Youtube-dl Tutorial With Examples For Beginners - OSTechNix
This tutorial explains the list of most commonly used Youtube-dl commands to download ... ERROR: unable to download video data: HTTP Error 403:...
Read more >
youtube-dl - download videos from ... - manpages.ubuntu!
I'm getting an error Unable to extract OpenGraph title on YouTube playlists YouTube changed their playlist format in March 2014 and later on,...
Read more >
yt-dlp command man page - ManKier
The general syntax of --parse-metadata FROM:TO is to give the name of a field or an output template to extract data from, and...
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