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
131.66k stars 9.97k forks source link

HTTP Error 403: Forbidden - Udemy.com (knowband-asset-bucket.s3.amazonaws.com) #28889

Closed petr-hybler closed 3 years ago

petr-hybler commented 3 years ago

Checklist

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://udemy.com/apache-kafka/', '--cookies', './../cookies.txt', '--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.04.26
[debug] Python version 3.8.5 (CPython) - Linux-5.4.0-72-generic-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4, rtmpdump 2.4
[debug] Proxy map: {}
[udemy:course] apache-kafka: Downloading webpage
[udemy:course] 1075642: Downloading course curriculum
[download] Downloading playlist: 1075642
[udemy:course] playlist 1075642: Collected 105 video ids (downloading 105 of them)
[download] Downloading video 1 of 105
[udemy] 17914080: Downloading webpage
[udemy] 17914080: Downloading lecture JSON
[udemy] 22225008: Downloading m3u8 information
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://www.udemy.com/assets/22225008/files/1075642/22225008/2020-02-06_15-42-08-27c435626aaf495fbb52ce9b3f93ac74/1/hls/AVC_1920x1080_3200k_AAC-HE_64k/aa00ae381d9a76bb4daffc89b220dcfea49e.m3u8?provider=verizon&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MTk1MzM2NDEsInBhdGgiOiIxMDc1NjQyLzIyMjI1MDA4LzIwMjAtMDItMDZfMTUtNDItMDgtMjdjNDM1NjI2YWFmNDk1ZmJiNTJjZTliM2Y5M2FjNzQvMS8ifQ.ypWR0qtYZk8XW5FhaASLhBZsdhGQ4JoMJl0ZCgM9o8s&v=1'
[download] Welcome!-22225008.mp4 has already been downloaded
[download] 100% of 52.01MiB
[debug] ffmpeg command line: ffprobe -show_streams 'file:Welcome!-22225008.mp4'
[ffmpeg] Fixing malformed AAC bitstream in "Welcome!-22225008.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Welcome!-22225008.mp4' -c copy -f mp4 -bsf:a aac_adtstoasc 'file:Welcome!-22225008.temp.mp4'
[download] Downloading video 2 of 105
[udemy] 11566808: Downloading webpage
[udemy] 11566808: Downloading lecture JSON
[udemy] 14034832: Downloading m3u8 information
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://www.udemy.com/assets/14034832/files/1075642/14034832/2018-08-29_11-05-34-e7c65abffab1cb017f22af991958f7db/1/hls/AVC_1920x1080_800k_AAC-HE_64k/aa007d692b577d0b6da997e43dfeaa043785.m3u8?provider=verizon&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MTk1MzM2NDIsInBhdGgiOiIxMDc1NjQyLzE0MDM0ODMyLzIwMTgtMDgtMjlfMTEtMDUtMzQtZTdjNjVhYmZmYWIxY2IwMTdmMjJhZjk5MTk1OGY3ZGIvMS8ifQ.LVUXxKKS-cS1LGzeThy_azp0eRrZX95pRepPvlO_BkQ&v=1'
[download] Apache Kafka in 5 minutes-14034832.mp4 has already been downloaded
[download] 100% of 14.50MiB
[debug] ffmpeg command line: ffprobe -show_streams 'file:Apache Kafka in 5 minutes-14034832.mp4'
[ffmpeg] Fixing malformed AAC bitstream in "Apache Kafka in 5 minutes-14034832.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Apache Kafka in 5 minutes-14034832.mp4' -c copy -f mp4 -bsf:a aac_adtstoasc 'file:Apache Kafka in 5 minutes-14034832.temp.mp4'
[download] Downloading video 3 of 105
[udemy] 11566812: Downloading webpage
[udemy] 11566812: Downloading lecture JSON
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://knowband-asset-bucket.s3.amazonaws.com/2018-08-29_16-04-12-ae6b7673597decbf3d04ffdb0f94a9bf/WebHD_720p.mp4'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/YoutubeDL.py", line 1967, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/YoutubeDL.py", line 1906, in dl
    return fd.download(name, info)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/downloader/http.py", line 351, in real_download
    establish_connection()
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/downloader/http.py", line 116, in establish_connection
    raise err
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/downloader/http.py", line 110, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/YoutubeDL.py", line 2279, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Description

I have been facing this issue recently that whatever course from udemy I am downloading.. it always downloads a first few vids and that crashes with 403: Forbidden ...

I tried to run the youtube-dl as simply as:

youtube-dl https://udemy.com/apache-kafka/ --cookies ./../cookies.txt --verbose

but still no luck ... what I noticed is that first files reside in udemy.com and the failing one is in knowband-asset-bucket.s3.amazonaws.com ... could that be the problem?

another course having the same issue

https://udemy.com/microservices-with-node-js-and-react

ghost commented 3 years ago

UDemy has changed their videos. They are now DRM protected. It's pretty much useless. They started doing this about Mid March 2021 :(. They are going to lose a few hundred dollars from me each month now.

petr-hybler commented 3 years ago

that sux ... any idea on if this could be bypassed? or that'd be a legal issue so no fix in sight?