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

See original GitHub issue
  • 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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

15reactions
dstftwcommented, Apr 15, 2020

--rm-cache-dir.

4reactions
owlboycommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Youtube-dl library and ERROR 403: Forbidden when using ...
I added the "-v" switch to see if I could determine why the download was failing and, much to my surprise, the video...
Read more >
Impossible to download some videos (HTTP Error 403 - Reddit
ERROR: unable to download video data: HTTP Error 403: Forbidden Traceback (most recent call last): File "C:\Users\dst\AppData\Roaming\Build ...
Read more >
[youtube] Unable to download video data: HTTP Error 403 ...
I have a problem downloading some videos from YouTube via yt-dlp. When I try to download it I get the following error: unable...
Read more >
Fix "Unable to download video data: HTTP Error 403
This guide explains how to fix "Unable to download video data: HTTP Error 403: Forbidden" Error When Downloading Media Files With Youtube-dl ...
Read more >
unable to download video data: HTTP Error 403: Forbidden
We weren't sure what that error meant (in the case of youtube-dl as the video is public) so we updated pip and youtube-dl...
Read more >

github_iconTop Related Medium Post

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