mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-28 03:25:52 +00:00
Allow passing headers to _call_api
This commit is contained in:
parent
9c32f15b7b
commit
e5a621ebdf
@ -14,17 +14,17 @@ from ..utils.traversal import traverse_obj, value
|
|||||||
|
|
||||||
|
|
||||||
class BandlabBaseIE(InfoExtractor):
|
class BandlabBaseIE(InfoExtractor):
|
||||||
_API_HEADERS = {
|
|
||||||
'accept': 'application/json',
|
|
||||||
'referer': 'https://www.bandlab.com/',
|
|
||||||
'x-client-id': 'BandLab-Web',
|
|
||||||
'x-client-version': '10.1.124',
|
|
||||||
}
|
|
||||||
|
|
||||||
def _call_api(self, endpoint, asset_id, **kwargs):
|
def _call_api(self, endpoint, asset_id, **kwargs):
|
||||||
|
headers = kwargs.pop('headers', None) or {}
|
||||||
return self._download_json(
|
return self._download_json(
|
||||||
f'https://www.bandlab.com/api/v1.3/{endpoint}/{asset_id}',
|
f'https://www.bandlab.com/api/v1.3/{endpoint}/{asset_id}',
|
||||||
asset_id, headers=self._API_HEADERS, **kwargs)
|
asset_id, headers={
|
||||||
|
'accept': 'application/json',
|
||||||
|
'referer': 'https://www.bandlab.com/',
|
||||||
|
'x-client-id': 'BandLab-Web',
|
||||||
|
'x-client-version': '10.1.124',
|
||||||
|
**headers,
|
||||||
|
}, **kwargs)
|
||||||
|
|
||||||
def _parse_revision(self, revision_data, url=None):
|
def _parse_revision(self, revision_data, url=None):
|
||||||
return {
|
return {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user