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

ExtractorError: YouTube said: Unable to extract video data #26152

Closed
5 tasks done
theocrite opened this issue Jul 28, 2020 · 37 comments
Closed
5 tasks done

ExtractorError: YouTube said: Unable to extract video data #26152

theocrite opened this issue Jul 28, 2020 · 37 comments

Comments

@theocrite
Copy link

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2020.07.28
  • 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

Verbose log

youtube-dl -v P5NB1H5pCHk
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'P5NB1H5pCHk']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 2.7.16 (CPython) - Linux-4.19.0-9-amd64-x86_64-with-debian-10.4
[debug] exe versions: ffmpeg 4.1.6-1, ffprobe 4.1.6-1, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] P5NB1H5pCHk: Downloading webpage
ERROR: P5NB1H5pCHk: YouTube said: Unable to extract video data
Traceback (most recent call last):
File "/home/theo/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
ie_result = ie.extract(url)
File "/home/theo/bin/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
ie_result = self._real_extract(url)
File "/home/theo/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1893, in _real_extract
'YouTube said: %s' % unavailable_message, expected=True, video_id=video_id)
ExtractorError: P5NB1H5pCHk: YouTube said: Unable to extract video data

youtube-dl -v 4wZPsFWfi3k
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'4wZPsFWfi3k']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 2.7.16 (CPython) - Linux-4.19.0-9-amd64-x86_64-with-debian-10.4
[debug] exe versions: ffmpeg 4.1.6-1, ffprobe 4.1.6-1, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] 4wZPsFWfi3k: Downloading webpage
ERROR: 4wZPsFWfi3k: YouTube said: Unable to extract video data
Traceback (most recent call last):
File "/home/theo/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
ie_result = ie.extract(url)
File "/home/theo/bin/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
ie_result = self._real_extract(url)
File "/home/theo/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1893, in _real_extract
'YouTube said: %s' % unavailable_message, expected=True, video_id=video_id)
ExtractorError: 4wZPsFWfi3k: YouTube said: Unable to extract video data

Description

It seems that ytdl can't download restricted videos anymore (the ones behind a "sign in to confirm your age" wall).

@guestbuy5
Copy link

I'm seeing the same issue with latest version.

@oSumAtrIX
Copy link

oSumAtrIX commented Jul 29, 2020

I can confirm that this is also happening with HW4IM87DAdg

@ethanbreck
Copy link

Seems like a mass issue, as issues #26148 #26123 #26103 is having very similar issues.

@jshir
Copy link

jshir commented Jul 29, 2020

Both videos above worked for me - only after I fed it my YouTube cookies.

I came here after noticing a similar problem with _Uelrsz_VfY (even though video is not age restricted and plays in private mode just fine). It seems like YT is requiring a session cookie to dl certain videos (maybe to do with country restrictions as this video got song matched). It doesn't help the user realize this since it's not an error 401.

As more videos have this issue I think it would be a nice enhancement for YTDL to give the user some hand-holding as far as getting cookies.txt set up and automatically using it when needed instead of adding --cookies c:\path\to\youtube-dl\cookies.txt every time.

@ethanbreck
Copy link

Yeah, like a youtube-dl --first or youtube-dl --cookie-update that sort of walks you through it would be nice.

@Xan-Kun
Copy link

Xan-Kun commented Jul 29, 2020

Hey there!
Same here PrJ5Sx1Dtc8 . So is the (missing) cookie actually the issue here?
Can someone confirm?

@bustbr
Copy link

bustbr commented Jul 29, 2020

PR #26100 fixes the age-gate check, but it's not merged into upstream yet. You can apply the patch locally.

@Xan-Kun
Copy link

Xan-Kun commented Jul 29, 2020

I ask because I tried two approaches to provide cookies for a logged-in user and both didn't work (providing text file and --add-header option).
I assume I got something wrong in the format then...
Edit: Got it working with the browser plugin and the --cookies option. And now it downloads the video with an age-check.

@BrimDragster
Copy link

Happens with yJj9q-67ivA too.

@chudsaviet
Copy link

Another example with this error: https://www.youtube.com/watch?v=oL276M79mYE .

@mixon2020
Copy link

mixon2020 commented Aug 11, 2020

I am having the same issue as #26299.
here is what my software gave me as the issue

ERROR: Unable to download webpage: HTTP Error 429: Too Many Requests (caused by HTTPError()); 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.

I am using a current updated version of Windows 10.
I am running youtube-dl version 2020.07.28
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

None of the videos are age restricted

@penyuan
Copy link

penyuan commented Aug 11, 2020

Edit: Got it working with the browser plugin and the --cookies option.

This only works sporadically for me, very often I still get the "Unable to extract video data" error. I'm not sure what triggers the error.

@mixon2020
Copy link

Thank you will try that

@penyuan
Copy link

penyuan commented Aug 11, 2020

Thank you will try that

Well like I said it only works for me occasionally. Hopefully a more fundamental solution can be found for the "unable to extract video data" error.

@Cyrix126
Copy link

Cyrix126 commented Aug 15, 2020

I don't know if it's helpful, but if you're not connected to an account on youtube, you can still see a restricted video by changing in the url "watch?v=" with "embed/". Unfortunately doing this with youtube-dl doesn't work.

@tezJR
Copy link

tezJR commented Aug 16, 2020

Is there an easy way for those without programming experience to apply the patch locally? And how do I create/find the cookies.txt file?

@omgitsraven
Copy link

If you're running it in Python, there's no programming necessary, just change this line in this file: https://github.com/ytdl-org/youtube-dl/pull/26100/files

If you're running it from an .exe file (as recommended on Windows), I'm not sure what to recommend, I haven't looked into the compilation process myself

@tezJR
Copy link

tezJR commented Aug 17, 2020

I'm running it from the .exe in Windows 10. I have Python 3.7.4 but wouldn't know how to use it for this without step-by-step instructions. EDIT: nicolaasjan's solution below worked for me.

@nicolaasjan
Copy link

Is there an easy way for those without programming experience to apply the patch locally? And how do I create/find the cookies.txt file?

A cookies.txt file can be created with the "cookies.txt" extension.
Do this while being logged in to YouTube.

For Firefox:
https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/
For Chrome:
https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg

Then run youtube-dl like this:
youtube-dl.exe --cookies C:\Users\tezJR\Downloads\cookies-txt https://www.youtube.com/watch?v=$VIDEO-ID
(adjust that command to where your cookies.txt file is actually located and replace $VIDEO-ID with the ID of your restricted video).

@tezJR
Copy link

tezJR commented Aug 17, 2020

That worked! Thank you very much, nicolaasjan!

@nicolaasjan
Copy link

That worked! Thank you very much, nicolaasjan!

No problem.

I have sent you a mail with instructions to compile youtube-dl.exe yourself.
It's not that complicated when you have Python installed.

@Rikk
Copy link

Rikk commented Aug 18, 2020

What's happening with youtube-dl team? No commits in a long time, and no fix for this obvious bug that has been reported many times?

@deepesh-agarwal
Copy link

#26100 Fixed most of the videos for me but the one as shown below is still not working.

youtube-dl -F -v 7takIh1nK0s
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-F', u'-v', u'7takIh1nK0s']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 2.7.16 (CPython) - Linux-4.19.0-6-amd64-x86_64-with-debian-10.2
[debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1
[debug] Proxy map: {}
[youtube] 7takIh1nK0s: Downloading webpage
ERROR: 7takIh1nK0s: YouTube said: Unable to extract video data
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 1893, in _real_extract
    'YouTube said: %s' % unavailable_message, expected=True, video_id=video_id)
ExtractorError: 7takIh1nK0s: YouTube said: Unable to extract video data

@nicolaasjan
Copy link

nicolaasjan commented Aug 21, 2020

#26100 Fixed most of the videos for me but the one as shown below is still not working.

When launching youtube-dl with python3 (and fix #26100) , I get a little bit further:

python3 youtube-dl --ignore-config -F -v 7takIh1nK0s
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--ignore-config', '-F', '-v', '7takIh1nK0s']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 3.6.9 (CPython) - Linux-4.15.0-112-generic-x86_64-with-LinuxMint-19.3-tricia
[debug] exe versions: ffmpeg N-98759-g1c7e55d, ffprobe N-98759-g1c7e55d
[debug] Proxy map: {}
[youtube] 7takIh1nK0s: Downloading webpage
[youtube] 7takIh1nK0s: Downloading embed webpage
[youtube] 7takIh1nK0s: Refetching age-gated info webpage
ERROR: Watch this video on YouTube. Playback on other websites has been disabled by the video owner.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 2212, in _real_extract
    raise ExtractorError(error_message, expected=True)
youtube_dl.utils.ExtractorError: Watch this video on YouTube. Playback on other websites has been disabled by the video owner.

Note:
ERROR: Watch this video on YouTube. Playback on other websites has been disabled by the video owner.
Don't know how to work around that...

@antdude
Copy link

antdude commented Aug 22, 2020

Same here with https://www.youtube.com/watch?v=za8PP4xLHdQ (Lovecraft Country: “Sundown” (Episode 1 - Full Episode) | HBO Max) from two different 64-bit Linux boxes.

@fdk17
Copy link

fdk17 commented Aug 22, 2020

python3 youtube-dl --ignore-config -F -v 7takIh1nK0s

Note:
ERROR: Watch this video on YouTube. Playback on other websites has been disabled by the video owner.
Don't know how to work around that...

This video worked fine when following directions using cookie option in #26152 (comment)

@upex
Copy link

upex commented Aug 27, 2020

I ask because I tried two approaches to provide cookies for a logged-in user and both didn't work (providing text file and --add-header option).
I assume I got something wrong in the format then...
Edit: Got it working with the browser plugin and the --cookies option. And now it downloads the video with an age-check.

I ask because I tried two approaches to provide cookies for a logged-in user and both didn't work (providing text file and --add-header option).
I assume I got something wrong in the format then...
Edit: Got it working with the browser plugin and the --cookies option. And now it downloads the video with an age-check.

Hey @Xan-Kun , i did the same thing but every time I try to fetch URLs, the cookies.txt file gets override!! Is it expected behaviour? Also, I am running those commands in AWS hosted ubuntu machine. Please help.

@upex
Copy link

upex commented Aug 28, 2020

Is there an easy way for those without programming experience to apply the patch locally? And how do I create/find the cookies.txt file?

A cookies.txt file can be created with the "cookies.txt" extension.
Do this while being logged in to YouTube.

For Firefox:
https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/
For Chrome:
https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg

Then run youtube-dl like this:
youtube-dl.exe --cookies C:\Users\tezJR\Downloads\cookies-txt https://www.youtube.com/watch?v=$VIDEO-ID
(adjust that command to where your cookies.txt file is actually located and replace $VIDEO-ID with the ID of your restricted video).

Hey @nicolaasjan , i did the same thing but every time I try to fetch URLs, the cookies.txt file gets override!! Is it expected behaviour? Also, I am running those commands in AWS hosted ubuntu machine. Please help.

@nicolaasjan
Copy link

nicolaasjan commented Aug 28, 2020

Hey @nicolaasjan , i did the same thing but every time I try to fetch URLs, the cookies.txt file gets override!! Is it expected behaviour? Also, I am running those commands in AWS hosted ubuntu machine. Please help.

I read somewhere, that youtube-dl changes the expiration date of the cookies in it, so that it keeps working as intended.
In the header of the file it says:
# This file is generated by youtube-dl. Do not edit.

The expiration dates are in Unix Timestamp format, so 1603788661 means 10/27/2020 @ 8:51am (UTC)
(you can convert these values online here:
https://www.unixtimestamp.com/index.php)

@spiralofhope
Copy link

@nicolaasjan said:
I read somewhere, that youtube-dl changes the expiration date of the cookies in it, so that it keeps working as intended.

I tested and confirmed it's being very heavily rewritten.

@dstftw dstftw closed this as completed in 16ee69c Sep 6, 2020
@Xan-Kun
Copy link

Xan-Kun commented Sep 14, 2020

Hey @Xan-Kun , i did the same thing but every time I try to fetch URLs, the cookies.txt file gets override!! Is it expected behaviour? Also, I am running those commands in AWS hosted ubuntu machine. Please help.

@upex Hi there. Yes it does! I just checked and didn't realise it before, but when I start the download, the cookies file gets overwritten.
(Didn't check the contents so far, only timestamp)

@ayunami2000
Copy link

ayunami2000 commented Sep 14, 2020 via email

@dilungasr
Copy link

dilungasr commented Dec 13, 2020

To me: removing YouTube-dl downloaded using sudo apt install youtube-dl and installing it using pip3 install youtube-dl solved the issue!

FOR LINUX USERS ONLY!!!

@walkoncross
Copy link

To me: removing YouTube-dl downloaded using sudo apt install youtube-dl and installing it using pip3 install youtube-dl solved the issue!

FOR LINUX USERS ONLY!!!

This works on MacOS for me.
"""
$ brew uninstall youtube-dl
Uninstalling /usr/local/Cellar/youtube-dl/2020.11.1.1... (2,203 files, 16.4MB)

$ pip3 install youtube-dl

Collecting youtube-dl
Downloading youtube_dl-2020.12.12-py2.py3-none-any.whl (1.8 MB)
|████████████████████████████████| 1.8 MB 1.1 MB/s
Installing collected packages: youtube-dl
Successfully installed youtube-dl-2020.12.12
"""

@AveragedevRK
Copy link

AveragedevRK commented Jan 2, 2021

Try installing it with snap instead of apt or apt-get

sudo snap install youtube-dl

@SatyamGaba
Copy link

To me: removing YouTube-dl downloaded using sudo apt install youtube-dl and installing it using pip3 install youtube-dl solved the issue!

FOR LINUX USERS ONLY!!!

I get following error:

-bash: /usr/bin/youtube-dl: No such file or directory

Can anyone help me to resolve it?

@sfolje0
Copy link

sfolje0 commented Feb 22, 2021

To me: removing YouTube-dl downloaded using sudo apt install youtube-dl and installing it using pip3 install youtube-dl solved the issue!
FOR LINUX USERS ONLY!!!

I get following error:

-bash: /usr/bin/youtube-dl: No such file or directory

Can anyone help me to resolve it?

Hi @SatyamGaba,

Did you try running python3 -m youtube_dl (i.e. running reinstalled python's modul youtube-dl)?
Note also: youtube_dl and not youtube-dl in the above command.

Explained:
I suspect that your specific problem is that when you uninstalled youtube-dl using apt, it also deleted the binary /usr/bin/youtube-dl and therefore comand $ youtube-dl in bash will return your-mentioned error. When you 'reinstalled' it with pip, it stayed inside python's (private?) packages without creating yotube-dl executable. But that's no problem, just run it via python as said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests