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

Youtube ERROR: unable to download video data: HTTP Error 403: Forbidden #24794

Closed
ZaxonXP opened this issue Apr 15, 2020 · 7 comments
Closed

Youtube ERROR: unable to download video data: HTTP Error 403: Forbidden #24794

ZaxonXP opened this issue Apr 15, 2020 · 7 comments
Labels

Comments

@ZaxonXP
Copy link

@ZaxonXP ZaxonXP commented Apr 15, 2020

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

youtube-dl -v -f 18 "https://www.youtube.com/watch?v=5S5zfXao-h0"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-f', u'18', u'https://www.youtube.com/watch?v=5S5zfXao-h0']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.03.24
[debug] Python version 2.7.16 (CPython) - Linux-4.19.0-6-amd64-x86_64-with-debian-10.3
[debug] exe versions: ffmpeg 4.1.4-1, ffprobe 4.1.4-1, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] 5S5zfXao-h0: Downloading webpage
[youtube] {18} signature length 102, html5 player vflset
[youtube] {137} signature length 102, html5 player vflset
[youtube] {248} signature length 106, html5 player vflset
[youtube] {299} signature length 106, html5 player vflset
[youtube] {303} signature length 102, html5 player vflset
[youtube] {136} signature length 106, html5 player vflset
[youtube] {247} signature length 106, html5 player vflset
[youtube] {298} signature length 102, html5 player vflset
[youtube] {302} signature length 106, html5 player vflset
[youtube] {135} signature length 106, html5 player vflset
[youtube] {244} signature length 106, html5 player vflset
[youtube] {134} signature length 102, html5 player vflset
[youtube] {243} signature length 106, html5 player vflset
[youtube] {133} signature length 102, html5 player vflset
[youtube] {242} signature length 106, html5 player vflset
[youtube] {160} signature length 106, html5 player vflset
[youtube] {278} signature length 106, html5 player vflset
[youtube] {140} signature length 106, html5 player vflset
[youtube] {249} signature length 106, html5 player vflset
[youtube] {250} signature length 106, html5 player vflset
[youtube] {251} signature length 106, html5 player vflset
[debug] Invoking downloader on u'https://r1---sn-x0gvoxu-5hnd.googlevideo.com/videoplayback?expire=1586958344&ei=qLuWXp2VMZevgAf_5KqQDA&ip=85.148.169.66&id=o-ACWWLwfUmOoclH9WFphDunwB6UXQcNjgkvm4YeCewrFp&itag=18&source=youtube&requiressl=yes&mh=oF&mm=31%2C29&mn=sn-x0gvoxu-5hnd%2Csn-5hnedn7e&ms=au%2Crdu&mv=m&mvi=0&pcm2cms=yes&pl=16&initcwndbps=1177500&vprv=1&mime=video%2Fmp4&gir=yes&clen=21673114&ratebypass=yes&dur=243.763&lmt=1586880865137966&mt=1586936671&fvip=4&c=WEB&txp=3416222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=ALrAebAwRQIhALBuYf6k5oGw12o6ZfPbFXy8ssKrl02iEOfQsAnG-M4UAiAP17xK-ZraO_i-7RAjyas5pDzQrtVK4wHyPGJ8-uCP2A%3D%3D&sig=uJAJpPlAswRAIgN8L1T_uWFFrrgPsJFURvJhDbLNr0V99U6qpUND-Y9ZsCIBDMm-OcCo-gvTmhecJd2GoIbL3dOvV13WS2_gCl9q'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1926, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1865, in dl
    return fd.download(name, info)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 341, in real_download
    establish_connection()
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 109, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2238, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 435,HTTPError: HTTP Error 403: Forbidden
 in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden

Description

I am trying to download new video from Youtube using following command:

youtube-dl -v -f 18 "https://www.youtube.com/watch?v=5S5zfXao-h0"

When trying from the web browser there is no issue. Also without any parameters I am getting the same result.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 15, 2020

--rm-cache-dir.

@dstftw dstftw closed this Apr 15, 2020
@dstftw dstftw added the invalid label Apr 15, 2020
@ZaxonXP
Copy link
Author

@ZaxonXP ZaxonXP commented Apr 15, 2020

Thank you for the info. It is working after using this option.

@owlboy
Copy link

@owlboy owlboy commented Apr 15, 2020

For anyone confused about what that --rm-cache-dir command does, it removes the cache for youtube-dl. For me, I was re-downloading a video I previously downloaded days or weeks ago and was getting this 403 error.

You can run youtube-dl --rm-cache-dir and afterwords run your normal youtube-dl command.

@audiofeature
Copy link

@audiofeature audiofeature commented Apr 23, 2020

If you use YoutubeDL in Python code, this seems to help:

    # 'cachedir': False -> don't us a local caching dir (~/.cache/youtube-dl)
    ydl_opts = {...,
                'cachedir': False
                }
    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
        result = ydl.extract_info(url)
@filixm
Copy link

@filixm filixm commented Apr 25, 2020

Couldn't figure out what was happening, and this solves it. Thank you!

@gameszaum
Copy link

@gameszaum gameszaum commented Apr 26, 2020

For anyone confused about what that --rm-cache-dir command does, it removes the cache for youtube-dl. For me, I was re-downloading a video I previously downloaded days or weeks ago and was getting this 403 error.

You can run youtube-dl --rm-cache-dir and afterwords run your normal youtube-dl command.

thank you man, I doesn't have any idea what was happening

@sr9000
Copy link

@sr9000 sr9000 commented Apr 26, 2020

--rm-cache-dir.

you are lifesaver!

@ytdl-org ytdl-org locked and limited conversation to collaborators Apr 26, 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.