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

youtube - HTTP Error 403: Forbidden #3415

Closed
galets opened this issue Aug 1, 2014 · 11 comments
Closed

youtube - HTTP Error 403: Forbidden #3415

galets opened this issue Aug 1, 2014 · 11 comments

Comments

@galets
Copy link

@galets galets commented Aug 1, 2014

Could be duplicate of #2806:

$ youtube-dl -v CGyEd0aKWZE
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'CGyEd0aKWZE']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.07.24
[debug] Python version 3.4.1 - Linux-3.15.5-2-ARCH-x86_64-with-arch
[debug] Proxy map: {}
[youtube] Setting language
[youtube] CGyEd0aKWZE: Downloading webpage
[youtube] CGyEd0aKWZE: Downloading video info webpage
[youtube] CGyEd0aKWZE: Extracting video information
[youtube] CGyEd0aKWZE: Encrypted signatures detected.
[youtube] encrypted signature length 84 (68.12.2), itag 22, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 43, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 18, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 5, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 36, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 17, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 88 (44.43), itag 137, html5 player en_US-vflEyBLiy/html5player
[youtube] CGyEd0aKWZE: Downloading js player vflEyBLiy
[youtube] encrypted signature length 88 (44.43), itag 136, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 88 (44.43), itag 135, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 88 (44.43), itag 134, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 88 (44.43), itag 133, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 88 (44.43), itag 160, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 88 (44.43), itag 140, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 88 (44.43), itag 171, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 137, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 136, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 135, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 134, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 133, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 160, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 140, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 171, html5 player en_US-vflEyBLiy/html5player
[debug] Invoking downloader on 'https://r8---sn-a5m7lnee.googlevideo.com/videoplayback?ratebypass=yes&ipbits=0&ms=au&expire=1406948448&key=yt5&ip=70.184.103.81&mws=yes&gcr=us&fexp=902408%2C927606%2C927622%2C930815%2C931983%2C934024%2C934030%2C945005%2C945241%2C946023%2C948510&mm=31&source=youtube&id=o-ABr_V4DTdAs1uVCyuJUw2GvafShukG38AL80B6saXPI0&upn=ytzpOFrqX7w&sparams=gcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&mt=1406926740&mv=m&sver=3&requiressl=yes&itag=22&signature=5B470B4F361452E2D17D3FDF0F86E7F26C34F398E2C0A306B300C37E7DE185918896CA5C92F0F7FE5'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 1022, in process_info
success = dl(filename, info_dict)
File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 998, in dl
return fd.download(name, info)
File "/usr/lib/python3.4/site-packages/youtube_dl/downloader/common.py", line 291, in download
return self.real_download(filename, info_dict)
File "/usr/lib/python3.4/site-packages/youtube_dl/downloader/http.py", line 58, in real_download
data = self.ydl.urlopen(request)
File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 1231, 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)
urllib.error.HTTPError: HTTP Error 403: Forbidden

@Tatsh
Copy link
Contributor

@Tatsh Tatsh commented Aug 2, 2014

Same here on another video:

$ youtube-dl -v -t '50-_oTkmF5I'                                                                                                                 
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-t', '50-_oTkmF5I']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.07.30
[debug] Python version 2.7.6 - Linux-3.12.21-gentoo-r1-x86_64-AMD_FX-tm-8150_Eight-Core_Processor-with-gentoo-2.2
[debug] Proxy map: {}
[youtube] Setting language
[youtube] 50-_oTkmF5I: Downloading webpage
[youtube] 50-_oTkmF5I: Downloading video info webpage
[youtube] 50-_oTkmF5I: Extracting video information
[youtube] 50-_oTkmF5I: Encrypted signatures detected.
[youtube] encrypted signature length 84 (68.12.2), itag 22, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 43, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 18, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 5, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 36, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 17, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 137, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 136, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 135, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 134, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 133, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 160, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 140, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 137, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 136, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 135, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 134, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 133, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 160, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 140, html5 player en_US-vflEyBLiy
[debug] Invoking downloader on u'https://r9---sn-o097zne6.googlevideo.com/videoplayback?sparams=gcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&requiressl=yes&id=o-AHdx5v8Q5cX7xcK3FICEIWXclYFYQlntM5MN1kr9DBbp&mv=m&initcwndbps=1984000&mt=1406947267&ms=au&gcr=us&ip=24.130.80.123&key=yt5&itag=22&mm=31&source=youtube&mws=yes&fexp=902408%2C918015%2C927622%2C934024%2C934030%2C935662%2C936106%2C938631%2C945539%2C946013&expire=1406968953&ratebypass=yes&ipbits=0&upn=BBMMR8Th1kQ&sver=3&signature=4647B0411800D63CA302BAE340B19D4F9D72A03EA39978F892DA682ACAEA35D793E530E54E0C8EEA1'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1022, in process_info
    success = dl(filename, info_dict)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 998, in dl
    return fd.download(name, info)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/downloader/common.py", line 291, in download
    return self.real_download(filename, info_dict)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/downloader/http.py", line 58, in real_download
    data = self.ydl.urlopen(request)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1231, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib64/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
@phihag
Copy link
Contributor

@phihag phihag commented Aug 2, 2014

Mmm, both work fine for me. Please post more URLs that exhibit this behavior for you.

@Tatsh note that -t has no meaning anymore.

@phihag
Copy link
Contributor

@phihag phihag commented Aug 2, 2014

If the problem persists for you: Does passing --no-cache-dir solve it?

@Tatsh
Copy link
Contributor

@Tatsh Tatsh commented Aug 2, 2014

--no-cache-dir solves it. Is there any way this can be automated?

@galets
Copy link
Author

@galets galets commented Aug 2, 2014

didn't solve it for me:

$ youtube-dl -v --no-cache-dir CGyEd0aKWZE
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '--no-cache-dir', 'CGyEd0aKWZE']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.07.24
[debug] Python version 3.4.1 - Linux-3.15.5-2-ARCH-x86_64-with-arch
[debug] Proxy map: {}
[youtube] Setting language
[youtube] CGyEd0aKWZE: Downloading webpage
[youtube] CGyEd0aKWZE: Downloading video info webpage
[youtube] CGyEd0aKWZE: Extracting video information
[youtube] CGyEd0aKWZE: Encrypted signatures detected.
[youtube] encrypted signature length 84 (68.12.2), itag 22, html5 player en_US-vflEyBLiy/html5player
[youtube] CGyEd0aKWZE: Downloading js player vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 43, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 18, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 5, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 36, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 17, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 137, html5 player en_US-vflEyBLiy/html5player
[youtube] CGyEd0aKWZE: Downloading js player vflEyBLiy
[youtube] encrypted signature length 87 (43.43), itag 248, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 136, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 247, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 135, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 244, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 245, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 246, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 134, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 243, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 133, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 242, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 160, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 140, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 87 (43.43), itag 171, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 137, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 248, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 136, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 247, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 135, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 244, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 245, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 246, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 134, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 243, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 133, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 242, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 160, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 140, html5 player en_US-vflEyBLiy/html5player
[youtube] encrypted signature length 84 (68.12.2), itag 171, html5 player en_US-vflEyBLiy/html5player
[debug] Invoking downloader on 'https://r8---sn-a5m7lnee.googlevideo.com/videoplayback?ip=70.184.103.81&key=yt5&mws=yes&ipbits=0&expire=1406981006&itag=22&sparams=gcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&gcr=us&sver=3&ratebypass=yes&mm=31&mt=1406959313&requiressl=yes&id=o-AFdizYL0PysJqSVGtlZLwAumnU6gLg4XuO1C4h_ZprlE&fexp=902408%2C902534%2C903903%2C908594%2C916608%2C927622%2C934024%2C934030%2C936110%2C941415%2C946013%2C950811&source=youtube&mv=m&upn=hYUSH_pKNpk&ms=au&signature=E28CC2C5030CD7756E1BFCBB915367B4EB64915C89154D886B13C6223E61446DBC891336BC446F98C'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 1022, in process_info
success = dl(filename, info_dict)
File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 998, in dl
return fd.download(name, info)
File "/usr/lib/python3.4/site-packages/youtube_dl/downloader/common.py", line 291, in download
return self.real_download(filename, info_dict)
File "/usr/lib/python3.4/site-packages/youtube_dl/downloader/http.py", line 58, in real_download
data = self.ydl.urlopen(request)
File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 1231, 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)
urllib.error.HTTPError: HTTP Error 403: Forbidden

@phihag
Copy link
Contributor

@phihag phihag commented Aug 2, 2014

@Tatsh Are you sure that's the effect of --no-cache-dir? Please try again without it to make sure that's at fault. If it is, we know where the error lies and will just fix it instead of "automating" --no-cache-dir.

@Tatsh
Copy link
Contributor

@Tatsh Tatsh commented Aug 2, 2014

That is the effect of --no-cache-dir. I just tried with the same video ID without the option and it failed with the same error as before. And then it works again with --no-cache-dir option passed.

$ youtube-dl -v  '50-_oTkmF5I'
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '50-_oTkmF5I']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.07.30
[debug] Python version 2.7.6 - Linux-3.12.21-gentoo-r1-x86_64-AMD_FX-tm-8150_Eight-Core_Processor-with-gentoo-2.2
[debug] Proxy map: {}
[youtube] Setting language
[youtube] 50-_oTkmF5I: Downloading webpage
[youtube] 50-_oTkmF5I: Downloading video info webpage
[youtube] 50-_oTkmF5I: Extracting video information
[youtube] 50-_oTkmF5I: Encrypted signatures detected.
[youtube] encrypted signature length 84 (68.12.2), itag 22, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 43, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 18, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 5, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 36, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 17, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 137, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 136, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 135, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 134, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 133, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 160, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (43.40), itag 140, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 137, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 136, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 135, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 134, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 133, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 160, html5 player en_US-vflEyBLiy
[youtube] encrypted signature length 84 (68.12.2), itag 140, html5 player en_US-vflEyBLiy
[debug] Invoking downloader on u'https://r9---sn-nwj7knez.googlevideo.com/videoplayback?requiressl=yes&ms=au&id=o-AF_7cbPvmCzxStVMQVO4OSZEOz9wiOeoqR54i-5ZjLNx&upn=ZC4_y1vu5VU&mv=m&source=youtube&mws=yes&sparams=gcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&mt=1406972488&initcwndbps=2063000&key=yt5&ip=24.130.80.123&itag=22&ipbits=0&sver=3&fexp=902408%2C916625%2C921912%2C927622%2C931983%2C934024%2C934030%2C935668%2C941415%2C946023&gcr=us&mm=31&ratebypass=yes&expire=1406994214&signature=C7CDFDD47F369948E2CF472F654C4B95C02B7FA2C7BAF7A9F529DFB41F236EBDEEB3FAC3ABA9C70C8'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1022, in process_info
    success = dl(filename, info_dict)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 998, in dl
    return fd.download(name, info)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/downloader/common.py", line 291, in download
    return self.real_download(filename, info_dict)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/downloader/http.py", line 58, in real_download
    data = self.ydl.urlopen(request)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1231, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib64/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
@Tatsh
Copy link
Contributor

@Tatsh Tatsh commented Aug 2, 2014

--- cache   2014-08-02 02:46:10.058406209 -0700
+++ no-cache    2014-08-02 02:45:54.317407316 -0700
@@ -1,6 +1,6 @@
 [debug] System config: []
 [debug] User config: []
-[debug] Command-line args: ['-v', '50-_oTkmF5I']
+[debug] Command-line args: ['-v', '50-_oTkmF5I', '--no-cache-dir']
 [debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8
 [debug] youtube-dl version 2014.07.30
 [debug] Python version 2.7.6 - Linux-3.12.21-gentoo-r1-x86_64-AMD_FX-tm-8150_Eight-Core_Processor-with-gentoo-2.2
@@ -11,18 +11,20 @@
 [youtube] 50-_oTkmF5I: Extracting video information
 [youtube] 50-_oTkmF5I: Encrypted signatures detected.
 [youtube] encrypted signature length 84 (68.12.2), itag 22, html5 player en_US-vflEyBLiy
+[youtube] 50-_oTkmF5I: Downloading js player vflEyBLiy
 [youtube] encrypted signature length 84 (68.12.2), itag 43, html5 player en_US-vflEyBLiy
 [youtube] encrypted signature length 84 (68.12.2), itag 18, html5 player en_US-vflEyBLiy
-[youtube] encrypted signature length 82 (66.12.2), itag 5, html5 player en_US-vflEyBLiy
+[youtube] encrypted signature length 84 (68.12.2), itag 5, html5 player en_US-vflEyBLiy
 [youtube] encrypted signature length 84 (68.12.2), itag 36, html5 player en_US-vflEyBLiy
 [youtube] encrypted signature length 84 (68.12.2), itag 17, html5 player en_US-vflEyBLiy
-[youtube] encrypted signature length 82 (41.40), itag 137, html5 player en_US-vflEyBLiy
-[youtube] encrypted signature length 82 (41.40), itag 136, html5 player en_US-vflEyBLiy
-[youtube] encrypted signature length 82 (41.40), itag 135, html5 player en_US-vflEyBLiy
-[youtube] encrypted signature length 82 (41.40), itag 134, html5 player en_US-vflEyBLiy
-[youtube] encrypted signature length 82 (41.40), itag 133, html5 player en_US-vflEyBLiy
-[youtube] encrypted signature length 82 (41.40), itag 160, html5 player en_US-vflEyBLiy
-[youtube] encrypted signature length 82 (41.40), itag 140, html5 player en_US-vflEyBLiy
+[youtube] encrypted signature length 86 (43.42), itag 137, html5 player en_US-vflEyBLiy
+[youtube] 50-_oTkmF5I: Downloading js player vflEyBLiy
+[youtube] encrypted signature length 86 (43.42), itag 136, html5 player en_US-vflEyBLiy
+[youtube] encrypted signature length 86 (43.42), itag 135, html5 player en_US-vflEyBLiy
+[youtube] encrypted signature length 86 (43.42), itag 134, html5 player en_US-vflEyBLiy
+[youtube] encrypted signature length 86 (43.42), itag 133, html5 player en_US-vflEyBLiy
+[youtube] encrypted signature length 86 (43.42), itag 160, html5 player en_US-vflEyBLiy
+[youtube] encrypted signature length 86 (43.42), itag 140, html5 player en_US-vflEyBLiy
 [youtube] encrypted signature length 84 (68.12.2), itag 137, html5 player en_US-vflEyBLiy
 [youtube] encrypted signature length 84 (68.12.2), itag 136, html5 player en_US-vflEyBLiy
 [youtube] encrypted signature length 84 (68.12.2), itag 135, html5 player en_US-vflEyBLiy
@@ -30,28 +32,6 @@
 [youtube] encrypted signature length 84 (68.12.2), itag 133, html5 player en_US-vflEyBLiy
 [youtube] encrypted signature length 84 (68.12.2), itag 160, html5 player en_US-vflEyBLiy
 [youtube] encrypted signature length 84 (68.12.2), itag 140, html5 player en_US-vflEyBLiy
-[debug] Invoking downloader on u'https://r9---sn-o097znek.googlevideo.com/videoplayback?fexp=902408%2C902904%2C905024%2C908595%2C927622%2C927898%2C934024%2C934030%2C946023%2C948110&id=o-AONPdDpNOsQPz5X_sF_NWHSEQZWjNmgLNEQmtja6Oiy9&key=yt5&upn=9NfbxH299j8&ms=au&requiressl=yes&ip=24.130.80.123&sver=3&itag=22&ratebypass=yes&mv=m&sparams=gcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&gcr=us&expire=1406994391&mm=31&source=youtube&mws=yes&mt=1406972724&initcwndbps=2043000&ipbits=0&signature=A77922A0E7425FF46D0B1AAAE0A976EE62EC9AD31547F64B5BA6193A5EF394F87CDE06CE414DEDE1E'
-ERROR: unable to download video data: HTTP Error 403: Forbidden
-Traceback (most recent call last):
-  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1022, in process_info
-    success = dl(filename, info_dict)
-  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 998, in dl
-    return fd.download(name, info)
-  File "/usr/lib64/python2.7/site-packages/youtube_dl/downloader/common.py", line 291, in download
-    return self.real_download(filename, info_dict)
-  File "/usr/lib64/python2.7/site-packages/youtube_dl/downloader/http.py", line 58, in real_download
-    data = self.ydl.urlopen(request)
-  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1231, in urlopen
-    return self._opener.open(req, timeout=self._socket_timeout)
-  File "/usr/lib64/python2.7/urllib2.py", line 410, in open
-    response = meth(req, response)
-  File "/usr/lib64/python2.7/urllib2.py", line 523, in http_response
-    'http', request, response, code, msg, hdrs)
-  File "/usr/lib64/python2.7/urllib2.py", line 448, in error
-    return self._call_chain(*args)
-  File "/usr/lib64/python2.7/urllib2.py", line 382, in _call_chain
-    result = func(*args)
-  File "/usr/lib64/python2.7/urllib2.py", line 531, in http_error_default
-    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
-HTTPError: HTTP Error 403: Forbidden
-
+[debug] Invoking downloader on u'https://r9---sn-o097znek.googlevideo.com/videoplayback?gcr=us&upn=MjqMoaug1ig&ms=au&sparams=gcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cpbr%2Cpfa%2Cpm_type%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&requiressl=yes&id=o-ALsBfUKNa6AMqqBiDRGDFDttrUVQWWJmK0e2NA5He--7&mws=yes&sver=3&pm_type=static&key=yt5&expire=1406994364&initcwndbps=2043000&mt=1406972724&mm=31&pbr=yes&ipbits=0&fexp=902408%2C908561%2C922525%2C924619%2C927622%2C934024%2C934030%2C940667%2C946008%2C948201&source=youtube&mv=m&ratebypass=yes&pfa=10s&ip=24.130.80.123&itag=22&signature=E95121117D344F61F081726580B1F6AF3E297D8A.E35A1272353EEE611C84F038EA9F295183E1A31E'
+[download] Destination: Becky G - Shower-50-_oTkmF5I.mp4
[download] 100% of 51.10MiB in 00:0774MiB/s ETA 00:007n ETA
@Tatsh
Copy link
Contributor

@Tatsh Tatsh commented Aug 2, 2014

@galets --no-cache-dir fixes for me for CGyEd0aKWZE video ID as well. Not passing the option makes it 403.

@phihag
Copy link
Contributor

@phihag phihag commented Aug 2, 2014

Thank you for the reports to both of you. The problem was that YouTube seems to have started to have multiple types of signatures with the same length. Since we used the length as an identifier, this meant that youtube-dl sometimes got the function for another signature type.

This should be fixed in youtube-dl 2014.08.02.

It looks like you both used a package manager to install youtube-dl (so a simple sudo youtube-dl -U won't work). You can use that package manager to update, but you may need to request a new version from the package maintainer.

I'd appreciate a confirmation that it works in youtube-dl 2014.08.02 (or not, then we'll reopen this issue once we get an output with the new version).

@phihag phihag closed this Aug 2, 2014
@galets
Copy link
Author

@galets galets commented Aug 2, 2014

I confirm that 2014.08.02 version downloads stream correctly

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.