mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 17:22:31 +01:00
[vrv] fix oauth signing for python 2(#14307)
This commit is contained in:
parent
4b85f0f9db
commit
503b604a31
@ -32,14 +32,14 @@ class VRVBaseIE(InfoExtractor):
|
|||||||
def _call_api(self, path, video_id, note, data=None):
|
def _call_api(self, path, video_id, note, data=None):
|
||||||
# https://tools.ietf.org/html/rfc5849#section-3
|
# https://tools.ietf.org/html/rfc5849#section-3
|
||||||
base_url = self._API_DOMAIN + '/core/' + path
|
base_url = self._API_DOMAIN + '/core/' + path
|
||||||
query = {
|
query = [
|
||||||
'oauth_consumer_key': self._API_PARAMS['oAuthKey'],
|
('oauth_consumer_key', self._API_PARAMS['oAuthKey']),
|
||||||
'oauth_nonce': ''.join([random.choice(string.ascii_letters) for _ in range(32)]),
|
('oauth_nonce', ''.join([random.choice(string.ascii_letters) for _ in range(32)])),
|
||||||
'oauth_signature_method': 'HMAC-SHA1',
|
('oauth_signature_method', 'HMAC-SHA1'),
|
||||||
'oauth_timestamp': int(time.time()),
|
('oauth_timestamp', int(time.time())),
|
||||||
}
|
]
|
||||||
if self._TOKEN:
|
if self._TOKEN:
|
||||||
query['oauth_token'] = self._TOKEN
|
query.append(('oauth_token', self._TOKEN))
|
||||||
encoded_query = compat_urllib_parse_urlencode(query)
|
encoded_query = compat_urllib_parse_urlencode(query)
|
||||||
headers = self.geo_verification_headers()
|
headers = self.geo_verification_headers()
|
||||||
if data:
|
if data:
|
||||||
|
Loading…
Reference in New Issue
Block a user