style: apply ruff auto-fixes
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import shutil
|
||||
import string
|
||||
import subprocess
|
||||
import time
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Iterable, List, Optional, Tuple
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from API.Tidal import (
|
||||
@@ -20,7 +17,6 @@ from API.Tidal import (
|
||||
stringify,
|
||||
)
|
||||
from ProviderCore.base import Provider, SearchResult, parse_inline_query_arguments
|
||||
from ProviderCore.inline_utils import collect_choice
|
||||
from cmdlet._shared import get_field
|
||||
from SYS import pipeline as pipeline_context
|
||||
from SYS.logger import debug, log
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import shutil
|
||||
import string
|
||||
import subprocess
|
||||
import time
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Iterable, List, Optional, Tuple
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from API.Tidal import (
|
||||
|
||||
@@ -1265,7 +1265,7 @@ class LibgenSearch:
|
||||
_call(log_info, f"[libgen] Using mirror: {mirror}")
|
||||
return results
|
||||
else:
|
||||
_call(log_info, f"[libgen] Mirror returned 0 results; stopping mirror fallback")
|
||||
_call(log_info, "[libgen] Mirror returned 0 results; stopping mirror fallback")
|
||||
break
|
||||
except requests.exceptions.Timeout:
|
||||
_call(log_info, f"[libgen] Mirror timed out: {mirror}")
|
||||
|
||||
@@ -11,7 +11,7 @@ import sys
|
||||
import tempfile
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import requests
|
||||
@@ -20,7 +20,7 @@ from API.HTTP import HTTPClient, get_requests_verify_value
|
||||
from ProviderCore.base import Provider, SearchResult
|
||||
from SYS.utils import sanitize_filename
|
||||
from SYS.cli_syntax import get_field, get_free_text, parse_query
|
||||
from SYS.logger import debug, log
|
||||
from SYS.logger import log
|
||||
from Provider.metadata_provider import (
|
||||
archive_item_metadata_to_tags,
|
||||
fetch_archive_item_metadata,
|
||||
|
||||
@@ -109,7 +109,6 @@ class YouTube(TableProviderMixin, Provider):
|
||||
|
||||
def validate(self) -> bool:
|
||||
try:
|
||||
import yt_dlp # type: ignore
|
||||
|
||||
return True
|
||||
except Exception:
|
||||
|
||||
@@ -9,13 +9,11 @@ This keeps format selection logic in ytdlp and leaves add-file plug-and-play.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from typing import Any, Dict, Iterable, List, Optional, Tuple
|
||||
|
||||
from ProviderCore.base import Provider, SearchResult
|
||||
from SYS.provider_helpers import TableProviderMixin
|
||||
from SYS.logger import log, debug
|
||||
from tool.ytdlp import list_formats, is_url_supported_by_ytdlp
|
||||
from SYS.logger import debug
|
||||
|
||||
|
||||
class ytdlp(TableProviderMixin, Provider):
|
||||
@@ -196,7 +194,6 @@ class ytdlp(TableProviderMixin, Provider):
|
||||
def validate(self) -> bool:
|
||||
"""Validate yt-dlp availability."""
|
||||
try:
|
||||
import yt_dlp # type: ignore
|
||||
return True
|
||||
except Exception:
|
||||
return False
|
||||
@@ -295,7 +292,7 @@ try:
|
||||
debug(f"[ytdlp] Selection routed with format_id: {format_id}")
|
||||
return result_args
|
||||
|
||||
debug(f"[ytdlp] Warning: No selection args or format_id found in row")
|
||||
debug("[ytdlp] Warning: No selection args or format_id found in row")
|
||||
return []
|
||||
|
||||
register_provider(
|
||||
|
||||
Reference in New Issue
Block a user