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

ERROR: Unable to download JSON metadata: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>) #25656

Closed starx closed 4 years ago

starx commented 4 years ago

Checklist

I'm reporting a broken site support issue

Verbose log

Below is the verbose log. It continues to do the same for all the videos.

[debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['--verbose', '--download-archive', 'downloaded.txt', '--cookies', 'cookies.txt', '-f', 'bestvideo+bestaudio/best', '-i', '-o', 'udemy/%(playlist)s/%(chapter_number)s-%(chapter)s/%(title)s.%(ext)s', '--write-description', 'https://www.udemy.com/course/link'] [debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8 [debug] youtube-dl version 2020.06.06 [debug] Python version 3.8.3 (CPython) - Linux-4.15.0-106-generic-x86_64-with [debug] exe versions: ffmpeg 4.2.3, ffprobe 4.2.3 [debug] Proxy map: {} [udemy:course] course: Downloading webpage [udemy:course] 648826: Downloading course curriculum [download] Downloading playlist: 648826 [udemy:course] playlist 648826: Collected 318 video ids (downloading 318 of them) [download] Downloading video 1 of 318 [udemy] 4281754: Downloading webpage [udemy] 4281754: Downloading lecture JSON [udemy] 4281754: Downloading lecture JSON ERROR: Unable to download JSON metadata: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>); 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.8/site-packages/youtube_dl/extractor/common.py", line 627, in _request_webpage return self._downloader.urlopen(url_or_request) File "/usr/local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2238, in urlopen return self._opener.open(req, timeout=self._socket_timeout) File "/usr/local/lib/python3.8/urllib/request.py", line 531, in open response = meth(req, response) File "/usr/local/lib/python3.8/urllib/request.py", line 640, in http_response response = self.parent.error( File "/usr/local/lib/python3.8/urllib/request.py", line 569, in error return self._call_chain(args) File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(args) File "/usr/local/lib/python3.8/urllib/request.py", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp)

starx commented 4 years ago

Removing the /course/ from the links seems to be working.

More: #22306

harshluthra commented 4 years ago

Hey can you help me with this same issue? check out this link which shows the error https://drive.google.com/file/d/1SHcfS-S7XqlRuqqQkhZ3sSGMVkw6Z2ay/view?usp=sharing

GwamakaCharles commented 2 years ago

TESTED ON A MAC OS

  1. Install youtube-dl through brew install youtube-dl. If you used curl, you can remove it through rm -rf /usr/local/bin/youtube-dl.
  2. If you face symlink permissions ERRORS, run sudo chown -R $(whoami) $(brew --prefix)/* then brew doctor and fix each error according to the instructions.
  3. brew cleanup
  4. brew link youtube-dl
  5. cd . (navigate to your favorable location that you wish to put your videos folder)
  6. Login to udemy and get site cookies text file. I used Get Cookies.txt.
  7. mkdir MyVideos. (name it as you wish)
  8. youtube-dl --cookies udemy.com_cookies.txt -o '~/MyVideos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/<course-name>
  9. Done! 🎮