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

[InvestigationDiscovery] "This video is only available for registered users. You may want to use --cookies." #10421

Closed
10 of 11 tasks
MuncheeMunch opened this issue Jul 11, 2024 · 16 comments
Labels
patch-available There is patch available that should fix this issue. Someone needs to make a PR with it site-bug Issue with a specific website

Comments

@MuncheeMunch
Copy link

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

United States of America

Provide a description that is worded well enough to be understood

Hello! I'm trying to download a video from the Investigation Discovery website, but I get an error that the video is only available to registered users. This is confusing because the same video plays perfectly fine in my browser without requiring an account. I've tried multiple things, including using --cookies, --source-address, and setting the User-Agent header, but nothing works.

Here's the URL of the video I'm trying to download: https://www.investigationdiscovery.com/video/deadly-influence-the-social-media-murders-investigation-discovery-atve-us/rip-bianca

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

user1@debian:~/Desktop$ yt-dlp -vU -F -S "vbr,abr" "https://www.investigationdiscovery.com/video/deadly-influence-the-social-media-murders-investigation-discovery-atve-us/rip-bianca"
[debug] Command-line config: ['-vU', '-F', '-S', 'vbr,abr', 'https://www.investigationdiscovery.com/video/deadly-influence-the-social-media-murders-investigation-discovery-atve-us/rip-bianca']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] from yt-dlp/yt-dlp-nightly-builds [705f5b84d] (zip)
[debug] Python 3.11.2 (CPython x86_64 64bit) - Linux-6.1.0-22-amd64-x86_64-with-glibc2.36 (OpenSSL 3.0.13 30 Jan 2024, glibc 2.36)
[debug] exe versions: none
[debug] Optional libraries: certifi-2022.09.24, mutagen-1.46.0, requests-2.28.1, sqlite3-3.40.1, urllib3-1.26.12
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Loaded 1834 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: [email protected] from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp-nightly-builds)
[InvestigationDiscovery] Extracting URL: https://www.investigationdiscovery.com/video/deadly-influence-the-social-media-murders-investigation-discovery-atve-us/rip-bianca
[debug] Using fake IP 6.158.231.125 (US) as X-Forwarded-For
[InvestigationDiscovery] deadly-influence-the-social-media-murders-investigation-discovery-atve-us/rip-bianca: Downloading JSON metadata
ERROR: [InvestigationDiscovery] deadly-influence-the-social-media-murders-investigation-discovery-atve-us/rip-bianca: This video is only available for registered users. You may want to use --cookies.
  File "/home/user1/.local/bin/yt-dlp/yt_dlp/extractor/common.py", line 740, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user1/.local/bin/yt-dlp/yt_dlp/extractor/dplay.py", line 365, in _real_extract
    return self._get_disco_api_info(url, self._match_id(url), **self._DISCO_API_PARAMS)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user1/.local/bin/yt-dlp/yt_dlp/extractor/dplay.py", line 91, in _get_disco_api_info
    self._process_errors(e, geo_countries)
  File "/home/user1/.local/bin/yt-dlp/yt_dlp/extractor/dplay.py", line 48, in _process_errors
    raise ExtractorError(
@MuncheeMunch MuncheeMunch added site-bug Issue with a specific website triage Untriaged issue labels Jul 11, 2024
@MuncheeMunch MuncheeMunch changed the title InvestigationDiscovery – "This video is only available for registered users. You may want to use --cookies." [InvestigationDiscovery] "This video is only available for registered users. You may want to use --cookies." Jul 11, 2024
@bashonly
Copy link
Member

This fixes it:

diff --git a/yt_dlp/extractor/dplay.py b/yt_dlp/extractor/dplay.py
index 48eae1088..3110583b2 100644
--- a/yt_dlp/extractor/dplay.py
+++ b/yt_dlp/extractor/dplay.py
@@ -553,6 +553,13 @@ class InvestigationDiscoveryIE(DiscoveryPlusBaseIE):
         'country': 'us',
     }
 
+    def _update_disco_api_headers(self, headers, disco_base, display_id, realm):
+        headers.update({
+            'x-disco-params': f'realm={realm},siteLookupKey={self._PRODUCT}',
+            'x-disco-client': f'WEB:UNKNOWN:{self._PRODUCT}:27.43.0',
+            'Authorization': self._get_auth(disco_base, display_id, realm),
+        })
+
 
 class AmHistoryChannelIE(DiscoveryPlusBaseIE):
     _VALID_URL = r'https?://(?:www\.)?ahctv\.com/video' + DPlayBaseIE._PATH_REGEX

@bashonly bashonly added patch-available There is patch available that should fix this issue. Someone needs to make a PR with it and removed triage Untriaged issue labels Jul 11, 2024
@MuncheeMunch
Copy link
Author

The fix worked! Thank you!

Though I'm not sure how to add this to the official repo.

@MuncheeMunch

This comment was marked as duplicate.

1 similar comment
@MuncheeMunch
Copy link
Author

Darn it. Didn't mean to close this since it's still an active issue in the official repo.

@MuncheeMunch MuncheeMunch reopened this Jul 11, 2024
@cobhc2019
Copy link

Hi, having a similar issue here in GB. Videos work fine in my browser, but regardless of asking YT-DLP to request cookies from the browser or fetching the cookies myself I still get the "This video is only available for registered users. You may want to use --cookies." error. I have a paid account with Discovery+ and I'm trying to download non-free videos.

@bashonly
Copy link
Member

@cobhc2019 can you share complete verbose output, please? Add -vU to your command and copy/paste the entire output

@cobhc2019
Copy link

cobhc2019 commented Jul 11, 2024

@bashonly Please see below.

c:\Users\Stee\Downloads>yt-dlp --cookies-from-browser chrome https://www.discoveryplus.com/gb/video/wheeler-dealers/1976-mercury-capri-mk2 -vU
[debug] Command-line config: ['--cookies-from-browser', 'chrome', 'https://www.discoveryplus.com/gb/video/wheeler-dealers/1976-mercury-capri-mk2', '-vU']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] from yt-dlp/yt-dlp [7ead733] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1k 25 Mar 2021)
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.07.04, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.35.5, urllib3-2.2.2, websockets-12.0
[debug] Proxy map: {}
Extracting cookies from chrome
[debug] Extracting cookies from: "C:\Users\Stee\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies"
[debug] Found local state file at "C:\Users\Stee\AppData\Local\Google\Chrome\User Data\Local State"
Extracted 1209 cookies from chrome
[debug] cookie version breakdown: {'v10': 1343, 'other': 0, 'unencrypted': 8}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1834 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: [email protected] from yt-dlp/yt-dlp
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp)
[DiscoveryPlus] Extracting URL: https://www.discoveryplus.com/gb/video/wheeler-dealers/1976-mercury-capri-mk2
[debug] Using fake IP 6.136.89.117 (US) as X-Forwarded-For
[DiscoveryPlus] wheeler-dealers/1976-mercury-capri-mk2: Downloading JSON metadata
ERROR: [DiscoveryPlus] wheeler-dealers/1976-mercury-capri-mk2: This video is only available for registered users. You may want to use --cookies.
File "yt_dlp\extractor\common.py", line 740, in extract
File "yt_dlp\extractor\dplay.py", line 365, in _real_extract
File "yt_dlp\extractor\dplay.py", line 91, in _get_disco_api_info
File "yt_dlp\extractor\dplay.py", line 48, in _process_errors

@bashonly
Copy link
Member

bashonly commented Jul 11, 2024

@cobhc2019 was it working for you in the past? It looks like GB and DE DiscoveryPlus links have been plagued by #2361 for a while. Though now the error is different (HTTP Error 400 caught and raised as "login required" instead of HTTP Error 404), possibly because of the lack of a siteLookupKey param in the x-disco-params

@cobhc2019
Copy link

I've only just found out about yt_dlp, so no.

Thanks, I'll monitor things and see what happens.

@bashonly
Copy link
Member

bashonly commented Jul 11, 2024

@cobhc2019 I'm geo-blocked from DiscoveryPlus GB (and don't have a subscription), so I won't be able to work on that without assistance. If you're comfortable with sending me a HAR file of your browser's network requests while loading a video on the site, then I would have something to work from. I could walk you through how to do it.

If you're up for it, contact me on discord (same username) or via email, bashonly ( a t ) proton mail [d o t] com

@HiiJax
Copy link

HiiJax commented Jul 13, 2024

Anything happen behind the scenes here? I think I'm experiencing the same issue but with DiscoveryPlus CA. I tried using the patch but it didn't seem to work, though that could be user error. I added the patch @ line 556 of dplay.py, then compiled using the PyInstaller instructions.

./yt-dlp https://www.discoveryplus.com/ca/video/cake-wars-food-network-ca/dc-comics --cookies-from-browser firefox -vU
[debug] Command-line config: ['https://www.discoveryplus.com/ca/video/cake-wars-food-network-ca/dc-comics', '--cookies-from-browser', 'firefox', '-vU']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] from yt-dlp/yt-dlp [7ead7332a] (win_exe)
[debug] Python 3.10.6 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1n  15 Mar 2022)
[debug] exe versions: ffmpeg 2024-04-10-git-0e4dfa4709-full_build-www.gyan.dev (setts), ffprobe 2024-04-10-git-0e4dfa4709-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.07.04, mutagen-1.47.0, requests-2.32.3, sqlite3-3.37.2, urllib3-2.2.2, websockets-12.0
[debug] Proxy map: {}
Extracting cookies from firefox
[debug] Extracting cookies from: "C:\Users\(Redacted)\AppData\Roaming\Mozilla\Firefox\Profiles\uyhlspk7.(Redacted)\cookies.sqlite"
Extracted 1241 cookies from firefox
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1834 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: [email protected] from yt-dlp/yt-dlp
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp)
[DiscoveryPlus] Extracting URL: https://www.discoveryplus.com/ca/video/cake-wars-food-network-ca/dc-comics
[debug] Using fake IP 6.70.81.43 (US) as X-Forwarded-For
[DiscoveryPlus] cake-wars-food-network-ca/dc-comics: Downloading JSON metadata
ERROR: [DiscoveryPlus] cake-wars-food-network-ca/dc-comics: This video is only available for registered users. You may want to use --cookies.
  File "yt_dlp\extractor\common.py", line 740, in extract
  File "yt_dlp\extractor\dplay.py", line 365, in _real_extract
  File "yt_dlp\extractor\dplay.py", line 91, in _get_disco_api_info
  File "yt_dlp\extractor\dplay.py", line 48, in _process_errors

I'm up for sending a HAR file, or helping however I can. Just thought I'd check in here first rather than just sending an unexpected DM, especially if it might not be needed.

@bashonly
Copy link
Member

sure, go ahead and shoot me a DM

@bashonly
Copy link
Member

@cobhc2019 could you give this PR a try?

I've created pre-release builds for testing purposes:

yt-dlp --update-to bashonly/yt-dlp@dplay

@cobhc2019
Copy link

Yep, that works now. Thanks!

@bashonly
Copy link
Member

@cobhc2019 sorry to ask again, but I had to rewrite the PR somewhat due to a logic flaw. When you get a chance, could run yt-dlp --update-to bashonly/yt-dlp@dplay again to update to the latest patched build and give it another try?

@cobhc2019
Copy link

Yep, updated and still working fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch-available There is patch available that should fix this issue. Someone needs to make a PR with it site-bug Issue with a specific website
Projects
None yet
Development

No branches or pull requests

4 participants