blackjack4494 / yt-dlc

media downloader and library for various sites.
The Unlicense
2.89k stars 364 forks source link

get 403 while downloading infoq video #247

Closed yxd0018 closed 3 years ago

yxd0018 commented 3 years ago

Use chrome toolbox to get media link https://videoh.infoq.com/presentations/20-oct-failingover.mp4 from page https://www.infoq.com/presentations/stpa. However, ytdlc get HTTPError 403: 'Forbidden'. Did I do anything wrong?

logs

ytdlc https://videoh.infoq.com/presentations/20-oct-failingover.mp4
[debug] System config: []
[debug] User config: ['-v', '--no-mtime', '-o', 'd:/temp/download/%(title)s.%(ext)s']
[debug] Custom config: []
[debug] Command-line args: ['https://videoh.infoq.com/presentations/20-oct-failingover.mp4']
[debug] Loading archive file None
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dlc version 2020.11.11-3
[debug] Python version 3.7.0 (CPython) - Windows-10-10.0.19041-SP0
[debug] exe versions: ffmpeg git-2019-10-06-66d45af, ffprobe git-2019-10-06-66d45af
[debug] Proxy map: {}
[generic] 20-oct-failingover: Requesting header
WARNING: Could not send HEAD request to https://videoh.infoq.com/presentations/20-oct-failingover.mp4: HT P Error 403: Forbidden
[generic] 20-oct-failingover: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>); pl ase report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest ver ion; see https://github.com/blackjack4494/yt-dlc on how to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.
File "c:\programdata\anaconda3\lib\site-packages\youtube_dlc\extractor\common.py", line 632, in _reques _webpage
return self._downloader.urlopen(url_or_request)
File "c:\programdata\anaconda3\lib\site-packages\youtube_dlc\YoutubeDL.py", line 2316, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "c:\programdata\anaconda3\lib\urllib\request.py", line 531, in open
response = meth(req, response)
File "c:\programdata\anaconda3\lib\urllib\request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "c:\programdata\anaconda3\lib\urllib\request.py", line 569, in error
return self._call_chain(args)
File "c:\programdata\anaconda3\lib\urllib\request.py", line 503, in _call_chain
result = func(
args)
File "c:\programdata\anaconda3\lib\urllib\request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)

rebane2001 commented 3 years ago

The error is:

Missing Key-Pair-Id query parameter or cookie value

Try loading a cookies.txt and see if it helps

yxd0018 commented 3 years ago

I use the cookies.txt extension of chrome to export the cookies, but the error is exactly the same.
Q1 are you able to download the video with cookie? Q2 do you debug to see the key-pair error msg?

october262 commented 3 years ago

I use the cookies.txt extension of chrome to export the cookies, but the error is exactly the same. Q1 are you able to download the video with cookie? Q2 do you debug to see the key-pair error msg?

if you need the video, it is available on youtube - https://www.youtube.com/watch?v=R3_ccsuPoD8

yxd0018 commented 3 years ago

I use the cookies.txt extension of chrome to export the cookies, but the error is exactly the same. Q1 are you able to download the video with cookie? Q2 do you debug to see the key-pair error msg?

if you need the video, it is available on youtube - https://www.youtube.com/watch?v=R3_ccsuPoD8

Thanks a lot. And I still need to learn how to use ytdlc out of infoQ

samoht0 commented 3 years ago

Try this patch and report back, if it fixed your issue: https://github.com/ytdl-org/youtube-dl/commit/a1c88c4819233cf5f3734bcd6cf251d4339196ce

yxd0018 commented 3 years ago

Try this patch and report back, if it fixed your issue: ytdl-org/youtube-dl@a1c88c4

I applied the diff in the installed package file and get the same error. Even changing the "videof" in the changelist to "videoh" in my video doesn't help. I ran the local copy code which is on win10 via "python -m youtube_dl --cookies ....". Should I ask in the youtube-dl repo? Glad it came back 5 days ago.

october262 commented 3 years ago

SOLVED !! > youtube-dlc --referer https://www.infoq.com/ https://www.infoq.com/presentations/stpa/

pukkandan commented 3 years ago

youtube-dlc --referer https://www.infoq.com/ https://www.infoq.com/presentations/stpa/

This works

With https://github.com/ytdl-org/youtube-dl/commit/a1c88c4819233cf5f3734bcd6cf251d4339196ce applied, youtube-dlc https://www.infoq.com/presentations/stpa/ also works.

Providing the direct URL doesnot work in either case