forked from DRMTalks/devine
Fix all Ruff and isort linter errors
This commit is contained in:
parent
959590a6bb
commit
4b8cfabaac
|
@ -29,6 +29,7 @@ from pymediainfo import MediaInfo
|
|||
from pywidevine.cdm import Cdm as WidevineCdm
|
||||
from pywidevine.device import Device
|
||||
from pywidevine.remotecdm import RemoteCdm
|
||||
from rich.console import Group
|
||||
from rich.live import Live
|
||||
from rich.padding import Padding
|
||||
from rich.panel import Panel
|
||||
|
@ -37,7 +38,6 @@ from rich.rule import Rule
|
|||
from rich.table import Table
|
||||
from rich.text import Text
|
||||
from rich.tree import Tree
|
||||
from rich.console import Group
|
||||
|
||||
from devine.core.config import config
|
||||
from devine.core.console import console
|
||||
|
@ -51,9 +51,9 @@ from devine.core.service import Service
|
|||
from devine.core.services import Services
|
||||
from devine.core.titles import Movie, Song, Title_T
|
||||
from devine.core.titles.episode import Episode
|
||||
from devine.core.tracks import Audio, Subtitle, Video, Tracks
|
||||
from devine.core.tracks import Audio, Subtitle, Tracks, Video
|
||||
from devine.core.utilities import get_binary_path, is_close_match, time_elapsed_since
|
||||
from devine.core.utils.click_types import LANGUAGE_RANGE, SEASON_RANGE, ContextData, QUALITY_LIST
|
||||
from devine.core.utils.click_types import LANGUAGE_RANGE, QUALITY_LIST, SEASON_RANGE, ContextData
|
||||
from devine.core.utils.collections import merge_dict
|
||||
from devine.core.utils.subprocess import ffprobe
|
||||
from devine.core.vaults import Vaults
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import logging
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
import click
|
||||
import yaml
|
||||
import shutil
|
||||
|
||||
from google.protobuf.json_format import MessageToDict
|
||||
from pywidevine.device import Device
|
||||
from pywidevine.license_protocol_pb2 import FileHashes
|
||||
|
|
|
@ -5,11 +5,11 @@ from pathlib import Path
|
|||
|
||||
import click
|
||||
import urllib3
|
||||
from rich import traceback
|
||||
from rich.console import Group
|
||||
from rich.padding import Padding
|
||||
from rich.text import Text
|
||||
from urllib3.exceptions import InsecureRequestWarning
|
||||
from rich import traceback
|
||||
from rich.padding import Padding
|
||||
|
||||
from devine.core import __version__
|
||||
from devine.core.commands import Commands
|
||||
|
@ -66,7 +66,7 @@ def main(version: bool, debug: bool, log_path: Path) -> None:
|
|||
style="ascii.art"
|
||||
),
|
||||
f"v[repr.number]{__version__}[/] Copyright © 2019-{datetime.now().year} rlaphoenix",
|
||||
f" [bright_blue]https://github.com/devine-dl/devine[/]"
|
||||
" [bright_blue]https://github.com/devine-dl/devine[/]"
|
||||
),
|
||||
(1, 21, 1, 20),
|
||||
expand=True
|
||||
|
|
|
@ -134,9 +134,12 @@ class ComfyConsole(Console):
|
|||
Args:
|
||||
color_system (str, optional): The color system supported by your terminal,
|
||||
either ``"standard"``, ``"256"`` or ``"truecolor"``. Leave as ``"auto"`` to autodetect.
|
||||
force_terminal (Optional[bool], optional): Enable/disable terminal control codes, or None to auto-detect terminal. Defaults to None.
|
||||
force_jupyter (Optional[bool], optional): Enable/disable Jupyter rendering, or None to auto-detect Jupyter. Defaults to None.
|
||||
force_interactive (Optional[bool], optional): Enable/disable interactive mode, or None to auto detect. Defaults to None.
|
||||
force_terminal (Optional[bool], optional): Enable/disable terminal control codes, or None to auto-detect
|
||||
terminal. Defaults to None.
|
||||
force_jupyter (Optional[bool], optional): Enable/disable Jupyter rendering, or None to auto-detect Jupyter.
|
||||
Defaults to None.
|
||||
force_interactive (Optional[bool], optional): Enable/disable interactive mode, or None to auto-detect.
|
||||
Defaults to None.
|
||||
soft_wrap (Optional[bool], optional): Set soft wrap default on print method. Defaults to False.
|
||||
theme (Theme, optional): An optional style theme object, or ``None`` for default theme.
|
||||
stderr (bool, optional): Use stderr rather than stdout if ``file`` is not specified. Defaults to False.
|
||||
|
@ -145,7 +148,7 @@ class ComfyConsole(Console):
|
|||
width (int, optional): The width of the terminal. Leave as default to auto-detect width.
|
||||
height (int, optional): The height of the terminal. Leave as default to auto-detect height.
|
||||
style (StyleType, optional): Style to apply to all output, or None for no style. Defaults to None.
|
||||
no_color (Optional[bool], optional): Enabled no color mode, or None to auto detect. Defaults to None.
|
||||
no_color (Optional[bool], optional): Enabled no color mode, or None to auto-detect. Defaults to None.
|
||||
tab_size (int, optional): Number of spaces used to replace a tab character. Defaults to 8.
|
||||
record (bool, optional): Boolean to enable recording of terminal output,
|
||||
required to call :meth:`export_html`, :meth:`export_svg`, and :meth:`export_text`. Defaults to False.
|
||||
|
@ -155,13 +158,15 @@ class ComfyConsole(Console):
|
|||
highlight (bool, optional): Enable automatic highlighting. Defaults to True.
|
||||
log_time (bool, optional): Boolean to enable logging of time by :meth:`log` methods. Defaults to True.
|
||||
log_path (bool, optional): Boolean to enable the logging of the caller by :meth:`log`. Defaults to True.
|
||||
log_time_format (Union[str, TimeFormatterCallable], optional): If ``log_time`` is enabled, either string for strftime or callable that formats the time. Defaults to "[%X] ".
|
||||
log_time_format (Union[str, TimeFormatterCallable], optional): If ``log_time`` is enabled, either string for
|
||||
strftime or callable that formats the time. Defaults to "[%X] ".
|
||||
highlighter (HighlighterType, optional): Default highlighter.
|
||||
legacy_windows (bool, optional): Enable legacy Windows mode, or ``None`` to auto detect. Defaults to ``None``.
|
||||
legacy_windows (bool, optional): Enable legacy Windows mode, or ``None`` to auto-detect. Defaults to ``None``.
|
||||
safe_box (bool, optional): Restrict box options that don't render on legacy Windows.
|
||||
get_datetime (Callable[[], datetime], optional): Callable that gets the current time as a datetime.datetime object (used by Console.log),
|
||||
or None for datetime.now.
|
||||
get_time (Callable[[], time], optional): Callable that gets the current time in seconds, default uses time.monotonic.
|
||||
get_datetime (Callable[[], datetime], optional): Callable that gets the current time as a datetime.datetime
|
||||
object (used by Console.log), or None for datetime.now.
|
||||
get_time (Callable[[], time], optional): Callable that gets the current time in seconds, default uses
|
||||
time.monotonic.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import asyncio
|
||||
|
||||
from ..config import config
|
||||
from .aria2c import aria2c
|
||||
from .requests import requests
|
||||
from ..config import config
|
||||
|
||||
downloader = {
|
||||
"aria2c": lambda *args, **kwargs: asyncio.run(aria2c(*args, **kwargs)),
|
||||
|
|
|
@ -4,10 +4,10 @@ import textwrap
|
|||
from functools import partial
|
||||
from http.cookiejar import CookieJar
|
||||
from pathlib import Path
|
||||
from typing import Optional, Union, MutableMapping
|
||||
from typing import MutableMapping, Optional, Union
|
||||
|
||||
import requests
|
||||
from requests.cookies import RequestsCookieJar, get_cookie_header, cookiejar_from_dict
|
||||
from requests.cookies import RequestsCookieJar, cookiejar_from_dict, get_cookie_header
|
||||
from rich.text import Text
|
||||
|
||||
from devine.core.config import config
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import time
|
||||
from functools import partial
|
||||
from pathlib import Path
|
||||
from typing import Optional, Union, Any, MutableMapping
|
||||
from typing import Any, MutableMapping, Optional, Union
|
||||
|
||||
from requests import Session
|
||||
from requests.cookies import RequestsCookieJar
|
||||
|
|
|
@ -13,7 +13,7 @@ from functools import partial
|
|||
from hashlib import md5
|
||||
from pathlib import Path
|
||||
from threading import Event
|
||||
from typing import Any, Callable, Optional, Union, MutableMapping
|
||||
from typing import Any, Callable, MutableMapping, Optional, Union
|
||||
from urllib.parse import urljoin, urlparse
|
||||
from uuid import UUID
|
||||
|
||||
|
@ -27,7 +27,8 @@ from requests.cookies import RequestsCookieJar
|
|||
from rich import filesize
|
||||
|
||||
from devine.core.constants import AnyTrack
|
||||
from devine.core.downloaders import downloader, requests as requests_downloader
|
||||
from devine.core.downloaders import downloader
|
||||
from devine.core.downloaders import requests as requests_downloader
|
||||
from devine.core.drm import Widevine
|
||||
from devine.core.tracks import Audio, Subtitle, Tracks, Video
|
||||
from devine.core.utilities import is_close_match
|
||||
|
|
|
@ -24,7 +24,8 @@ from requests import Session
|
|||
from rich import filesize
|
||||
|
||||
from devine.core.constants import AnyTrack
|
||||
from devine.core.downloaders import downloader, requests as requests_downloader
|
||||
from devine.core.downloaders import downloader
|
||||
from devine.core.downloaders import requests as requests_downloader
|
||||
from devine.core.drm import DRM_T, ClearKey, Widevine
|
||||
from devine.core.tracks import Audio, Subtitle, Tracks, Video
|
||||
from devine.core.utilities import is_close_match
|
||||
|
|
|
@ -122,7 +122,8 @@ class Service(metaclass=ABCMeta):
|
|||
raise TypeError(f"Expected cookies to be a {MozillaCookieJar}, not {cookies!r}.")
|
||||
self.session.cookies.update(cookies)
|
||||
|
||||
def get_widevine_service_certificate(self, *, challenge: bytes, title: Title_T, track: AnyTrack) -> Union[bytes, str]:
|
||||
def get_widevine_service_certificate(self, *, challenge: bytes, title: Title_T, track: AnyTrack) \
|
||||
-> Union[bytes, str]:
|
||||
"""
|
||||
Get the Widevine Service Certificate used for Privacy Mode.
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from typing import Callable, Iterator, Optional, Sequence, Union
|
|||
|
||||
from Cryptodome.Random import get_random_bytes
|
||||
from langcodes import Language, closest_supported_match
|
||||
from rich.progress import Progress, TextColumn, SpinnerColumn, BarColumn, TimeRemainingColumn
|
||||
from rich.progress import BarColumn, Progress, SpinnerColumn, TextColumn, TimeRemainingColumn
|
||||
from rich.table import Table
|
||||
from rich.tree import Tree
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import re
|
|||
import shutil
|
||||
import sys
|
||||
import time
|
||||
|
||||
import unicodedata
|
||||
from collections import defaultdict
|
||||
from datetime import datetime
|
||||
|
|
Loading…
Reference in New Issue