update
This commit is contained in:
@@ -658,6 +658,7 @@ class AllDebrid(TablePluginMixin, Provider):
|
||||
AUTO_STAGE_USE_SELECTION_ARGS = True
|
||||
URL = ("magnet:", "alldebrid:magnet:", "alldebrid:", "alldebrid🧲", "alldebrid.com")
|
||||
URL_DOMAINS = ()
|
||||
SUPPORTED_CMDLETS = frozenset({"download-file", "search-file"})
|
||||
|
||||
def extract_query_arguments(self, query: str) -> Tuple[str, Dict[str, Any]]:
|
||||
normalized = str(query or "").strip()
|
||||
|
||||
@@ -13,6 +13,7 @@ from plugins.playwright import PlaywrightTool
|
||||
class Bandcamp(Provider):
|
||||
"""Search provider for Bandcamp."""
|
||||
|
||||
SUPPORTED_CMDLETS = frozenset({"search-file"})
|
||||
TABLE_AUTO_STAGES = {
|
||||
"bandcamp": ["download-file"],
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ def _extract_key(payload: Any) -> Optional[str]:
|
||||
class FileIO(Provider):
|
||||
"""File provider for file.io."""
|
||||
PLUGIN_NAME = "file.io"
|
||||
SUPPORTED_CMDLETS = frozenset({"add-file"})
|
||||
|
||||
@classmethod
|
||||
def config_schema(cls) -> List[Dict[str, Any]]:
|
||||
|
||||
@@ -25,6 +25,7 @@ class HelloProvider(Provider):
|
||||
"""
|
||||
|
||||
PLUGIN_NAME = "hello"
|
||||
SUPPORTED_CMDLETS = frozenset({"download-file", "search-file"})
|
||||
URL = ("hello:",)
|
||||
URL_DOMAINS = ()
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ def _format_total_seconds(seconds: Any) -> str:
|
||||
|
||||
class HIFI(Provider):
|
||||
PLUGIN_NAME = "hifi"
|
||||
SUPPORTED_CMDLETS = frozenset({"download-file", "search-file"})
|
||||
|
||||
TABLE_AUTO_STAGES = {
|
||||
"hifi.track": ["download-file"],
|
||||
|
||||
@@ -593,6 +593,7 @@ class InternetArchive(Provider):
|
||||
- add-file -plugin internetarchive (uploads)
|
||||
"""
|
||||
URL = ("archive.org",)
|
||||
SUPPORTED_CMDLETS = frozenset({"add-file", "download-file", "search-file"})
|
||||
|
||||
def get_table_type(self, query: str, filters: Optional[Dict[str, Any]] = None) -> str:
|
||||
return "internetarchive.folder"
|
||||
|
||||
@@ -656,6 +656,7 @@ def _libgen_metadata_to_tags(meta: Dict[str, Any]) -> List[str]:
|
||||
|
||||
class Libgen(Provider):
|
||||
|
||||
SUPPORTED_CMDLETS = frozenset({"download-file", "search-file"})
|
||||
TABLE_AUTO_STAGES = {
|
||||
"libgen": ["download-file"],
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ class LOC(Provider):
|
||||
Currently implements Chronicling America collection search via the LoC JSON API.
|
||||
"""
|
||||
|
||||
SUPPORTED_CMDLETS = frozenset({"search-file"})
|
||||
|
||||
@property
|
||||
def preserve_order(self) -> bool:
|
||||
return True
|
||||
|
||||
@@ -302,7 +302,7 @@ class Matrix(TablePluginMixin, Provider):
|
||||
|
||||
EXPOSE_AS_FILE_PROVIDER = False
|
||||
MULTI_INSTANCE = True
|
||||
SUPPORTED_CMDLETS = frozenset({"add-file"})
|
||||
SUPPORTED_CMDLETS = frozenset({"add-file", "search-file"})
|
||||
|
||||
@classmethod
|
||||
def config_schema(cls) -> List[Dict[str, Any]]:
|
||||
|
||||
+16
-18
@@ -10,7 +10,7 @@ from datetime import datetime, timedelta
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
from pathlib import Path
|
||||
from SYS.cmdlet_spec import Cmdlet, CmdletArg, parse_cmdlet_args
|
||||
from PluginCore.registry import get_plugin, get_plugin_for_url, list_plugin_names_with_capability
|
||||
from PluginCore.registry import get_plugin, get_plugin_for_url
|
||||
from SYS.logger import debug, get_thread_stream, is_debug_enabled, set_debug, set_thread_stream
|
||||
from SYS.result_table import Table
|
||||
from plugins.mpv.mpv_ipc import MPV
|
||||
@@ -566,34 +566,32 @@ def _iter_provider_hook_candidates(
|
||||
providers: List[Any] = []
|
||||
seen: set[str] = set()
|
||||
|
||||
for target in targets or ():
|
||||
try:
|
||||
provider = get_plugin_for_url(str(target or ""), config or {})
|
||||
except Exception:
|
||||
provider = None
|
||||
def _append_provider(provider: Any) -> None:
|
||||
if provider is None:
|
||||
continue
|
||||
return
|
||||
name = str(getattr(provider, "name", "") or "").strip().lower()
|
||||
if name and name not in seen:
|
||||
seen.add(name)
|
||||
providers.append(provider)
|
||||
|
||||
try:
|
||||
provider_names = list_plugin_names_with_capability(capability)
|
||||
except Exception:
|
||||
provider_names = []
|
||||
for target in targets or ():
|
||||
try:
|
||||
provider = get_plugin_for_url(str(target or ""), config or {})
|
||||
except Exception:
|
||||
provider = None
|
||||
_append_provider(provider)
|
||||
|
||||
for provider_name in provider_names:
|
||||
fallback_provider_names = {
|
||||
"pipe-item-context": ("hydrusnetwork",),
|
||||
"playlist-store": ("hydrusnetwork",),
|
||||
}.get(str(capability or "").strip().lower(), ())
|
||||
|
||||
for provider_name in fallback_provider_names:
|
||||
try:
|
||||
provider = get_plugin(provider_name, config or {})
|
||||
except Exception:
|
||||
provider = None
|
||||
if provider is None:
|
||||
continue
|
||||
name = str(getattr(provider, "name", provider_name) or provider_name).strip().lower()
|
||||
if name and name not in seen:
|
||||
seen.add(name)
|
||||
providers.append(provider)
|
||||
_append_provider(provider)
|
||||
|
||||
return providers
|
||||
|
||||
|
||||
@@ -608,6 +608,7 @@ def title_hint_from_url_slug(u: str) -> str:
|
||||
|
||||
class OpenLibrary(Provider):
|
||||
|
||||
SUPPORTED_CMDLETS = frozenset({"download-file", "search-file"})
|
||||
TABLE_AUTO_STAGES = {
|
||||
"openlibrary.edition": ["download-file"],
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ def _get_podcastindex_credentials(config: Dict[str, Any]) -> Tuple[str, str]:
|
||||
class PodcastIndex(Provider):
|
||||
"""Search provider for PodcastIndex.org."""
|
||||
|
||||
SUPPORTED_CMDLETS = frozenset({"search-file"})
|
||||
TABLE_AUTO_STAGES = {
|
||||
"podcastindex": ["download-file"],
|
||||
"podcastindex.episodes": ["download-file"],
|
||||
|
||||
@@ -74,6 +74,7 @@ def _unique_path(path: Path) -> Path:
|
||||
class SCP(Provider):
|
||||
PLUGIN_NAME = "scp"
|
||||
URL = ("scp://", "sftp://")
|
||||
SUPPORTED_CMDLETS = frozenset({"add-file", "download-file", "search-file"})
|
||||
|
||||
@property
|
||||
def label(self) -> str:
|
||||
|
||||
@@ -266,6 +266,7 @@ def _suppress_aioslsk_noise() -> Any:
|
||||
|
||||
class Soulseek(Provider):
|
||||
|
||||
SUPPORTED_CMDLETS = frozenset({"download-file", "search-file"})
|
||||
TABLE_AUTO_STAGES = {
|
||||
"soulseek": ["download-file", "-plugin", "soulseek"],
|
||||
}
|
||||
|
||||
@@ -151,6 +151,7 @@ class Telegram(Provider):
|
||||
bot_token=
|
||||
"""
|
||||
URL = ("t.me", "telegram.me")
|
||||
SUPPORTED_CMDLETS = frozenset({"download-file"})
|
||||
|
||||
@classmethod
|
||||
def config_schema(cls) -> List[Dict[str, Any]]:
|
||||
|
||||
@@ -65,6 +65,7 @@ def _format_total_seconds(seconds: Any) -> str:
|
||||
|
||||
class Tidal(Provider):
|
||||
PLUGIN_NAME = "tidal"
|
||||
SUPPORTED_CMDLETS = frozenset({"download-file", "search-file"})
|
||||
|
||||
TABLE_AUTO_STAGES = {
|
||||
"tidal.track": ["download-file"],
|
||||
|
||||
@@ -361,6 +361,7 @@ class ApiBayScraper(Scraper):
|
||||
|
||||
class Torrent(Provider):
|
||||
TABLE_AUTO_STAGES = {"torrent": ["download-file"]}
|
||||
SUPPORTED_CMDLETS = frozenset({"search-file"})
|
||||
|
||||
@property
|
||||
def preserve_order(self) -> bool:
|
||||
|
||||
@@ -52,6 +52,7 @@ class Vimm(TablePluginMixin, Provider):
|
||||
The code below implements these choices (and contains inline comments
|
||||
explaining specific decisions)."""
|
||||
|
||||
SUPPORTED_CMDLETS = frozenset({"download-file", "search-file"})
|
||||
URL = ("https://vimm.net/vault/",)
|
||||
URL_DOMAINS = ("vimm.net",)
|
||||
|
||||
|
||||
@@ -508,6 +508,7 @@ class ytdlp(TablePluginMixin, Provider):
|
||||
PLUGIN_NAME = "ytdlp"
|
||||
PLUGIN_ALIASES = ("youtube",)
|
||||
SEARCH_QUERY_KEYS = ("search", "q")
|
||||
SUPPORTED_CMDLETS = frozenset({"download-file", "search-file"})
|
||||
|
||||
@staticmethod
|
||||
def config_schema() -> List[Dict[str, Any]]:
|
||||
|
||||
@@ -13,6 +13,7 @@ class ZeroXZero(Provider):
|
||||
|
||||
PLUGIN_NAME = "0x0"
|
||||
PLUGIN_ALIASES = ("zeroxzero",)
|
||||
SUPPORTED_CMDLETS = frozenset({"add-file"})
|
||||
|
||||
def upload(self, file_path: str, **kwargs: Any) -> str:
|
||||
from API.HTTP import HTTPClient
|
||||
|
||||
Reference in New Issue
Block a user