fix: add new cookie value to bypass consent screen
This commit is contained in:
parent
369ac9323f
commit
d4a088d09f
1 changed files with 4 additions and 4 deletions
|
|
@ -83,7 +83,9 @@ class YTMusic(BrowsingMixin, SearchMixin, WatchMixin, ExploreMixin, LibraryMixin
|
||||||
self._session = requests.api
|
self._session = requests.api
|
||||||
|
|
||||||
self.proxies = proxies
|
self.proxies = proxies
|
||||||
self.cookies = {'CONSENT': 'YES+1'}
|
# see google cookie docs: https://policies.google.com/technologies/cookies
|
||||||
|
# value from https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/extractor/youtube.py#L502
|
||||||
|
self.cookies = {'SOCS': 'CAI'}
|
||||||
if self.auth is not None:
|
if self.auth is not None:
|
||||||
input_json = load_headers_file(self.auth)
|
input_json = load_headers_file(self.auth)
|
||||||
self.input_dict = CaseInsensitiveDict(input_json)
|
self.input_dict = CaseInsensitiveDict(input_json)
|
||||||
|
|
@ -130,8 +132,6 @@ class YTMusic(BrowsingMixin, SearchMixin, WatchMixin, ExploreMixin, LibraryMixin
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise Exception("Your cookie is missing the required value __Secure-3PAPISID")
|
raise Exception("Your cookie is missing the required value __Secure-3PAPISID")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _send_request(self, endpoint: str, body: Dict, additionalParams: str = "") -> Dict:
|
def _send_request(self, endpoint: str, body: Dict, additionalParams: str = "") -> Dict:
|
||||||
|
|
||||||
if self.is_oauth_auth:
|
if self.is_oauth_auth:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue