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

Udemy: HTTP Error 403: FORBIDDEN #13074

Closed
horusra opened this issue May 13, 2017 · 11 comments
Closed

Udemy: HTTP Error 403: FORBIDDEN #13074

horusra opened this issue May 13, 2017 · 11 comments

Comments

@horusra
Copy link

@horusra horusra commented May 13, 2017

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

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

  • I've verified and I assure that I'm running youtube-dl 2017.05.09

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

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

"C:\Program Files\MPV\youtube-dl.exe" --output "B:\CG\%(playlist)s\%(playlist)s_%(playlist_index)s_%(title)s.%(ext)s" --cookies "C:\Program Files\MPV\cookies.txt" --all-subs --embed-subs --verbose -f=bestvideo+bestaudio/best https://www.udemy.com/unity-5-lighting-fundamentals/
[debug] System config: []
[debug] User config: ['--no-mtime']
[debug] Custom config: []
[debug] Command-line args: ['--output', 'B:\\CG\\%(playlist)s\\%(playlist)s_%(playlist_index)s_%(title)s.%(ext)s', '--cookies', 'C:\\Program Files\\MPV\\cookies.txt', '--all-subs', '--embed-subs', '--verbose', '-f=bestvideo+bestaudio/best', 'https://www.udemy.com/unity-5-lighting-fundamentals/']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2017.05.09
[debug] Python version 3.4.4 - Windows-10-10.0.14393
[debug] exe versions: ffmpeg N-82117-gc117343, ffprobe N-79000-g66edd86, rtmpdump 2.3
[debug] Proxy map: {}
[udemy:course] unity-5-lighting-fundamentals: Downloading webpage
[udemy:course] 294: Downloading course curriculum
ERROR: Unable to download JSON metadata: HTTP Error 403: FORBIDDEN (caused by HTTPError()); 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 "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpup5muf90\build\youtube_dl\extractor\common.py", line 502, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpup5muf90\build\youtube_dl\YoutubeDL.py", line 2106, in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 470, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response
  File "C:\Python\Python34\lib\urllib\request.py", line 508, in error
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_default
...
<end of log>


Description of your issue, suggested solution and other information

Trying to download from Udemy, creditentials in cookies.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 13, 2017

Carefully read new issue template and provide all requested information.

@dstftw dstftw closed this May 13, 2017
@dstftw dstftw added the incomplete label May 13, 2017
@horusra
Copy link
Author

@horusra horusra commented May 13, 2017

same issue as:
#10881
and
#11202

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 13, 2017

This course is not free. Have you purchased it in the first place? How did you export cookies?

@dstftw dstftw removed the incomplete label May 13, 2017
@horusra
Copy link
Author

@horusra horusra commented May 13, 2017

of course I've bought it.
exported using this:
https://addons.mozilla.org/en-US/firefox/addon/export-cookies/

the cookies are fine

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 13, 2017

For any further investigations you must provide account credentials.

@dstftw dstftw reopened this May 13, 2017
@horusra
Copy link
Author

@horusra horusra commented May 13, 2017

You don't need any account credentials to test this, the same error occurs with free courses:
(Example)
https://www.udemy.com/learn-level-design-unity-basics-in-under-2-hours/

"C:\Program Files\MPV\youtube-dl.exe" --output "B:\CG\%(playlist)s\%(playlist)s_%(playlist_index)s_%(title)s.%(ext)s" --cookies "C:\Program Files\MPV\cookies.txt" --all-subs --embed-subs --verbose -f=bestvideo+bestaudio/best https://www.udemy.com/learn-level-design-unity-basics-in-under-2-hours/
[debug] System config: []
[debug] User config: ['--no-mtime']
[debug] Custom config: []
[debug] Command-line args: ['--output', 'B:\\CG\\%(playlist)s\\%(playlist)s_%(playlist_index)s_%(title)s.%(ext)s', '--cookies', 'C:\\Program Files\\MPV\\cookies.txt', '--all-subs', '--embed-subs', '--verbose', '-f=bestvideo+bestaudio/best', 'https://www.udemy.com/learn-level-design-unity-basics-in-under-2-hours/']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2017.05.09
[debug] Python version 3.4.4 - Windows-10-10.0.14393
[debug] exe versions: ffmpeg N-82117-gc117343, ffprobe N-79000-g66edd86, rtmpdump 2.3
[debug] Proxy map: {}
[udemy:course] learn-level-design-unity-basics-in-under-2-hours: Downloading webpage
[udemy:course] 269: Enrolling in the course
[udemy:course] 269: Downloading course curriculum
ERROR: Unable to download JSON metadata: HTTP Error 403: FORBIDDEN (caused by HTTPError()); 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 "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpup5muf90\build\youtube_dl\extractor\common.py", line 502, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpup5muf90\build\youtube_dl\YoutubeDL.py", line 2106, in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 470, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response
  File "C:\Python\Python34\lib\urllib\request.py", line 508, in error
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_default
@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 13, 2017

Most likely your cookie file is invalid.
Valid cookie:

> py -2.7 .\youtube_dl\__main__.py --cookies 'C:/Users/dst/Downloads/cookies.txt' https://www.udemy.com/learn-level-design-unity-basics-in-under-2-hours/
[udemy:course] learn-level-design-unity-basics-in-under-2-hours: Downloading webpage
[udemy:course] 1074250: Downloading course curriculum
[download] Downloading playlist: Learn Level Design: Unity Basics in Under 2 Hours
[udemy:course] playlist Learn Level Design: Unity Basics in Under 2 Hours: Collected 16 video ids (downloading 16 of them)
[download] Downloading video 1 of 16
[udemy] 6568718: Downloading webpage
[udemy] 6568718: Downloading lecture JSON
[download] Resuming download at byte 523264
[download] Destination: Welcome to the course!-7826436.mp4
[download]  26.1% of 3.82MiB at  1.31MiB/s ETA 00:02
ERROR: Interrupted by user

Empty cookie:

> py -2.7 .\youtube_dl\__main__.py --cookies 'C:/Users/dst/Downloads/cookies-empty.txt' https://www.udemy.com/learn-level-design-unity-basics-in-under-2-hours/
[udemy:course] learn-level-design-unity-basics-in-under-2-hours: Downloading webpage
[udemy:course] 269: Enrolling in the course
[udemy:course] 269: Downloading course curriculum
ERROR: Unable to download JSON metadata: HTTP Error 403: FORBIDDEN (caused by HTTPError()); 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.
@horusra
Copy link
Author

@horusra horusra commented May 13, 2017

can I ask what you used to export cookies?

@horusra
Copy link
Author

@horusra horusra commented May 13, 2017

I was using the same exact addon, but I also had a second cookie exporting addon, I had firefox setup using a custom privacy setting (even though the cookies were present at the time of export and were actually exported)

I removed both cookie exporters, reset firefox privacy settings, then installed the cookie exporter again, and now youtube-dl works. This is a weird thing but I guess it's not related to youtube-dl, though it would be great if it wasn't so picky with its specific taste in cookie format.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 13, 2017

It has nothing to do with cookie file format (the error is different in this case) but cookie file contents namely missing or expired cookies or so.

@ytdl-org ytdl-org locked and limited conversation to collaborators May 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.