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.43k stars 9.96k forks source link

Discovery.ca - Unauthorized 401 error when trying to download. #18312

Open level42ca opened 5 years ago

level42ca commented 5 years ago

Please follow the guide below


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

C:\bin\youtube-dl>youtube-dl https://www.discovery.ca/shows/vintage-tech-hunters/video?vid=1528929
[debug] System config: []
[debug] User config: [u'-v', u'-n', u'--ap-mso', u'Rogers', u'--ffmpeg-location', u'C:\\bin\\ffmpeg']
[debug] Custom config: []
[debug] Command-line args: [u'https://www.discovery.ca/shows/vintage-tech-hunters/video?vid=1528929']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2018.11.23
[debug] Python version 2.7.10 (CPython) - Windows-8-6.2.9200
[debug] exe versions: ffmpeg N-92528-g90ac0e5f29, ffprobe N-92528-g90ac0e5f29
[debug] Proxy map: {}
[debug] Using fake IP 99.237.190.158 (CA) as X-Forwarded-For.
[9c9media] 1528929: Downloading JSON metadata
[9c9media] 1528929: Downloading JSON metadata
[9c9media] 1528929: Downloading m3u8 information
WARNING: Failed to download m3u8 information: HTTP Error 401: Unauthorized
[9c9media] 1528929: Downloading f4m manifest
WARNING: Unable to download f4m manifest: HTTP Error 401: Unauthorized
[9c9media] 1528929: Downloading MPD manifest
WARNING: Failed to download MPD manifest: HTTP Error 401: Unauthorized
ERROR: No video formats found; 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.
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 792, in extract_info
    ie_result = ie.extract(url)
  File "c:\python27\lib\site-packages\youtube_dl\extractor\common.py", line 508, in extract
    ie_result = self._real_extract(url)
  File "c:\python27\lib\site-packages\youtube_dl\extractor\ninecninemedia.py", line 52, in _real_extract
    self._sort_formats(formats)
  File "c:\python27\lib\site-packages\youtube_dl\extractor\common.py", line 1292, in _sort_formats
    raise ExtractorError('No video formats found')
ExtractorError: No video formats found; 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.

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


Description of your issue, suggested solution and other information

I'm receiving an Unauthorized error when trying to download a video from Discovery.ca. I'm not exactly sure why. I see that Discovery is a supported extractor (perhaps .com only and not .ca?)

I have tested my .netrc file, by downloading a video from another site, that requires the same authentication, and I've tested to confirm that I can login to the browser and play the video in it's entirety.

Hoping someone can shed some light here. Much appreciated. Thanks!

level42ca commented 4 years ago

Was anyone able to assist here? Almost a year later, and I still have the same issue.

RingoTheDog commented 4 years ago

Getting different error...but maybe the same issue?

youtube-dl.py -v "https://www.discovery.ca/Animal-Planet/Watson/video?vid=1938574" [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['-v', 'https://www.discovery.ca/Animal-Planet/Watson/video?vid=1938574'] [debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252 [debug] youtube-dl version 2020.03.24 [debug] Python version 3.6.3 (CPython) - Windows-10-10.0.18362-SP0 [debug] exe versions: ffmpeg N-91158-g63c4a4b0d6, ffprobe N-71346-gdf4fca2 [debug] Proxy map: {} [debug] Using fake IP 99.234.142.165 (CA) as X-Forwarded-For. [9c9media] 1938574: Downloading JSON metadata ERROR: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); 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:\GetTV\youtube-dl.py\youtube_dl\extractor\common.py", line 627, in _request_webpage return self._downloader.urlopen(url_or_request) File "C:\GetTV\youtube-dl.py\youtube_dl\YoutubeDL.py", line 2238, in urlopen return self._opener.open(req, timeout=self._socket_timeout) File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 532, in open response = meth(req, response) File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 642, in http_response 'http', request, response, code, msg, hdrs) File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 570, in error return self._call_chain(args) File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 504, in _call_chain result = func(args) File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 650, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp)

`

dirkf commented 1 year ago

With XFF .ca IP address, these URLs are matched by yt-dl and yt-dlp but the metadata JSON from 9C9Media is 404.