mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-07 16:55:15 +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:
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import base64
|
||||
import collections
|
||||
import xml.etree.ElementTree
|
||||
import hashlib
|
||||
import itertools
|
||||
import json
|
||||
import math
|
||||
import netrc
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
import math
|
||||
import xml.etree.ElementTree
|
||||
|
||||
from ..compat import (
|
||||
compat_cookiejar_Cookie,
|
||||
@@ -29,11 +29,15 @@ from ..compat import (
|
||||
compat_urlparse,
|
||||
)
|
||||
from ..downloader import FileDownloader
|
||||
from ..downloader.f4m import (
|
||||
get_base_url,
|
||||
remove_encrypted_media,
|
||||
)
|
||||
from ..downloader.f4m import get_base_url, remove_encrypted_media
|
||||
from ..utils import (
|
||||
JSON_LD_RE,
|
||||
NO_DEFAULT,
|
||||
ExtractorError,
|
||||
GeoRestrictedError,
|
||||
GeoUtils,
|
||||
RegexNotFoundError,
|
||||
UnsupportedError,
|
||||
age_restricted,
|
||||
base_url,
|
||||
bug_reports_message,
|
||||
@@ -44,20 +48,15 @@ from ..utils import (
|
||||
encode_data_uri,
|
||||
error_to_compat_str,
|
||||
extract_attributes,
|
||||
ExtractorError,
|
||||
filter_dict,
|
||||
fix_xml_ampersands,
|
||||
float_or_none,
|
||||
format_field,
|
||||
GeoRestrictedError,
|
||||
GeoUtils,
|
||||
int_or_none,
|
||||
join_nonempty,
|
||||
js_to_json,
|
||||
JSON_LD_RE,
|
||||
mimetype2ext,
|
||||
network_exceptions,
|
||||
NO_DEFAULT,
|
||||
orderedSet,
|
||||
parse_bitrate,
|
||||
parse_codecs,
|
||||
@@ -65,7 +64,6 @@ from ..utils import (
|
||||
parse_iso8601,
|
||||
parse_m3u8_attributes,
|
||||
parse_resolution,
|
||||
RegexNotFoundError,
|
||||
sanitize_filename,
|
||||
sanitized_Request,
|
||||
str_or_none,
|
||||
@@ -74,7 +72,6 @@ from ..utils import (
|
||||
traverse_obj,
|
||||
try_get,
|
||||
unescapeHTML,
|
||||
UnsupportedError,
|
||||
unified_strdate,
|
||||
unified_timestamp,
|
||||
update_Request,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from .common import InfoExtractor
|
||||
from ..compat import (
|
||||
compat_urlparse,
|
||||
)
|
||||
from ..compat import compat_urlparse
|
||||
|
||||
|
||||
class RtmpIE(InfoExtractor):
|
||||
|
||||
@@ -2,8 +2,107 @@ import os
|
||||
import re
|
||||
import xml.etree.ElementTree
|
||||
|
||||
from .ant1newsgr import Ant1NewsGrEmbedIE
|
||||
from .anvato import AnvatoIE
|
||||
from .apa import APAIE
|
||||
from .arcpublishing import ArcPublishingIE
|
||||
from .arkena import ArkenaIE
|
||||
from .arte import ArteTVEmbedIE
|
||||
from .bitchute import BitChuteIE
|
||||
from .blogger import BloggerIE
|
||||
from .brightcove import BrightcoveLegacyIE, BrightcoveNewIE
|
||||
from .channel9 import Channel9IE
|
||||
from .cloudflarestream import CloudflareStreamIE
|
||||
from .common import InfoExtractor
|
||||
from .commonprotocols import RtmpIE
|
||||
from .condenast import CondeNastIE
|
||||
from .dailymail import DailyMailIE
|
||||
from .dailymotion import DailymotionIE
|
||||
from .dbtv import DBTVIE
|
||||
from .digiteka import DigitekaIE
|
||||
from .drtuber import DrTuberIE
|
||||
from .eagleplatform import EaglePlatformIE
|
||||
from .ertgr import ERTWebtvEmbedIE
|
||||
from .expressen import ExpressenIE
|
||||
from .facebook import FacebookIE
|
||||
from .foxnews import FoxNewsIE
|
||||
from .gedidigital import GediDigitalIE
|
||||
from .gfycat import GfycatIE
|
||||
from .glomex import GlomexEmbedIE
|
||||
from .googledrive import GoogleDriveIE
|
||||
from .indavideo import IndavideoEmbedIE
|
||||
from .instagram import InstagramIE
|
||||
from .joj import JojIE
|
||||
from .jwplatform import JWPlatformIE
|
||||
from .kaltura import KalturaIE
|
||||
from .kinja import KinjaEmbedIE
|
||||
from .limelight import LimelightBaseIE
|
||||
from .mainstreaming import MainStreamingIE
|
||||
from .medialaan import MedialaanIE
|
||||
from .mediaset import MediasetIE
|
||||
from .mediasite import MediasiteIE
|
||||
from .megaphone import MegaphoneIE
|
||||
from .megatvcom import MegaTVComEmbedIE
|
||||
from .mofosex import MofosexEmbedIE
|
||||
from .mtv import MTVServicesEmbeddedIE
|
||||
from .myvi import MyviIE
|
||||
from .nbc import NBCSportsVPlayerIE
|
||||
from .nexx import NexxEmbedIE, NexxIE
|
||||
from .odnoklassniki import OdnoklassnikiIE
|
||||
from .onionstudios import OnionStudiosIE
|
||||
from .ooyala import OoyalaIE
|
||||
from .panopto import PanoptoBaseIE
|
||||
from .peertube import PeerTubeIE
|
||||
from .piksel import PikselIE
|
||||
from .pladform import PladformIE
|
||||
from .pornhub import PornHubIE
|
||||
from .rcs import RCSEmbedsIE
|
||||
from .redtube import RedTubeIE
|
||||
from .rumble import RumbleEmbedIE
|
||||
from .rutube import RutubeIE
|
||||
from .rutv import RUTVIE
|
||||
from .ruutu import RuutuIE
|
||||
from .senategov import SenateISVPIE
|
||||
from .simplecast import SimplecastIE
|
||||
from .soundcloud import SoundcloudEmbedIE
|
||||
from .spankwire import SpankwireIE
|
||||
from .sportbox import SportBoxIE
|
||||
from .springboardplatform import SpringboardPlatformIE
|
||||
from .svt import SVTIE
|
||||
from .teachable import TeachableIE
|
||||
from .ted import TedEmbedIE
|
||||
from .theplatform import ThePlatformIE
|
||||
from .threeqsdn import ThreeQSDNIE
|
||||
from .tnaflix import TNAFlixNetworkEmbedIE
|
||||
from .tube8 import Tube8IE
|
||||
from .tunein import TuneInBaseIE
|
||||
from .tvc import TVCIE
|
||||
from .tvopengr import TVOpenGrEmbedIE
|
||||
from .tvp import TVPEmbedIE
|
||||
from .twentymin import TwentyMinutenIE
|
||||
from .udn import UDNEmbedIE
|
||||
from .ustream import UstreamIE
|
||||
from .vbox7 import Vbox7IE
|
||||
from .vice import ViceIE
|
||||
from .videa import VideaIE
|
||||
from .videomore import VideomoreIE
|
||||
from .videopress import VideoPressIE
|
||||
from .viewlift import ViewLiftEmbedIE
|
||||
from .vimeo import VHXEmbedIE, VimeoIE
|
||||
from .viqeo import ViqeoIE
|
||||
from .vk import VKIE
|
||||
from .vshare import VShareIE
|
||||
from .vzaar import VzaarIE
|
||||
from .washingtonpost import WashingtonPostIE
|
||||
from .webcaster import WebcasterFeedIE
|
||||
from .wimtv import WimTVIE
|
||||
from .wistia import WistiaIE
|
||||
from .xfileshare import XFileShareIE
|
||||
from .xhamster import XHamsterEmbedIE
|
||||
from .yapfiles import YapFilesIE
|
||||
from .youporn import YouPornIE
|
||||
from .youtube import YoutubeIE
|
||||
from .zype import ZypeIE
|
||||
from ..compat import (
|
||||
compat_etree_fromstring,
|
||||
compat_str,
|
||||
@@ -11,15 +110,16 @@ from ..compat import (
|
||||
compat_urlparse,
|
||||
)
|
||||
from ..utils import (
|
||||
KNOWN_EXTENSIONS,
|
||||
ExtractorError,
|
||||
HEADRequest,
|
||||
UnsupportedError,
|
||||
determine_ext,
|
||||
dict_get,
|
||||
ExtractorError,
|
||||
float_or_none,
|
||||
HEADRequest,
|
||||
int_or_none,
|
||||
is_html,
|
||||
js_to_json,
|
||||
KNOWN_EXTENSIONS,
|
||||
merge_dicts,
|
||||
mimetype2ext,
|
||||
orderedSet,
|
||||
@@ -31,120 +131,11 @@ from ..utils import (
|
||||
unescapeHTML,
|
||||
unified_timestamp,
|
||||
unsmuggle_url,
|
||||
UnsupportedError,
|
||||
url_or_none,
|
||||
xpath_attr,
|
||||
xpath_text,
|
||||
xpath_with_ns,
|
||||
)
|
||||
from .commonprotocols import RtmpIE
|
||||
from .brightcove import (
|
||||
BrightcoveLegacyIE,
|
||||
BrightcoveNewIE,
|
||||
)
|
||||
from .nexx import (
|
||||
NexxIE,
|
||||
NexxEmbedIE,
|
||||
)
|
||||
from .nbc import NBCSportsVPlayerIE
|
||||
from .ooyala import OoyalaIE
|
||||
from .rutv import RUTVIE
|
||||
from .tvc import TVCIE
|
||||
from .sportbox import SportBoxIE
|
||||
from .myvi import MyviIE
|
||||
from .condenast import CondeNastIE
|
||||
from .udn import UDNEmbedIE
|
||||
from .senategov import SenateISVPIE
|
||||
from .svt import SVTIE
|
||||
from .pornhub import PornHubIE
|
||||
from .xhamster import XHamsterEmbedIE
|
||||
from .tnaflix import TNAFlixNetworkEmbedIE
|
||||
from .drtuber import DrTuberIE
|
||||
from .redtube import RedTubeIE
|
||||
from .tube8 import Tube8IE
|
||||
from .mofosex import MofosexEmbedIE
|
||||
from .spankwire import SpankwireIE
|
||||
from .youporn import YouPornIE
|
||||
from .vimeo import (
|
||||
VimeoIE,
|
||||
VHXEmbedIE,
|
||||
)
|
||||
from .dailymotion import DailymotionIE
|
||||
from .dailymail import DailyMailIE
|
||||
from .onionstudios import OnionStudiosIE
|
||||
from .viewlift import ViewLiftEmbedIE
|
||||
from .mtv import MTVServicesEmbeddedIE
|
||||
from .pladform import PladformIE
|
||||
from .videomore import VideomoreIE
|
||||
from .webcaster import WebcasterFeedIE
|
||||
from .googledrive import GoogleDriveIE
|
||||
from .jwplatform import JWPlatformIE
|
||||
from .digiteka import DigitekaIE
|
||||
from .arkena import ArkenaIE
|
||||
from .instagram import InstagramIE
|
||||
from .threeqsdn import ThreeQSDNIE
|
||||
from .theplatform import ThePlatformIE
|
||||
from .kaltura import KalturaIE
|
||||
from .eagleplatform import EaglePlatformIE
|
||||
from .facebook import FacebookIE
|
||||
from .soundcloud import SoundcloudEmbedIE
|
||||
from .tunein import TuneInBaseIE
|
||||
from .vbox7 import Vbox7IE
|
||||
from .dbtv import DBTVIE
|
||||
from .piksel import PikselIE
|
||||
from .videa import VideaIE
|
||||
from .twentymin import TwentyMinutenIE
|
||||
from .ustream import UstreamIE
|
||||
from .arte import ArteTVEmbedIE
|
||||
from .videopress import VideoPressIE
|
||||
from .rutube import RutubeIE
|
||||
from .glomex import GlomexEmbedIE
|
||||
from .megatvcom import MegaTVComEmbedIE
|
||||
from .ant1newsgr import Ant1NewsGrEmbedIE
|
||||
from .limelight import LimelightBaseIE
|
||||
from .anvato import AnvatoIE
|
||||
from .washingtonpost import WashingtonPostIE
|
||||
from .wistia import WistiaIE
|
||||
from .mediaset import MediasetIE
|
||||
from .joj import JojIE
|
||||
from .megaphone import MegaphoneIE
|
||||
from .vzaar import VzaarIE
|
||||
from .channel9 import Channel9IE
|
||||
from .vshare import VShareIE
|
||||
from .mediasite import MediasiteIE
|
||||
from .springboardplatform import SpringboardPlatformIE
|
||||
from .ted import TedEmbedIE
|
||||
from .yapfiles import YapFilesIE
|
||||
from .vice import ViceIE
|
||||
from .xfileshare import XFileShareIE
|
||||
from .cloudflarestream import CloudflareStreamIE
|
||||
from .peertube import PeerTubeIE
|
||||
from .teachable import TeachableIE
|
||||
from .indavideo import IndavideoEmbedIE
|
||||
from .apa import APAIE
|
||||
from .foxnews import FoxNewsIE
|
||||
from .viqeo import ViqeoIE
|
||||
from .expressen import ExpressenIE
|
||||
from .zype import ZypeIE
|
||||
from .odnoklassniki import OdnoklassnikiIE
|
||||
from .vk import VKIE
|
||||
from .kinja import KinjaEmbedIE
|
||||
from .gedidigital import GediDigitalIE
|
||||
from .rcs import RCSEmbedsIE
|
||||
from .bitchute import BitChuteIE
|
||||
from .rumble import RumbleEmbedIE
|
||||
from .arcpublishing import ArcPublishingIE
|
||||
from .medialaan import MedialaanIE
|
||||
from .simplecast import SimplecastIE
|
||||
from .wimtv import WimTVIE
|
||||
from .tvopengr import TVOpenGrEmbedIE
|
||||
from .ertgr import ERTWebtvEmbedIE
|
||||
from .tvp import TVPEmbedIE
|
||||
from .blogger import BloggerIE
|
||||
from .mainstreaming import MainStreamingIE
|
||||
from .gfycat import GfycatIE
|
||||
from .panopto import PanoptoBaseIE
|
||||
from .ruutu import RuutuIE
|
||||
|
||||
|
||||
class GenericIE(InfoExtractor):
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import re
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..compat import (
|
||||
compat_str,
|
||||
)
|
||||
from ..compat import compat_str
|
||||
from ..utils import (
|
||||
ExtractorError,
|
||||
find_xpath_attr,
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
from .common import InfoExtractor
|
||||
from ..compat import (
|
||||
compat_urllib_parse_unquote,
|
||||
)
|
||||
from ..utils import (
|
||||
int_or_none,
|
||||
find_xpath_attr,
|
||||
xpath_text,
|
||||
update_url_query,
|
||||
)
|
||||
from ..compat import compat_urllib_parse_unquote
|
||||
|
||||
|
||||
class NozIE(InfoExtractor):
|
||||
|
||||
@@ -3,16 +3,14 @@ import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
from ..compat import (
|
||||
compat_urlparse,
|
||||
)
|
||||
from ..compat import compat_urlparse
|
||||
from ..utils import (
|
||||
ExtractorError,
|
||||
Popen,
|
||||
check_executable,
|
||||
encodeArgument,
|
||||
ExtractorError,
|
||||
get_exe_version,
|
||||
is_outdated_version,
|
||||
Popen,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import os.path
|
||||
import random
|
||||
import re
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
import traceback
|
||||
import threading
|
||||
|
||||
from .common import InfoExtractor, SearchInfoExtractor
|
||||
from ..compat import (
|
||||
@@ -27,12 +27,13 @@ from ..compat import (
|
||||
)
|
||||
from ..jsinterp import JSInterpreter
|
||||
from ..utils import (
|
||||
NO_DEFAULT,
|
||||
ExtractorError,
|
||||
bug_reports_message,
|
||||
clean_html,
|
||||
datetime_from_str,
|
||||
dict_get,
|
||||
error_to_compat_str,
|
||||
ExtractorError,
|
||||
float_or_none,
|
||||
format_field,
|
||||
get_first,
|
||||
@@ -42,7 +43,6 @@ from ..utils import (
|
||||
js_to_json,
|
||||
mimetype2ext,
|
||||
network_exceptions,
|
||||
NO_DEFAULT,
|
||||
orderedSet,
|
||||
parse_codecs,
|
||||
parse_count,
|
||||
@@ -68,7 +68,6 @@ from ..utils import (
|
||||
variadic,
|
||||
)
|
||||
|
||||
|
||||
# any clients starting with _ cannot be explicity requested by the user
|
||||
INNERTUBE_CLIENTS = {
|
||||
'web': {
|
||||
|
||||
Reference in New Issue
Block a user