mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 09:01:43 +00:00
[vrv] Fix extraction on python2 (closes #15928)
This commit is contained in:
parent
86e1958944
commit
16132cff72
@ -12,7 +12,7 @@
|
|||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import (
|
from ..compat import (
|
||||||
compat_urllib_parse_urlencode,
|
compat_urllib_parse_urlencode,
|
||||||
compat_urlparse,
|
compat_urllib_parse,
|
||||||
)
|
)
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
float_or_none,
|
float_or_none,
|
||||||
@ -39,11 +39,11 @@ def _call_api(self, path, video_id, note, data=None):
|
|||||||
data = json.dumps(data).encode()
|
data = json.dumps(data).encode()
|
||||||
headers['Content-Type'] = 'application/json'
|
headers['Content-Type'] = 'application/json'
|
||||||
method = 'POST' if data else 'GET'
|
method = 'POST' if data else 'GET'
|
||||||
base_string = '&'.join([method, compat_urlparse.quote(base_url, ''), compat_urlparse.quote(encoded_query, '')])
|
base_string = '&'.join([method, compat_urllib_parse.quote(base_url, ''), compat_urllib_parse.quote(encoded_query, '')])
|
||||||
oauth_signature = base64.b64encode(hmac.new(
|
oauth_signature = base64.b64encode(hmac.new(
|
||||||
(self._API_PARAMS['oAuthSecret'] + '&').encode('ascii'),
|
(self._API_PARAMS['oAuthSecret'] + '&').encode('ascii'),
|
||||||
base_string.encode(), hashlib.sha1).digest()).decode()
|
base_string.encode(), hashlib.sha1).digest()).decode()
|
||||||
encoded_query += '&oauth_signature=' + compat_urlparse.quote(oauth_signature, '')
|
encoded_query += '&oauth_signature=' + compat_urllib_parse.quote(oauth_signature, '')
|
||||||
return self._download_json(
|
return self._download_json(
|
||||||
'?'.join([base_url, encoded_query]), video_id,
|
'?'.join([base_url, encoded_query]), video_id,
|
||||||
note='Downloading %s JSON metadata' % note, headers=headers, data=data)
|
note='Downloading %s JSON metadata' % note, headers=headers, data=data)
|
||||||
|
Loading…
Reference in New Issue
Block a user