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.
Files changed (94) hide show
  1. {vega_cli-0.2.0 → vega_cli-0.2.1}/PKG-INFO +1 -1
  2. {vega_cli-0.2.0 → vega_cli-0.2.1}/pyproject.toml +1 -1
  3. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/cli.py +23 -1
  4. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/downloader.py +61 -1
  5. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/PKG-INFO +1 -1
  6. {vega_cli-0.2.0 → vega_cli-0.2.1}/README.md +0 -0
  7. {vega_cli-0.2.0 → vega_cli-0.2.1}/setup.cfg +0 -0
  8. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/__init__.py +0 -0
  9. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/__main__.py +0 -0
  10. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/config.py +0 -0
  11. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/display.py +0 -0
  12. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/gui.py +0 -0
  13. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/history.py +0 -0
  14. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/html.py +0 -0
  15. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/images.py +0 -0
  16. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/interactive.py +0 -0
  17. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/player.py +0 -0
  18. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/__init__.py +0 -0
  19. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/ani_dream.py +0 -0
  20. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/anikoto.py +0 -0
  21. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/animesalt.py +0 -0
  22. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/animesub.py +0 -0
  23. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/animeworld.py +0 -0
  24. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/auto_embed.py +0 -0
  25. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/castle.py +0 -0
  26. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/cncverse.py +0 -0
  27. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/__init__.py +0 -0
  28. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/aes.py +0 -0
  29. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/aniskip.py +0 -0
  30. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/base_url.py +0 -0
  31. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/cinemeta.py +0 -0
  32. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/errors.py +0 -0
  33. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/__init__.py +0 -0
  34. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/abbasy.py +0 -0
  35. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/buzzheavier.py +0 -0
  36. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/cinejoy.py +0 -0
  37. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/gdflix.py +0 -0
  38. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/gofile.py +0 -0
  39. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/hubcloud.py +0 -0
  40. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/movy.py +0 -0
  41. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/st111477.py +0 -0
  42. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/transferit.py +0 -0
  43. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/vegadrive.py +0 -0
  44. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/vidstuck.py +0 -0
  45. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/zcloud.py +0 -0
  46. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/extractors/zypter.py +0 -0
  47. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/headers.py +0 -0
  48. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/http.py +0 -0
  49. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/net_mirror.py +0 -0
  50. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/theintrodb.py +0 -0
  51. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/common/unpack.py +0 -0
  52. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/disney_mirror.py +0 -0
  53. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/dramacool.py +0 -0
  54. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/drive.py +0 -0
  55. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/durbin_live.py +0 -0
  56. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/eon_movies.py +0 -0
  57. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/extraflix.py +0 -0
  58. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/four_khdhub.py +0 -0
  59. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/goku_hd.py +0 -0
  60. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/hdhub4u.py +0 -0
  61. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/internet_archive.py +0 -0
  62. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/kartoons.py +0 -0
  63. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/kartoons2.py +0 -0
  64. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/katmovies.py +0 -0
  65. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/kick_ass_anime.py +0 -0
  66. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/kiss_kh.py +0 -0
  67. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/live_tg_tv.py +0 -0
  68. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/lux_movies.py +0 -0
  69. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/mod.py +0 -0
  70. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/movie_box_web.py +0 -0
  71. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/movielinkdb.py +0 -0
  72. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/movies4u.py +0 -0
  73. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/moviezwap.py +0 -0
  74. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/mxplayer.py +0 -0
  75. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/netflix_mirror.py +0 -0
  76. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/one_cinevood.py +0 -0
  77. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/prime_mirror.py +0 -0
  78. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/rareanimes.py +0 -0
  79. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/registry.py +0 -0
  80. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/showbox.py +0 -0
  81. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/topmovies.py +0 -0
  82. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/torrentio.py +0 -0
  83. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/uhd.py +0 -0
  84. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/vega.py +0 -0
  85. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/youtube.py +0 -0
  86. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/providers/zeefliz.py +0 -0
  87. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/search_all.py +0 -0
  88. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/store.py +0 -0
  89. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli/utils.py +0 -0
  90. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/SOURCES.txt +0 -0
  91. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/dependency_links.txt +0 -0
  92. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/entry_points.txt +0 -0
  93. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/requires.txt +0 -0
  94. {vega_cli-0.2.0 → vega_cli-0.2.1}/vega_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vega-cli
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Pure-Python CLI for Vega streaming and download providers
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "vega-cli"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "Pure-Python CLI for Vega streaming and download providers"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -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
- def download_backend_cmd(backend: str | None, custom_cmd: str | None) -> None:
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; falling back to built-in downloader.[/yellow]"
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]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vega-cli
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Pure-Python CLI for Vega streaming and download providers
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
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