Make (x-)origin header backwards-compatible to avoid breaking existing headers files (#87)
This commit is contained in:
parent
c93f66471c
commit
6405bec93f
1 changed files with 5 additions and 5 deletions
|
|
@ -103,8 +103,8 @@ class YTMusic(BrowsingMixin, WatchMixin, LibraryMixin, PlaylistsMixin, UploadsMi
|
|||
def _send_request(self, endpoint: str, body: Dict, additionalParams: str = "") -> Dict:
|
||||
body.update(self.context)
|
||||
if self.auth:
|
||||
self.headers["Authorization"] = get_authorization(self.sapisid + ' '
|
||||
+ self.headers['origin'])
|
||||
origin = self.headers.get('origin', self.headers.get('x-origin'))
|
||||
self.headers["Authorization"] = get_authorization(self.sapisid + ' ' + origin)
|
||||
response = requests.post(base_url + endpoint + params + additionalParams,
|
||||
json=body,
|
||||
headers=self.headers,
|
||||
|
|
@ -127,9 +127,9 @@ class YTMusic(BrowsingMixin, WatchMixin, LibraryMixin, PlaylistsMixin, UploadsMi
|
|||
:return: configuration headers string
|
||||
"""
|
||||
return setup(filepath, headers_raw)
|
||||
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, execType = None, execValue = None, trackback = None):
|
||||
|
||||
def __exit__(self, execType=None, execValue=None, trackback=None):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Reference in a new issue