youtube-dl: HTTP Error 403: Forbidden (caused by HTTPError());
Checklist
- I’m reporting a broken site support
- I’ve verified that I’m running youtube-dl version 2020.01.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 issues including closed ones
Verbose log
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-u', u'PRIVATE', u'-p', u'PRIVATE', u'-o', u'%(playlist_title)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s-%(title)s.%(ext)s', u'--verbose', u'https://app.pluralsight.com/library/courses/aws-developer-getting-started']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.01.24
[debug] Python version 2.7.17 (CPython) - Linux-5.3.0-28-generic-x86_64-with-LinuxMint-19.3-tricia
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6
[debug] Proxy map: {}
[pluralsight:course] aws-developer-getting-started: Downloading JSON metadata
[download] Downloading playlist: AWS Developer: Getting Started
[pluralsight:course] playlist AWS Developer: Getting Started: Collected 68 video ids (downloading 68 of them)
[download] Downloading video 1 of 68
[pluralsight] Downloading login page
[pluralsight] Logging in
ERROR: Unable to download webpage: HTTP Error 403: Forbidden (caused by HTTPError()); 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 2237, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 435, 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)
Description
I’m trying to download a course from Pluralsight but I get this exception every time, username and password are provided
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (1 by maintainers)
One workaround that works is to use a cookies.txt file. A working command that I use is this.
youtube-dl --cookies "../cookies.txt" --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0" --sleep-interval 35 --max-sleep-interval 120 --all-subs --sub-format srt --write-sub --verbose https://app.pluralsight.com/library/courses/data-analysis-shiny-r-playbookAs soon as the credentials is specifed including the cookiefile has no effect, the error show up immediately after trying to log in. However if I do not specify credentials the first video can be downloaded in some (most) cases. Spended the whole night trying to figure out a proper way to establish client server relation, now it’s time to have some rest. 😃
Used both youtube-dl 2020.03.01 on multiple platforms, and my forked version that were never changed since 2020.01.24, and this problem showed up today for the first time.
Update:
Okey, somehow I managed to get this to work on my Debian 10 server. I am using the latest version my forked youtube-dl. But it works with youtube-dl 2020.03.01 aswell.
I believe you receive 403 when you are flagged for scraping. If you’re flagged, you will receive 403 with some fancy text even in the browser. Also, if you mix downloading via youtube-dl then break some of their limits and then open browser - there is a window checking for 5 seconds if you’re actually a web browser. Additionally, sometimes if you download a lot via youtube-dl and then open the browser you’re not banned yet, but if you click on any video it will be stuck in this ‘loading video spinner’. They employed some checks I guess.