Unable to download video data http error 403 forbidden

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'...
  • 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.

Hey, so since two or three days ago, youtube-dl has been giving me the answer ‘HTTPError: HTTP Error 403: Forbidden’ on some videos, while others work fine with the same command.
After a few tests, it seems to do so with approximately half the videos I’m trying to download, couldn’t find any link between the videos I could download and the ones I couldn’t, I tried a bit of everything.

I tried a few commands found on this post of yesterday without success.

Any idea what could cause this? How to solve it?

here’s the verbose (used ffmpeg for this one, but same problem without ffmpeg):

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [‘-x’, ‘—audio-format’, ‘flac’, ‘https://www.youtube.com/watch?v=nVcPLlHHcdU’, ‘—verbose’]
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2020.03.24
[debug] Python version 3.4.4 (CPython) — Windows-10-10.0.18362
[debug] exe versions: ffmpeg 4.2.2
[debug] Proxy map: {}
[youtube] nVcPLlHHcdU: Downloading webpage
[youtube] {18} signature length 108, html5 player vflset
[youtube] {134} signature length 104, html5 player vflset
[youtube] {243} signature length 104, html5 player vflset
[youtube] {133} signature length 108, html5 player vflset
[youtube] {242} signature length 108, html5 player vflset
[youtube] {160} signature length 104, html5 player vflset
[youtube] {278} signature length 108, html5 player vflset
[youtube] {140} signature length 104, html5 player vflset
[youtube] {249} signature length 108, html5 player vflset
[youtube] {250} signature length 108, html5 player vflset
[youtube] {251} signature length 108, html5 player vflset
[debug] Invoking downloader on ‘https://r4—sn-25glenez.googlevideo.com/videoplayback?expire=1587319457&ei=QT6cXs2dEbGhxN8PxruEiAk&ip=2a01%3Acb05%3A8908%3Ab600%3A6113%3Ac3c2%3A7d30%3A8e2c&id=o-AKWvsi2I0omVWPqR096RaIGEP0PPU7Jp6hPaRMEcWU3O&itag=251&source=youtube&requiressl=yes&mh=SI&mm=31%2C29&mn=sn-25glenez%2Csn-25ge7nsl&ms=au%2Crdu&mv=m&mvi=3&pl=30&initcwndbps=622500&vprv=1&mime=audio%2Fwebm&gir=yes&clen=6384797&dur=395.981&lmt=1540190826629720&mt=1587297751&fvip=4&keepalive=yes&c=WEB&txp=5411222& sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps& lsig=ALrAebAwRAIgA17ftIW1CO8tiuf1CPvoNIqvNlVN2t- vTHl42Dbit_ECIHAGT8iXbQIhef8f294nvhCzcBFSroYR1vOe7GJCpbKq&sig=AJpPlLswRQIgDIhlpMyzN5K1kr7VCUdsGmsjRcHbzoFO=OuuBc18hEoCIQCa4VFFI==zWib1wJ5wZ1LJaobWs1hDA5OzjVJSEXBq&ratebypass=yes’
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
File «C:UsersdstAppDataRoamingBuild archiveyoutube-dlytdl-orgtmpjwbwqymmbuildyoutube_dlYoutubeDL.py», line 1926, in process_info
File «C:UsersdstAppDataRoamingBuild archiveyoutube-dlytdl-orgtmpjwbwqymmbuildyoutube_dlYoutubeDL.py», line 1865, in dl
File «C:UsersdstAppDataRoamingBuild archiveyoutube-dlytdl-orgtmpjwbwqymmbuildyoutube_dldownloadercommon.py», line 366, in download
File «C:UsersdstAppDataRoamingBuild archiveyoutube-dlytdl-orgtmpjwbwqymmbuildyoutube_dldownloaderhttp.py», line 341, in real_download
File «C:UsersdstAppDataRoamingBuild archiveyoutube-dlytdl-orgtmpjwbwqymmbuildyoutube_dldownloaderhttp.py», line 109, in establish_connection
File «C:UsersdstAppDataRoamingBuild archiveyoutube-dlytdl-orgtmpjwbwqymmbuildyoutube_dlYoutubeDL.py», line 2238, in urlopen
File «C:PythonPython34liburllibrequest.py», line 470, in open
File «C:PythonPython34liburllibrequest.py», line 580, in http_response
File «C:PythonPython34liburllibrequest.py», line 508, in error
File «C:PythonPython34liburllibrequest.py», line 442, in _call_chain
File «C:PythonPython34liburllibrequest.py», line 588, in http_error_default
urllib.error.HTTPError: HTTP Error 403: Forbidden

Youtube-dl is my favorite and preferred command line download manager. I often use it to download audios, videos and movies from Internet. Today, I tried to download a video from YouTube using youdtube-dl from my Linux desktop and got this error message – Unable to download video data: HTTP Error 403: Forbidden. Usually, most youtube-dl errors will be fixed after updating youtube-dl. So I updated youtube-dl using command:

$ sudo youtube-dl -U

It is already updated! I have the most recent version.

And then I tried again to download the video with command:

$ youtube-dl https://www.youtube.com/watch?v=4jTy5jnMkYc

But I get the same error:

[youtube] 4jTy5jnMkYc: Downloading webpage
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
ERROR: unable to download video data: HTTP Error 403: Forbidden

If you ever encountered with this error, follow the steps given below to fix it.

Fix “Unable to download video data: HTTP Error 403: Forbidden” Error When Downloading Media Files With Youtube-dl In Linux

This error will probably happen because of Youtube-dl cache. To fix it, simply remove the cache for youtube-dl using command:

$ youtube-dl --rm-cache-dir

This command command will remove the local caching directory for youtube-dl. In my case, it removed the following directory:

Removing cache dir /home/sk/.cache/youtube-dl ...

Fix "Unable to download video data: HTTP Error 403: Forbidden" Error

If you use Youtube-dl in Python code, the following will help to fix this error.

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

Now, I can be able to download the youtube videos without any issues.

$ youtube-dl https://www.youtube.com/watch?v=4jTy5jnMkYc
[youtube] 4jTy5jnMkYc: Downloading webpage
[youtube] 4jTy5jnMkYc: Downloading js player vflset
[youtube] 4jTy5jnMkYc: Downloading js player vflset
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[download] Destination: Takkar _ Nira Song Lyric Video _ Siddharth _ Sid Sriram _ Gautham Menon _ Nivas K Prasanna-4jTy5jnMkYc.f137.mp4
[download] 100% of 29.87MiB in 00:24
[download] Destination: Takkar _ Nira Song Lyric Video _ Siddharth _ Sid Sriram _ Gautham Menon _ Nivas K Prasanna-4jTy5jnMkYc.f251.webm
[download] 100% of 5.10MiB in 00:04
[ffmpeg] Merging formats into "Takkar _ Nira Song Lyric Video _ Siddharth _ Sid Sriram _ Gautham Menon _ Nivas K Prasanna-4jTy5jnMkYc.mkv"
Deleting original file Takkar _ Nira Song Lyric Video _ Siddharth _ Sid Sriram _ Gautham Menon _ Nivas K Prasanna-4jTy5jnMkYc.f137.mp4 (pass -k to keep)
Deleting original file Takkar _ Nira Song Lyric Video _ Siddharth _ Sid Sriram _ Gautham Menon _ Nivas K Prasanna-4jTy5jnMkYc.f251.webm (pass -k to keep)

As you may probably noticed, there is a warning message in the above command:

[...]
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[...]

This is not actually a problem but an expected behavior for youtube-dl command. By default, youtube-dl will download the highest quality audio and the highest quality video streams available and then join them into a compatible container like mkv, mp4 etc.  If these audio and video streams doesn’t fit well in an mp4 container, youtube-dl will then pack them in mkv container and display the above warning message. In such cases, you can ignore the mkv warning and download the best quality video and the best quality audio but only in an mp4 container by explicitly mentioning the desired best quality audio and video formats like below:

$ youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]' https://www.youtube.com/watch?v=4jTy5jnMkYc

For more Youtube-dl command examples, refer the following guide.

Hope this helps.

Thanks for stopping by!

Help us to help you:

Have a Good day!!

Я пытаюсь загрузить песни с YouTube с помощью Python 3.8 и YouTube_35.3.24. Но странная вещь в том, что большинство песен, которые я пытаюсь скачать, не загружаются. Я говорю о 99% из них. Те, которые загружаются, получают следующую ошибку от youtube_dl:

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

Стоит сказать, что это произошло за одну ночь, и я не изменил код. до этого все работало нормально. У меня есть друзья, которые запускали один и тот же код, и они не получили эту ошибку

3 ответа

Лучший ответ

Одна и та же проблема много раз .. решение: youtube-dl --rm-cache-dir

Причина проблемы: иногда я загружаю плейлисты больших видео и заставляю их останавливать загрузку , при следующем запуске команды для возобновления загрузки возникает проблема 403

На данный момент каталог кеша используется только для хранения плееров YouTube для запутанных подписей. Поскольку все видео в плейлисте используют простые подписи

Кэширование списков воспроизведения — это очевидный способ обнаружить измененные заголовки или измененные списки воспроизведения в целом.


13

Alexander Willam Vera Paco
17 Апр 2020 в 04:56

Кажется, я понял это самостоятельно. Ошибка ушла после того, как я очистил кеш.

            with youtube_dl.YoutubeDL(ydl_opts) as ydl:
            try:
                ydl.cache.remove()
                ydl.download([youtube_link])
            except youtube_dl.DownloadError as error:
                pass

Любая информация о том, почему это работает, приветствуется


1

lukas
16 Апр 2020 в 15:57

Также проверенная очистка кэша устраняет эту ошибку. Большое спасибо Александру!


-1

eljacobsen12
21 Апр 2020 в 01:34

Youtube-dl is my favorite and preferred command line download manager. I often use it to download audios, videos and movies from Internet. Today, I tried to download a video from YouTube using youdtube-dl from my Linux desktop and got this error message — Unable to download video data: HTTP Error 403: Forbidden. Usually, most youtube-dl errors will be fixed after updating youtube-dl. So I updated youtube-dl using command:

$ sudo youtube-dl -U

It is already updated! I have the most recent version.

And then I tried again to download the video with command:

$ youtube-dl https://www.youtube.com/watch?v=4jTy5jnMkYc

But I get the same error:

[youtube] 4jTy5jnMkYc: Downloading webpage
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
ERROR: unable to download video data: HTTP Error 403: Forbidden

If you ever encountered with this error, follow the steps given below to fix it.

Fix «Unable to download video data: HTTP Error 403: Forbidden» Error When Downloading Media Files With Youtube-dl In Linux

This error will probably happen because of Youtube-dl cache. To fix it, simply remove the cache for youtube-dl using command:

$ youtube-dl --rm-cache-dir

This command command will remove the local caching directory for youtube-dl. In my case, it removed the following directory:

Removing cache dir /home/sk/.cache/youtube-dl ...

Fix "Unable to download video data: HTTP Error 403: Forbidden" Error

If you use Youtube-dl in Python code, the following will help to fix this error.

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

Now, I can be able to download the youtube videos without any issues.

$ youtube-dl https://www.youtube.com/watch?v=4jTy5jnMkYc
[youtube] 4jTy5jnMkYc: Downloading webpage
[youtube] 4jTy5jnMkYc: Downloading js player vflset
[youtube] 4jTy5jnMkYc: Downloading js player vflset
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[download] Destination: Takkar _ Nira Song Lyric Video _ Siddharth _ Sid Sriram _ Gautham Menon _ Nivas K Prasanna-4jTy5jnMkYc.f137.mp4
[download] 100% of 29.87MiB in 00:24
[download] Destination: Takkar _ Nira Song Lyric Video _ Siddharth _ Sid Sriram _ Gautham Menon _ Nivas K Prasanna-4jTy5jnMkYc.f251.webm
[download] 100% of 5.10MiB in 00:04
[ffmpeg] Merging formats into "Takkar _ Nira Song Lyric Video _ Siddharth _ Sid Sriram _ Gautham Menon _ Nivas K Prasanna-4jTy5jnMkYc.mkv"
Deleting original file Takkar _ Nira Song Lyric Video _ Siddharth _ Sid Sriram _ Gautham Menon _ Nivas K Prasanna-4jTy5jnMkYc.f137.mp4 (pass -k to keep)
Deleting original file Takkar _ Nira Song Lyric Video _ Siddharth _ Sid Sriram _ Gautham Menon _ Nivas K Prasanna-4jTy5jnMkYc.f251.webm (pass -k to keep)

As you may probably noticed, there is a warning message in the above command:

[...]
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[...]

This is not actually a problem but an expected behavior for youtube-dl command. By default, youtube-dl will download the highest quality audio and the highest quality video streams available and then join them into a compatible container like mkv, mp4 etc.  If these audio and video streams doesn’t fit well in an mp4 container, youtube-dl will then pack them in mkv container and display the above warning message. In such cases, you can ignore the mkv warning and download the best quality video and the best quality audio but only in an mp4 container by explicitly mentioning the desired best quality audio and video formats like below:

$ youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]' https://www.youtube.com/watch?v=4jTy5jnMkYc

For more Youtube-dl command examples, refer the following guide.

  • Youtube-dl Tutorial With Examples For Beginners

Hope this helps.

Thanks for stopping by!

Help us to help you:

  • Subscribe to our Email Newsletter : Sign Up Now
  • Support OSTechNix : Donate Via PayPal
  • Download free E-Books and Videos : OSTechNix on TradePub
  • Connect with us: Reddit | Facebook | Twitter | LinkedIn | RSS feeds

Have a Good day!!

sk

Senthilkumar Palani (aka SK) is the Founder and Editor in chief of OSTechNix. He is a Linux/Unix enthusiast and FOSS supporter. He lives in Tamilnadu, India.

Я получаю следующую ошибку при попытке загрузить видео с помощью youtube-dl.

WARNING: Warning: Falling back to static signature algorithm
ERROR: unable to download video data: HTTP Error 403: Forbidden

задан
6 October 2015 в 07:04

поделиться

7 ответов

Вышеупомянутые решения для меня не сработали. Я использовал следующие команды с официального сайта youtube-dl.

http://rg3.github.io/youtube-dl/download.html

Используйте http: //rg3.github.io/youtube-dl/download.html:

sudo wget https://yt-dl.org/downloads/2014.09.25/youtube-dl -O /usr/local/bin/youtube-dl

sudo chmod a+x /usr/local/bin/youtube-dl

Это исправило это для меня.

ответ дан Community
24 May 2018 в 05:45

поделиться

Те, кто сталкивается с новыми проблемами с youtube-dl с этой ошибкой «Warning: Falling back to static signature algorithm», должны сначала установить python-pip (если они еще не установили его, конечно) с помощью

, а затем, чтобы исправить ошибку, используйте

sudo pip install youtube-dl --upgrade

Это то, что сработало для меня этим утром (как во время публикации этого ответа).

ответ дан wjandrea
24 May 2018 в 05:45

поделиться

Установите pip-python, если вы еще этого не сделали, затем введите:

sudo pip install --upgrade youtube_dl

Это исправляет проблему.

ответ дан muru
24 May 2018 в 05:45

поделиться

Попробуйте очистить кеш youtube-dl:

youtube-dl --rm-cache-dir

Источник: https://github.com/rg3/youtube-dl/issues/6610:

ответ дан Limon Monte
24 May 2018 в 05:45

поделиться

После исправления проблемы. Теперь он прекрасно работает.

$ sudo apt-get install yasm
$ git clone git://git.libav.org/libav.git
$ cd libav
$ ./configure
$ make
$ sudo make install

Источник: http://www.tecmint.com/record-ubuntu-desktop-screen-using-avconv/

ответ дан bagustris
24 May 2018 в 05:45

поделиться

Я загрузил youtube-dl из https://yt-dl.org/downloads/2014.09.25/. Затем я сделал chmod 777 youtube-dl и выполнил команду. Он попросил меня обновить через ./youtube -dl -U, который обновил меня до версии 2015.12.13. Я снова побежал ./youtube-dl с URL-адресом, и проблема была решена.

Пытаясь выполнить обновление аппарета по умолчанию, установка pip youtube-dl не выполнила обновление или не решила проблему, указав, что версия pypi может устаревать при исправлениях ошибок.

ответ дан Abhinav Maurya
24 May 2018 в 05:45

поделиться

Я попробовал это, и теперь все работает хорошо:

apt-get remove youtube-dl
apt-get update
apt-get install youtube-dl

Теперь это снова работает, так как эти строки будут повторно устанавливать последнюю версию youtube-dl с сервера

ответ дан muru
24 May 2018 в 05:45

поделиться

Другие вопросы по тегам:

Похожие вопросы:

Понравилась статья? Поделить с друзьями:
  • Unable to display page due to an error yandex browser
  • Unable to display children error resolving variables traceback most recent call last
  • Unable to display activation page error returned was
  • Unable to determine the hardware id for this computer odis как исправить
  • Unable to determine java runtime environment error code 2 odis