]> jfr.im git - yt-dlp.git/commitdiff
[extractor/twitch] Update `_CLIENT_ID` and add extractor-arg (#7200)
authorbashonly <redacted>
Fri, 2 Jun 2023 13:39:24 +0000 (08:39 -0500)
committerGitHub <redacted>
Fri, 2 Jun 2023 13:39:24 +0000 (13:39 +0000)
Closes #7058, Closes #7183
Authored by: bashonly

README.md
yt_dlp/extractor/twitch.py

index 25ed3b844180f60ece94e3d7ae7673d4e941abaa..3d89c0af948aa52d32ef5c4bd0114ce2d7e7a944 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1846,6 +1846,9 @@ #### twitter
 ### wrestleuniverse
 * `device_id`: UUID value assigned by the website and used to enforce device limits for paid livestream content. Can be found in browser local storage
 
+#### twitchstream (Twitch)
+* `client_id`: Client ID value to be sent with GraphQL requests, e.g. `twitchstream:client_id=kimne78kx3ncx6brgo4mv6wki5h1ko`
+
 **Note**: These options may be changed/removed in the future without concern for backward compatibility
 
 <!-- MANPAGE: MOVE "INSTALLATION" SECTION HERE -->
index 4a17d80489a38a5495cb31b15c028dd46d1e42cc..31b349bc681ede6fc1897a6bf7182b622a5c01ec 100644 (file)
@@ -41,7 +41,6 @@ class TwitchBaseIE(InfoExtractor):
     _USHER_BASE = 'https://usher.ttvnw.net'
     _LOGIN_FORM_URL = 'https://www.twitch.tv/login'
     _LOGIN_POST_URL = 'https://passport.twitch.tv/login'
-    _CLIENT_ID = 'kimne78kx3ncx6brgo4mv6wki5h1ko'
     _NETRC_MACHINE = 'twitch'
 
     _OPERATION_HASHES = {
@@ -58,6 +57,11 @@ class TwitchBaseIE(InfoExtractor):
         'VideoPlayer_VODSeekbarPreviewVideo': '07e99e4d56c5a7c67117a154777b0baf85a5ffefa393b213f4bc712ccaf85dd6',
     }
 
+    @property
+    def _CLIENT_ID(self):
+        return self._configuration_arg(
+            'client_id', ['ue6666qo983tsx6so1t0vnawi233wa'], ie_key=TwitchStreamIE, casesense=True)[0]
+
     def _perform_login(self, username, password):
         def fail(message):
             raise ExtractorError(