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

running youtube-dl is giving HTTP Error 403 #6915

Closed
raychaudhuri-amitava opened this issue Sep 21, 2015 · 5 comments
Closed

running youtube-dl is giving HTTP Error 403 #6915

raychaudhuri-amitava opened this issue Sep 21, 2015 · 5 comments

Comments

@raychaudhuri-amitava
Copy link

@raychaudhuri-amitava raychaudhuri-amitava commented Sep 21, 2015

amitava@L-4BXP542:/Data/install/ashoka$ youtube-dl --verbose --no-check-certificate --netrc --audio-quality 0 --prefer-ffmpeg --include-ads -playlist-reverse --playlist-start 1 --merge-output-format mp4 --autonumber-size 4 -o "%(autonumber)s_AshokaSamrat_%(upload_date)s_%(resolution)s.%(ext)s" "https://www.youtube.com/playlist?list=PLcC6hSpO26KvnTm0wvNK6T-stRMMHL62Q"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', '--no-check-certificate', '--netrc', '--audio-quality', '0', '--prefer-ffmpeg', '--include-ads', '-playlist-reverse', '--playlist-start', '1', '--merge-output-format', 'mp4', '--autonumber-size', '4', '-o', '%(autonumber)s_AshokaSamrat_%(upload_date)s_%(resolution)s.%(ext)s', 'https://www.youtube.com/playlist?list=PLcC6hSpO26KvnTm0wvNK6T-stRMMHL62Q']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.09.09
[debug] Python version 3.4.0 - Linux-3.13.0-63-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: none
[debug] Proxy map: {}
[youtube:playlist] Downloading login page
[youtube:playlist] Logging in
Type 2-step verification code and press [Return]:
[youtube:playlist] Submitting TFA code
[youtube:playlist] PLcC6hSpO26KvnTm0wvNK6T-stRMMHL62Q: Downloading webpage
[download] Downloading playlist: Chakravartin Ashoka Samrat
[youtube:playlist] PLcC6hSpO26KvnTm0wvNK6T-stRMMHL62Q: Downloading page #1
ERROR: Unable to download JSON metadata: 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; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
File "/usr/local/lib/python3.4/dist-packages/youtube_dl/extractor/common.py", line 326, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/lib/python3.4/dist-packages/youtube_dl/YoutubeDL.py", line 1865, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python3.4/urllib/request.py", line 461, in open
response = meth(req, response)
File "/usr/lib/python3.4/urllib/request.py", line 571, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.4/urllib/request.py", line 499, in error
return self._call_chain(_args)
File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
result = func(_args)
File "/usr/lib/python3.4/urllib/request.py", line 579, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Sep 21, 2015

Running just youtube-dl "https://www.youtube.com/playlist?list=PLcC6hSpO26KvnTm0wvNK6T-stRMMHL62Q" works fine for me. YOu are missing a leading dash in -playlist-reverse it must be --playlist-reverse, does it work with that change? Since the list is not private can you try without the --netrc option?

@Nidan
Copy link

@Nidan Nidan commented Sep 21, 2015

I'm also getting 403s

$ youtube-dl --verbose --prefer-ffmpeg https://www.youtube.com/watch?v=3W1M8lJEUdI
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'--prefer-ffmpeg', u'https://www.youtube.com/watch?v=3W1M8lJEUdI']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.06.04.1
[debug] Python version 2.7.10 - Linux-4.1.0-2-amd64-x86_64-with-debian-stretch-sid
[debug] exe versions: avconv 2.7.2-2, avprobe 2.7.2-2, ffmpeg 2.7.2-2, ffprobe 2.7.2-2
[debug] Proxy map: {}
[youtube] 3W1M8lJEUdI: Downloading webpage
[youtube] 3W1M8lJEUdI: Extracting video information
[youtube] {22} signature length 40.40, html5 player new
[youtube] {43} signature length 40.40, html5 player new
[youtube] {18} signature length 40.40, html5 player new
[youtube] {5} signature length 40.40, html5 player new
[youtube] {36} signature length 40.40, html5 player new
[youtube] {17} signature length 40.40, html5 player new
[youtube] {13} signature length 40.40, html5 player new
[youtube] {137} signature length 40.40, html5 player new
[youtube] {248} signature length 40.40, html5 player new
[youtube] {299} signature length 40.40, html5 player new
[youtube] {303} signature length 40.40, html5 player new
[youtube] {136} signature length 40.40, html5 player new
[youtube] {247} signature length 40.40, html5 player new
[youtube] {298} signature length 40.40, html5 player new
[youtube] {302} signature length 40.40, html5 player new
[youtube] {135} signature length 40.40, html5 player new
[youtube] {244} signature length 40.40, html5 player new
[youtube] {134} signature length 40.40, html5 player new
[youtube] {243} signature length 40.40, html5 player new
[youtube] {133} signature length 40.40, html5 player new
[youtube] {242} signature length 40.38, html5 player new
[youtube] {160} signature length 40.40, html5 player new
[youtube] {278} signature length 40.40, html5 player new
[youtube] {140} signature length 40.40, html5 player new
[youtube] {171} signature length 40.40, html5 player new
[youtube] {249} signature length 40.40, html5 player new
[youtube] {250} signature length 40.40, html5 player new
[youtube] {251} signature length 40.40, html5 player new
[youtube] 3W1M8lJEUdI: Downloading DASH manifest
WARNING: [youtube] 3W1M8lJEUdI: Skipping DASH manifest: ExtractorError(u'Could not download DASH manifest: 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; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.',)
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on u'https://r1---sn-cxaf0x-nuge.googlevideo.com/videoplayback?gcr=de&keepalive=yes&pcm2cms=yes&itag=299&requiressl=yes&key=yt5&expire=1442874703&gir=yes&ip=141.70.81.136&mm=31&mn=sn-cxaf0x-nuge&ms=au&mt=1442852964&sparams=clen%2Cdur%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&mv=m&id=o-AG8S1dHIx0ZyopKgSzgnWXDIirjBGEEk1XwoaBZxYBaL&mime=video%2Fmp4&pl=18&sver=3&upn=_WBb7PArLlU&ipbits=0&lmt=1442750840463455&fexp=9406006%2C9408710%2C9409069%2C9412776%2C9414732%2C9415090%2C9415365%2C9415485%2C9416023%2C9416126%2C9416329%2C9416611%2C9417707%2C9417930%2C9418153%2C9418184%2C9418204%2C9418393%2C9418448%2C9419444%2C9419501%2C9420348%2C9421013&source=youtube&initcwndbps=6993750&dur=1642.399&clen=1042097205&signature=E814868FD519CBD12ADEAFA53092C6842541BA.1C296F0FECED5E18E97F5EB21DFD628B9478E8E9&ratebypass=yes'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1429, in process_info
partial_success = dl(fname, new_info)
File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1377, in dl
return fd.download(name, info)
File "/usr/lib/python2.7/dist-packages/youtube_dl/downloader/common.py", line 342, in download
return self.real_download(filename, info_dict)
File "/usr/lib/python2.7/dist-packages/youtube_dl/downloader/http.py", line 59, in real_download
data = self.ydl.urlopen(request)
File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1730, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 475, in error
return self._call_chain(_args)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(_args)
File "/usr/lib/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Sep 21, 2015

@raychaudhuri-amitava
Copy link
Author

@raychaudhuri-amitava raychaudhuri-amitava commented Sep 21, 2015

@jaimeMF This is working after putting --playlist-reverse many thanks for the help.
Since its working with .netrc, i will be using the same. Initially i thought that its needed to pass the --age-limit 80. One of the file in the playlist is marked as adult so i had to put --age-limit 80. I wrongly assumed that in such case passing a youtube account is needed.
@Nidan I am closing this issue since the original problem is fixed after passing the correct option to youtube-dl.

On personal note: youtube-dl is the best tool to download audio/video from youtube. Many thanks for the same.

@Nidan
Copy link

@Nidan Nidan commented Sep 21, 2015

@raychaudhuri-amitava: that's fine, looks like my problem is debian being slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.