vega-cli 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vega_cli-0.2.0 → vega_cli-0.2.1}/PKG-INFO +1 -1
- {vega_cli-0.2.0 → vega_cli-0.2.1}/pyproject.toml +1 -1
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/cli.py +23 -1
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/downloader.py +61 -1
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/PKG-INFO +1 -1
- {vega_cli-0.2.0 → vega_cli-0.2.1}/README.md +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/setup.cfg +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/__init__.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/__main__.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/config.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/display.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/gui.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/history.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/html.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/images.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/interactive.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/player.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/__init__.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/ani_dream.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/anikoto.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/animesalt.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/animesub.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/animeworld.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/auto_embed.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/castle.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/cncverse.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/__init__.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/aes.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/aniskip.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/base_url.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/cinemeta.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/errors.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/__init__.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/abbasy.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/buzzheavier.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/cinejoy.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/gdflix.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/gofile.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/hubcloud.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/movy.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/st111477.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/transferit.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/vegadrive.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/vidstuck.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/zcloud.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/zypter.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/headers.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/http.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/net_mirror.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/theintrodb.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/unpack.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/disney_mirror.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/dramacool.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/drive.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/durbin_live.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/eon_movies.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/extraflix.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/four_khdhub.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/goku_hd.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/hdhub4u.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/internet_archive.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/kartoons.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/kartoons2.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/katmovies.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/kick_ass_anime.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/kiss_kh.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/live_tg_tv.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/lux_movies.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/mod.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/movie_box_web.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/movielinkdb.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/movies4u.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/moviezwap.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/mxplayer.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/netflix_mirror.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/one_cinevood.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/prime_mirror.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/rareanimes.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/registry.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/showbox.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/topmovies.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/torrentio.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/uhd.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/vega.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/youtube.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/zeefliz.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/search_all.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/store.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/utils.py +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/SOURCES.txt +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/dependency_links.txt +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/entry_points.txt +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/requires.txt +0 -0
- {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/top_level.txt +0 -0
|
@@ -27,9 +27,12 @@ from .downloader import (
|
|
|
27
27
|
get_custom_download_cmd,
|
|
28
28
|
get_default_download_dir,
|
|
29
29
|
get_download_backend,
|
|
30
|
+
get_mdm_config,
|
|
31
|
+
pair_mdm,
|
|
30
32
|
set_custom_download_cmd,
|
|
31
33
|
set_default_download_dir,
|
|
32
34
|
set_download_backend,
|
|
35
|
+
set_mdm_config,
|
|
33
36
|
)
|
|
34
37
|
from .history import HistoryStore
|
|
35
38
|
from .html import parse_html
|
|
@@ -400,9 +403,25 @@ def download_dir_cmd(path: str | None, reset: bool) -> None:
|
|
|
400
403
|
default=None,
|
|
401
404
|
help="Command template for 'custom' backend (supports {url}, {dir}, {file}, {title}).",
|
|
402
405
|
)
|
|
403
|
-
|
|
406
|
+
@click.option("--mdm-url", default=None, help="MDM Remote Control API URL (e.g. https://127.0.0.1:8463).")
|
|
407
|
+
@click.option("--mdm-code", default=None, help="Pairing code shown by MDM to obtain a Bearer token.")
|
|
408
|
+
@click.option("--mdm-token", default=None, help="MDM Bearer token (if already paired).")
|
|
409
|
+
def download_backend_cmd(
|
|
410
|
+
backend: str | None,
|
|
411
|
+
custom_cmd: str | None,
|
|
412
|
+
mdm_url: str | None,
|
|
413
|
+
mdm_code: str | None,
|
|
414
|
+
mdm_token: str | None,
|
|
415
|
+
) -> None:
|
|
404
416
|
"""View or configure default download backend (python, aria2c, wget, mdm, custom)."""
|
|
405
417
|
kv = KVStore()
|
|
418
|
+
if mdm_url and mdm_code:
|
|
419
|
+
token = pair_mdm(mdm_url, mdm_code, kv)
|
|
420
|
+
console.print(f"[green]Paired with MDM at {mdm_url} (token saved: {token[:8]}...).[/green]")
|
|
421
|
+
elif mdm_url or mdm_token:
|
|
422
|
+
cur_url, cur_tok = get_mdm_config(kv)
|
|
423
|
+
set_mdm_config(mdm_url or cur_url, mdm_token or cur_tok, kv)
|
|
424
|
+
console.print("[green]Saved MDM Remote API configuration.[/green]")
|
|
406
425
|
if custom_cmd is not None:
|
|
407
426
|
saved_cmd = set_custom_download_cmd(custom_cmd, kv)
|
|
408
427
|
console.print(f"[green]Custom download command set to:[/green] {saved_cmd}")
|
|
@@ -414,6 +433,9 @@ def download_backend_cmd(backend: str | None, custom_cmd: str | None) -> None:
|
|
|
414
433
|
cur_cmd = get_custom_download_cmd(kv)
|
|
415
434
|
if cur_cmd:
|
|
416
435
|
console.print(f"Custom command: [cyan]{cur_cmd}[/cyan]")
|
|
436
|
+
m_url, m_tok = get_mdm_config(kv)
|
|
437
|
+
if m_url:
|
|
438
|
+
console.print(f"MDM Remote API: [cyan]{m_url}[/cyan] (paired={bool(m_tok)})")
|
|
417
439
|
|
|
418
440
|
|
|
419
441
|
@cli.command()
|
|
@@ -33,6 +33,8 @@ console = Console()
|
|
|
33
33
|
_DOWNLOAD_DIR_KEY = "vega_download_dir"
|
|
34
34
|
_DOWNLOAD_BACKEND_KEY = "vega_download_backend"
|
|
35
35
|
_DOWNLOAD_CUSTOM_CMD_KEY = "vega_download_custom_cmd"
|
|
36
|
+
_MDM_URL_KEY = "vega_mdm_url"
|
|
37
|
+
_MDM_TOKEN_KEY = "vega_mdm_token"
|
|
36
38
|
DOWNLOAD_BACKENDS = ("python", "aria2c", "wget", "mdm", "custom")
|
|
37
39
|
_DOWNLOAD_BACKEND_KEY = "vega_download_backend"
|
|
38
40
|
_DOWNLOAD_CUSTOM_CMD_KEY = "vega_download_custom_cmd"
|
|
@@ -73,6 +75,44 @@ def set_custom_download_cmd(cmd: str, kv: KVStore | None = None) -> str:
|
|
|
73
75
|
return cleaned
|
|
74
76
|
|
|
75
77
|
|
|
78
|
+
def get_mdm_config(kv: KVStore | None = None) -> tuple[str, str]:
|
|
79
|
+
"""Return (mdm_url, mdm_token) from KVStore."""
|
|
80
|
+
store = kv or KVStore()
|
|
81
|
+
return (
|
|
82
|
+
str(store.get(_MDM_URL_KEY, "") or "").strip(),
|
|
83
|
+
str(store.get(_MDM_TOKEN_KEY, "") or "").strip(),
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def set_mdm_config(url: str, token: str = "", kv: KVStore | None = None) -> tuple[str, str]:
|
|
88
|
+
"""Persist MDM Remote API URL and Bearer token in KVStore."""
|
|
89
|
+
store = kv or KVStore()
|
|
90
|
+
clean_url = url.strip().rstrip("/")
|
|
91
|
+
clean_token = token.strip()
|
|
92
|
+
store.set(_MDM_URL_KEY, clean_url)
|
|
93
|
+
if clean_token:
|
|
94
|
+
store.set(_MDM_TOKEN_KEY, clean_token)
|
|
95
|
+
return clean_url, clean_token
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def pair_mdm(url: str, code: str, kv: KVStore | None = None) -> str:
|
|
99
|
+
"""Pair with an MDM Remote Control API (POST /api/pair) and save the Bearer token."""
|
|
100
|
+
base = url.strip().rstrip("/")
|
|
101
|
+
resp = requests.post(
|
|
102
|
+
f"{base}/api/pair",
|
|
103
|
+
json={"code": str(code).strip(), "name": "Vega CLI"},
|
|
104
|
+
timeout=15,
|
|
105
|
+
verify=False,
|
|
106
|
+
)
|
|
107
|
+
resp.raise_for_status()
|
|
108
|
+
data = resp.json() or {}
|
|
109
|
+
token = data.get("token")
|
|
110
|
+
if not isinstance(token, str) or not token:
|
|
111
|
+
raise RuntimeError(f"MDM pairing failed: {data}")
|
|
112
|
+
set_mdm_config(base, token, kv)
|
|
113
|
+
return token
|
|
114
|
+
|
|
115
|
+
|
|
76
116
|
def get_default_download_dir(kv: KVStore | None = None) -> Path:
|
|
77
117
|
"""Return configured default download directory, or ~/Downloads."""
|
|
78
118
|
store = kv or KVStore()
|
|
@@ -322,10 +362,30 @@ def _run_external_backend(
|
|
|
322
362
|
return True
|
|
323
363
|
|
|
324
364
|
if backend == "mdm":
|
|
365
|
+
mdm_url, mdm_token = get_mdm_config()
|
|
366
|
+
if mdm_url and mdm_token:
|
|
367
|
+
resp = requests.post(
|
|
368
|
+
f"{mdm_url}/api/add",
|
|
369
|
+
headers={
|
|
370
|
+
"Content-Type": "application/json",
|
|
371
|
+
"Authorization": f"Bearer {mdm_token}",
|
|
372
|
+
},
|
|
373
|
+
json={"url": url, "start": True},
|
|
374
|
+
timeout=15,
|
|
375
|
+
verify=False,
|
|
376
|
+
)
|
|
377
|
+
resp.raise_for_status()
|
|
378
|
+
data = resp.json() or {}
|
|
379
|
+
if data.get("error"):
|
|
380
|
+
raise RuntimeError(f"MDM API error: {data['error']}")
|
|
381
|
+
console.print(f"[cyan]Sent to MDM Remote API:[/cyan] {target_file.name}")
|
|
382
|
+
return True
|
|
383
|
+
|
|
325
384
|
mdm_bin = _find_mdm()
|
|
326
385
|
if not mdm_bin:
|
|
327
386
|
console.print(
|
|
328
|
-
"[yellow]MisterDownloadManager not found
|
|
387
|
+
"[yellow]MisterDownloadManager not found (nor MDM Remote API configured); "
|
|
388
|
+
"falling back to built-in downloader.[/yellow]"
|
|
329
389
|
)
|
|
330
390
|
return False
|
|
331
391
|
cmd = [mdm_bin, "/d", url, "/p", str(target_dir), "/f", target_file.name]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|