mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[cleanup] Sort imports
Using https://github.com/PyCQA/isort isort -m VERTICAL_HANGING_INDENT --py 36 -l 80 --rr -n --tc .
This commit is contained in:
		| @@ -1,35 +1,31 @@ | ||||
| import io | ||||
| import json | ||||
| import time | ||||
| import base64 | ||||
| import binascii | ||||
| import hashlib | ||||
| import hmac | ||||
| import io | ||||
| import json | ||||
| import re | ||||
| import struct | ||||
| import time | ||||
| import urllib.response | ||||
| import uuid | ||||
| from base64 import urlsafe_b64encode | ||||
| from binascii import unhexlify | ||||
| 
 | ||||
| from .common import InfoExtractor | ||||
| from ..aes import aes_ecb_decrypt | ||||
| from ..compat import ( | ||||
|     compat_urllib_parse_urlparse, | ||||
|     compat_urllib_request, | ||||
| ) | ||||
| from ..compat import compat_urllib_parse_urlparse, compat_urllib_request | ||||
| from ..utils import ( | ||||
|     ExtractorError, | ||||
|     bytes_to_intlist, | ||||
|     decode_base, | ||||
|     int_or_none, | ||||
|     intlist_to_bytes, | ||||
|     request_to_url, | ||||
|     time_seconds, | ||||
|     update_url_query, | ||||
|     traverse_obj, | ||||
|     intlist_to_bytes, | ||||
|     bytes_to_intlist, | ||||
|     update_url_query, | ||||
|     urljoin, | ||||
| ) | ||||
| 
 | ||||
| 
 | ||||
| # NOTE: network handler related code is temporary thing until network stack overhaul PRs are merged (#2861/#2862) | ||||
| 
 | ||||
| def add_opener(ydl, handler): | ||||
| @@ -130,7 +126,7 @@ class AbemaLicenseHandler(compat_urllib_request.BaseHandler): | ||||
|         encvideokey = bytes_to_intlist(struct.pack('>QQ', res >> 64, res & 0xffffffffffffffff)) | ||||
| 
 | ||||
|         h = hmac.new( | ||||
|             unhexlify(self.HKEY), | ||||
|             binascii.unhexlify(self.HKEY), | ||||
|             (license_response['cid'] + self.ie._DEVICE_ID).encode('utf-8'), | ||||
|             digestmod=hashlib.sha256) | ||||
|         enckey = bytes_to_intlist(h.digest()) | ||||
| @@ -238,7 +234,7 @@ class AbemaTVIE(AbemaTVBaseIE): | ||||
| 
 | ||||
|         def mix_twist(nonce): | ||||
|             nonlocal tmp | ||||
|             mix_once(urlsafe_b64encode(tmp).rstrip(b'=') + nonce) | ||||
|             mix_once(base64.urlsafe_b64encode(tmp).rstrip(b'=') + nonce) | ||||
| 
 | ||||
|         mix_once(self._SECRETKEY) | ||||
|         mix_tmp(time_struct.tm_mon) | ||||
| @@ -247,7 +243,7 @@ class AbemaTVIE(AbemaTVBaseIE): | ||||
|         mix_twist(ts_1hour_str) | ||||
|         mix_tmp(time_struct.tm_hour % 5) | ||||
| 
 | ||||
|         return urlsafe_b64encode(tmp).rstrip(b'=').decode('utf-8') | ||||
|         return base64.urlsafe_b64encode(tmp).rstrip(b'=').decode('utf-8') | ||||
| 
 | ||||
|     def _get_device_token(self): | ||||
|         if self._USERTOKEN: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 pukkandan
					pukkandan