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.89k stars 10k forks source link

[udemy] FORBIDDEN lecture JSON metadata on a fully free course #14774

Closed rautamiekka closed 6 years ago

rautamiekka commented 6 years ago

Please follow the guide below


Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.11.15. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

Before submitting an issue make sure you have:

What is the purpose of your issue?


The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

Using bestvideo+bestaudio/best:

C:\Users\jaervinen\Desktop>"python.exe" "G:\_DOWNLOADS_\youtube-dl.pyc" --ignore-config --verbose --verbose --ignore-errors --no-mark-watched --format "bestvideo+bestaudio/best" --audio-format best --audio-quality 0 --ffmpeg-location "C:/Users/Public/Downloads/ffmpeg/bin/" --output "C:\Users\jaervinen\Desktop\_YouTube_/%(uploader_id)s"/"%(title)s %(resolution)s #%(id)s#.%(ext)s" -x --no-playlist --console-title --no-mtime --buffer-size 10M --retries infinite --continue --no-overwrites --fragment-retries infinite "https://www.udemy.com/free-learn-c-tutorial-beginners/learn/v4/t/lecture/1348876"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--ignore-config', '--verbose', '--verbose', '--ignore-errors', '--no-mark-watched', '--format', 'bestvideo+bestaudio/best', '--audio-format', 'best', '--audio-quality', '0', '--ffmpeg-location', 'C:/Users/Public/Downloads/ffmpeg/bin/', '--output', 'C:\\Users\\jaervinen\\Desktop\\_YouTube_/%(uploader_id)s/%(title)s %(resolution)s #%(id)s#.%(ext)s', '-x', '--no-playlist', '--console-title', '--no-mtime', '--buffer-size', '10M', '--retries', 'infinite', '--continue', '--no-overwrites', '--fragment-retries', 'infinite', 'https://www.udemy.com/free-learn-c-tutorial-beginners/learn/v4/t/lecture/1348876']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2017.11.15
[debug] Python version 3.6.3 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-87257-g8e17cd2, ffprobe N-87257-g8e17cd2
[debug] Proxy map: {}
[udemy] 1348876: Downloading webpage
[udemy] 1348876: Downloading lecture JSON
[udemy] 288: Enrolling in the course
[udemy] 1348876: 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "G:\_DOWNLOADS_\youtube-dl.pyc\youtube_dl\extractor\common.py", line 506, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "G:\_DOWNLOADS_\youtube-dl.pyc\youtube_dl\YoutubeDL.py", line 2196, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 532, in open
    response = meth(req, response)
  File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 570, in error
    return self._call_chain(*args)
  File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)

Using best (command copypasted from above with the change into a new Command Prompt):

G:\>"python.exe" "G:\_DOWNLOADS_\youtube-dl.pyc" --ignore-config --verbose --verbose --ignore-errors --no-mark-watched --format "best" --audio-format best --audio-quality 0 --ffmpeg-location "C:/Users/Public/Downloads/ffmpeg/bin/" --output "C:\Users\jaervinen\Desktop\_YouTube_/%(uploader_id)s"/"%(title)s %(resolution)s #%(id)s#.%(ext)s" -x --no-playlist --console-title --no-mtime --buffer-size 10M --retries infinite --continue --no-overwrites --fragment-retries infinite "https://www.udemy.com/free-learn-c-tutorial-beginners/learn/v4/t/lecture/1348876"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--ignore-config', '--verbose', '--verbose', '--ignore-errors', '--no-mark-watched', '--format', 'best', '--audio-format', 'best', '--audio-quality', '0', '--ffmpeg-location', 'C:/Users/Public/Downloads/ffmpeg/bin/', '--output', 'C:\\Users\\jaervinen\\Desktop\\_YouTube_/%(uploader_id)s/%(title)s %(resolution)s #%(id)s#.%(ext)s', '-x', '--no-playlist', '--console-title', '--no-mtime', '--buffer-size', '10M', '--retries', 'infinite', '--continue', '--no-overwrites', '--fragment-retries', 'infinite', 'https://www.udemy.com/free-learn-c-tutorial-beginners/learn/v4/t/lecture/1348876']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2017.11.15
[debug] Python version 3.6.3 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-87257-g8e17cd2, ffprobe N-87257-g8e17cd2
[debug] Proxy map: {}
[udemy] 1348876: Downloading webpage
[udemy] 1348876: Downloading lecture JSON
[udemy] 288: Enrolling in the course
[udemy] 1348876: 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "G:\_DOWNLOADS_\youtube-dl.pyc\youtube_dl\extractor\common.py", line 506, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "G:\_DOWNLOADS_\youtube-dl.pyc\youtube_dl\YoutubeDL.py", line 2196, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 532, in open
    response = meth(req, response)
  File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 570, in error
    return self._call_chain(*args)
  File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)

Description of your issue, suggested solution and other information

The lecture JSON metadata fetching fails due to FORBIDDEN error although the course is fully free, not discounted.

dstftw commented 6 years ago

You did not provide account credentials.

rautamiekka commented 6 years ago

Confirmed it needs the --username and --password. I were only assuming youtube-dl can do it without.

dstftw commented 6 years ago

It's technically impossible to do this without valid credentials.