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

Discovery: "Access to the requested resource path is unauthorized" #20422

Closed
besweeet opened this issue Mar 20, 2019 · 2 comments
Closed

Discovery: "Access to the requested resource path is unauthorized" #20422

besweeet opened this issue Mar 20, 2019 · 2 comments

Comments

@besweeet
Copy link

@besweeet besweeet commented Mar 20, 2019

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 this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2019.03.18. 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 2019.03.18

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

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 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 ```):

youtube-dl.exe -f best[height=720] https://www.discovery.com/tv-shows/american-chopper/full-episodes/strikes-and-reverse-trikes --cookies cookies.txt -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-f', 'best[height=720]', 'https://www.discovery.com/tv-shows/american-chopper/full-episodes/strikes-and-reverse-trikes', '--cookies', 'cookies.txt', '-v']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2019.03.18
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.15063
[debug] exe versions: ffmpeg N-92179-gc27c7b49dc, ffprobe N-92179-gc27c7b49dc
[debug] Proxy map: {}
[Discovery] strikes-and-reverse-trikes: Downloading webpage
[Discovery] strikes-and-reverse-trikes: Downloading JSON metadata
ERROR: Access to the requested resource path is unauthorized: v1/streaming/video/5c9100216b66d145a86d13ce [The access token provided has expired]; 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.
Traceback (most recent call last):
  File "common.py", line 626, in _request_webpage
  File "YoutubeDL.py", line 2225, in urlopen
  File "\request.py", line 470, in open
  File "\request.py", line 580, in http_response
  File "\request.py", line 508, in error
  File "\request.py", line 442, in _call_chain
  File "\request.py", line 588, in http_error_default
urllib.error.HTTPError: HTTP Error 401: Unauthorized

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "discovery.py", line 102, in _real_extract
  File "common.py", line 891, in _download_json
  File "common.py", line 869, in _download_json_handle
  File "common.py", line 659, in _download_webpage_handle
  File "common.py", line 644, in _request_webpage
youtube_dl.utils.ExtractorError: Unable to download JSON metadata: HTTP Error 401: Unauthorized (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.
Traceback (most recent call last):
  File "common.py", line 626, in _request_webpage
  File "YoutubeDL.py", line 2225, in urlopen
  File "\request.py", line 470, in open
  File "\request.py", line 580, in http_response
  File "\request.py", line 508, in error
  File "\request.py", line 442, in _call_chain
  File "\request.py", line 588, in http_error_default
urllib.error.HTTPError: HTTP Error 401: Unauthorized

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "discovery.py", line 102, in _real_extract
  File "common.py", line 891, in _download_json
  File "common.py", line 869, in _download_json_handle
  File "common.py", line 659, in _download_webpage_handle
  File "common.py", line 644, in _request_webpage
youtube_dl.utils.ExtractorError: Unable to download JSON metadata: HTTP Error 401: Unauthorized (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.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "YoutubeDL.py", line 794, in extract_info
  File "common.py", line 529, in extract
  File "discovery.py", line 113, in _real_extract
youtube_dl.utils.ExtractorError: Access to the requested resource path is unauthorized: v1/streaming/video/5c9100216b66d145a86d13ce [The access token provided has expired]; 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.
...
<end of log>

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

Without -v, the error I receive is:

ERROR: Access to the requested resource path is unauthorized: v1/streaming/video/5c9100216b66d145a86d13ce [The access token provided has expired]

The video plays fine in Chrome. M3U8 playlists are pulled in fine, too. Those can't be used for the same error.

@Mr-Jake
Copy link

@Mr-Jake Mr-Jake commented Mar 22, 2019

I tried your link and it works for me.

[Discovery] strikes-and-reverse-trikes: Downloading webpage
[Discovery] strikes-and-reverse-trikes: Downloading JSON metadata
[Discovery] strikes-and-reverse-trikes: Downloading m3u8 information
[info] Available formats for 5c9100216b66d145a86d13ce:
format code extension resolution note
hls-63 mp4 96x54 63k , avc1.42000a, 6.0fps, mp4a.40.5
hls-134 mp4 192x108 134k , avc1.42000b, 15.0fps, mp4a.40.5
hls-244 mp4 288x162 244k , avc1.42000c, 15.0fps, mp4a.40.5
hls-451 mp4 448x252 451k , avc1.420015, 30.0fps, mp4a.40.5
hls-760 mp4 768x432 760k , avc1.4d001e, 30.0fps, mp4a.40.5
hls-1210 mp4 992x558 1210k , avc1.4d001f, 30.0fps, mp4a.40.5
hls-1889 mp4 1088x612 1889k , avc1.4d001f, 30.0fps, mp4a.40.5
hls-3304 mp4 1280x720 3304k , avc1.64001f, 30.0fps, mp4a.40.5
hls-5207 mp4 1920x1080 5207k , avc1.640028, 30.0fps, mp4a.40.5 (best)

The most likely issue would be your cookie file. I find the Discovery Network sites have a very short cookie life and they are only valid for an hour or less. When I use youtube-dl I have to constantly generate a new cookie.txt.

@besweeet
Copy link
Author

@besweeet besweeet commented Mar 22, 2019

I tried your link and it works for me.

I actually think it's the network I was trying it on as there's some extra security involved. I've had some SSL issues with other websites. Tried it on a different connection and it's downloading as expected.

@besweeet besweeet closed this Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.