ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.49k stars 10.05k forks source link

ERROR: Unable to download webpage: HTTP Error 403 #21453

Closed Imran-Haider313 closed 5 years ago

Imran-Haider313 commented 5 years ago

Checklist

Question

I downloaded many videos of same tutorial a week ago and now when i tried to download it again it threw the error. command which I was using to download udemy tutorial is: youtube-dl --verbose -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -u myemail@gmail.com -p mypassword -o '%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/the-complete-react-web-app-developer-course/

Logs in return show following in console

[debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['--verbose', '-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best', '-u', 'PRIVATE', '-p', 'PRIVATE', '-o', '%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s', 'https://www.udemy.com/the-complete-react-web-app-developer-course/'] [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2019.06.08 [debug] Python version 3.7.3 (CPython) - Darwin-17.7.0-x86_64-i386-64bit [debug] exe versions: ffmpeg 4.1.3, ffprobe 4.1.3, rtmpdump 2.4 [debug] Proxy map: {} [udemy:course] Downloading login popup ERROR: Unable to download webpage: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 627, in _request_webpage return self._downloader.urlopen(url_or_request) File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2227, in urlopen return self._opener.open(req, timeout=self._socket_timeout) File "/anaconda2/envs/py3/lib/python3.7/urllib/request.py", line 531, in open response = meth(req, response) File "/anaconda2/envs/py3/lib/python3.7/urllib/request.py", line 641, in http_response 'http', request, response, code, msg, hdrs) File "/anaconda2/envs/py3/lib/python3.7/urllib/request.py", line 569, in error return self._call_chain(args) File "/anaconda2/envs/py3/lib/python3.7/urllib/request.py", line 503, in _call_chain result = func(args) File "/anaconda2/envs/py3/lib/python3.7/urllib/request.py", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp)

Imran-Haider313 commented 5 years ago

what I'm doing wrong? I also tried adding --rm-cache-dir but same output occur

Imran-Haider313 commented 5 years ago

@dstftw dear I looked into every possible thread asked in here but nothing worked for me. that's why I asked it again. can you give me one thread which had worked for most of people ? thanks

OkePaing commented 5 years ago

I also facing this error yet. Version is updated.

bitraid commented 5 years ago

There is an already open issue (#20266) about this (which means it's a known problem with no solution yet).

paulwaldmann commented 4 years ago

Solution (worked for me every time)

Google "my user agent" and use the --user-agent "YOUR_USER_AGENT_HERE" option in your command-line.

udautkarsh commented 4 years ago

No it doesnot

paulwaldmann commented 4 years ago

No it doesnot

It does. I've just tested it, without the --user-agent it will throw the HTTP Error 403: Forbidden error. Once added, it immediately starts downloading. Also, I've mentioned that this works for me and it does, verified a minute ago.

zmiftah commented 3 years ago

Not for me, I'm using Win10 and here is user agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0", still not working