1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-31 14:45:14 +00:00

[cleanup] Use random.choices (#5800)

Authored by: freezboltz
This commit is contained in:
Anant Murmu
2022-12-30 08:13:49 +05:30
committed by GitHub
parent e107c2b8cf
commit efa944f4bc
11 changed files with 18 additions and 19 deletions

View File

@@ -251,7 +251,7 @@ class ViuOTTIE(InfoExtractor):
return self._user_token
def _get_token(self, country_code, video_id):
rand = ''.join(random.choice('0123456789') for _ in range(10))
rand = ''.join(random.choices('0123456789', k=10))
return self._download_json(
f'https://api-gateway-global.viu.com/api/auth/token?v={rand}000', video_id,
headers={'Content-Type': 'application/json'}, note='Getting bearer token',