vega-cli 0.1.0__py3-none-any.whl

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 (84) hide show
  1. vega_cli/__init__.py +1 -0
  2. vega_cli/__main__.py +6 -0
  3. vega_cli/cli.py +247 -0
  4. vega_cli/config.py +99 -0
  5. vega_cli/display.py +138 -0
  6. vega_cli/html.py +540 -0
  7. vega_cli/interactive.py +220 -0
  8. vega_cli/player.py +82 -0
  9. vega_cli/providers/__init__.py +13 -0
  10. vega_cli/providers/ani_dream.py +1089 -0
  11. vega_cli/providers/anikoto.py +820 -0
  12. vega_cli/providers/animesalt.py +649 -0
  13. vega_cli/providers/animesub.py +1374 -0
  14. vega_cli/providers/animeworld.py +504 -0
  15. vega_cli/providers/auto_embed.py +479 -0
  16. vega_cli/providers/castle.py +497 -0
  17. vega_cli/providers/cncverse.py +873 -0
  18. vega_cli/providers/common/__init__.py +51 -0
  19. vega_cli/providers/common/aes.py +152 -0
  20. vega_cli/providers/common/aniskip.py +186 -0
  21. vega_cli/providers/common/base_url.py +102 -0
  22. vega_cli/providers/common/cinemeta.py +231 -0
  23. vega_cli/providers/common/errors.py +25 -0
  24. vega_cli/providers/common/extractors/__init__.py +23 -0
  25. vega_cli/providers/common/extractors/abbasy.py +247 -0
  26. vega_cli/providers/common/extractors/buzzheavier.py +72 -0
  27. vega_cli/providers/common/extractors/cinejoy.py +33 -0
  28. vega_cli/providers/common/extractors/gdflix.py +170 -0
  29. vega_cli/providers/common/extractors/gofile.py +167 -0
  30. vega_cli/providers/common/extractors/hubcloud.py +277 -0
  31. vega_cli/providers/common/extractors/movy.py +349 -0
  32. vega_cli/providers/common/extractors/st111477.py +139 -0
  33. vega_cli/providers/common/extractors/transferit.py +53 -0
  34. vega_cli/providers/common/extractors/vegadrive.py +161 -0
  35. vega_cli/providers/common/extractors/vidstuck.py +379 -0
  36. vega_cli/providers/common/extractors/zcloud.py +158 -0
  37. vega_cli/providers/common/extractors/zypter.py +72 -0
  38. vega_cli/providers/common/headers.py +25 -0
  39. vega_cli/providers/common/http.py +121 -0
  40. vega_cli/providers/common/net_mirror.py +1494 -0
  41. vega_cli/providers/common/theintrodb.py +112 -0
  42. vega_cli/providers/common/unpack.py +54 -0
  43. vega_cli/providers/disney_mirror.py +31 -0
  44. vega_cli/providers/dramacool.py +297 -0
  45. vega_cli/providers/drive.py +695 -0
  46. vega_cli/providers/durbin_live.py +354 -0
  47. vega_cli/providers/eon_movies.py +752 -0
  48. vega_cli/providers/extraflix.py +701 -0
  49. vega_cli/providers/four_khdhub.py +307 -0
  50. vega_cli/providers/goku_hd.py +336 -0
  51. vega_cli/providers/hdhub4u.py +665 -0
  52. vega_cli/providers/internet_archive.py +552 -0
  53. vega_cli/providers/kartoons.py +642 -0
  54. vega_cli/providers/kartoons2.py +395 -0
  55. vega_cli/providers/katmovies.py +816 -0
  56. vega_cli/providers/kick_ass_anime.py +445 -0
  57. vega_cli/providers/kiss_kh.py +490 -0
  58. vega_cli/providers/live_tg_tv.py +540 -0
  59. vega_cli/providers/lux_movies.py +650 -0
  60. vega_cli/providers/mod.py +676 -0
  61. vega_cli/providers/movie_box_web.py +921 -0
  62. vega_cli/providers/movielinkdb.py +734 -0
  63. vega_cli/providers/movies4u.py +580 -0
  64. vega_cli/providers/moviezwap.py +199 -0
  65. vega_cli/providers/mxplayer.py +470 -0
  66. vega_cli/providers/netflix_mirror.py +32 -0
  67. vega_cli/providers/one_cinevood.py +596 -0
  68. vega_cli/providers/prime_mirror.py +31 -0
  69. vega_cli/providers/rareanimes.py +676 -0
  70. vega_cli/providers/registry.py +124 -0
  71. vega_cli/providers/showbox.py +245 -0
  72. vega_cli/providers/topmovies.py +707 -0
  73. vega_cli/providers/torrentio.py +398 -0
  74. vega_cli/providers/uhd.py +483 -0
  75. vega_cli/providers/vega.py +891 -0
  76. vega_cli/providers/youtube.py +566 -0
  77. vega_cli/providers/zeefliz.py +563 -0
  78. vega_cli/store.py +45 -0
  79. vega_cli/utils.py +90 -0
  80. vega_cli-0.1.0.dist-info/METADATA +8 -0
  81. vega_cli-0.1.0.dist-info/RECORD +84 -0
  82. vega_cli-0.1.0.dist-info/WHEEL +5 -0
  83. vega_cli-0.1.0.dist-info/entry_points.txt +2 -0
  84. vega_cli-0.1.0.dist-info/top_level.txt +1 -0
vega_cli/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """Reusable modules for the Vega CLI."""
vega_cli/__main__.py ADDED
@@ -0,0 +1,6 @@
1
+ """Entry point for `python -m vega_cli`."""
2
+
3
+ from .cli import cli
4
+
5
+ if __name__ == "__main__":
6
+ cli()
vega_cli/cli.py ADDED
@@ -0,0 +1,247 @@
1
+ """Pure-Python CLI for all Vega providers."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ from typing import Any
7
+
8
+ import click
9
+
10
+ from .display import (
11
+ console,
12
+ print_catalog,
13
+ print_episodes,
14
+ print_meta,
15
+ print_posts,
16
+ print_providers,
17
+ print_settings,
18
+ print_streams,
19
+ )
20
+ from .html import parse_html
21
+ from .interactive import run_interactive
22
+ from .player import launch_vlc
23
+ from .providers import (
24
+ DriveClient,
25
+ NetflixMirrorClient,
26
+ get_provider,
27
+ list_providers,
28
+ )
29
+ from .store import KVStore
30
+ from .utils import format_season_title, normalize_url, to_relative_path
31
+
32
+ __all__ = [
33
+ "DriveClient",
34
+ "KVStore",
35
+ "NetflixMirrorClient",
36
+ "cli",
37
+ "format_season_title",
38
+ "get_provider",
39
+ "list_providers",
40
+ "normalize_url",
41
+ "parse_html",
42
+ "to_relative_path",
43
+ ]
44
+
45
+ _provider_option = click.option(
46
+ "-p",
47
+ "--provider",
48
+ "provider_name",
49
+ default="drive",
50
+ show_default=True,
51
+ help="Provider ID (see 'providers' command).",
52
+ )
53
+
54
+
55
+ @click.group(invoke_without_command=True)
56
+ @click.pass_context
57
+ def cli(ctx: click.Context) -> None:
58
+ """Python CLI for Vega providers."""
59
+ if ctx.invoked_subcommand is None:
60
+ ctx.invoke(interactive)
61
+
62
+
63
+ @cli.command()
64
+ @click.option("--all", "include_disabled", is_flag=True, help="Include disabled providers.")
65
+ @click.option("--json", "as_json", is_flag=True, help="Output raw JSON.")
66
+ def providers(include_disabled: bool, as_json: bool) -> None:
67
+ """List all available Vega providers."""
68
+ items = list_providers(include_disabled=include_disabled)
69
+ if as_json:
70
+ click.echo(json.dumps(items, indent=2))
71
+ return
72
+ print_providers(items)
73
+
74
+
75
+ @cli.command()
76
+ @_provider_option
77
+ @click.option("--json", "as_json", is_flag=True, help="Output raw JSON.")
78
+ def catalog(provider_name: str, as_json: bool) -> None:
79
+ """List available catalog categories and genres for a provider."""
80
+ client = get_provider(provider_name)
81
+ data = client.get_catalog()
82
+ cat_items = data.get("catalog") or []
83
+ genre_items = data.get("genres") or []
84
+ if as_json:
85
+ click.echo(json.dumps({"catalog": cat_items, "genres": genre_items}, indent=2))
86
+ return
87
+ print_catalog(cat_items, genre_items, title=f"{provider_name} Catalog & Genres")
88
+
89
+
90
+ @cli.command()
91
+ @_provider_option
92
+ @click.option("--filter", "filter_path", default="", help="Category/genre filter path.")
93
+ @click.option("--page", default=1, show_default=True, type=int, help="Page number.")
94
+ @click.option("--json", "as_json", is_flag=True, help="Output raw JSON.")
95
+ def posts(provider_name: str, filter_path: str, page: int, as_json: bool) -> None:
96
+ """Fetch posts for a category or genre filter."""
97
+ client = get_provider(provider_name)
98
+ items = client.get_posts(filter_path=filter_path, page=page)
99
+ if as_json:
100
+ click.echo(json.dumps(items, indent=2))
101
+ return
102
+ print_posts(items, f"[{provider_name}] Posts (filter={filter_path or 'latest'}, page={page})")
103
+
104
+
105
+ @cli.command()
106
+ @_provider_option
107
+ @click.argument("query")
108
+ @click.option("--page", default=1, show_default=True, type=int, help="Page number.")
109
+ @click.option("--json", "as_json", is_flag=True, help="Output raw JSON.")
110
+ def search(provider_name: str, query: str, page: int, as_json: bool) -> None:
111
+ """Search posts on a provider."""
112
+ client = get_provider(provider_name)
113
+ items = client.get_search_posts(query=query, page=page)
114
+ if as_json:
115
+ click.echo(json.dumps(items, indent=2))
116
+ return
117
+ print_posts(items, f"[{provider_name}] Search: '{query}' (page={page})")
118
+
119
+
120
+ @cli.command()
121
+ @_provider_option
122
+ @click.argument("link")
123
+ @click.option("--json", "as_json", is_flag=True, help="Output raw JSON.")
124
+ def meta(provider_name: str, link: str, as_json: bool) -> None:
125
+ """Fetch metadata and download/episode links for a post."""
126
+ client = get_provider(provider_name)
127
+ info = client.get_meta(link)
128
+ if as_json:
129
+ click.echo(json.dumps(info, indent=2))
130
+ return
131
+ print_meta(info)
132
+
133
+
134
+ @cli.command()
135
+ @_provider_option
136
+ @click.argument("url")
137
+ @click.option("--imdb-id", default="", help="Optional IMDb ID for skip timings.")
138
+ @click.option("--season", default=None, type=int, help="Optional season number.")
139
+ @click.option("--json", "as_json", is_flag=True, help="Output raw JSON.")
140
+ def episodes(
141
+ provider_name: str, url: str, imdb_id: str, season: int | None, as_json: bool
142
+ ) -> None:
143
+ """Fetch episode links for a season URL."""
144
+ client = get_provider(provider_name)
145
+ eps = client.get_episodes(url, imdb_id=imdb_id, season=season)
146
+ if as_json:
147
+ click.echo(json.dumps(eps, indent=2))
148
+ return
149
+ print_episodes(eps, title=f"[{provider_name}] Episodes")
150
+
151
+
152
+ @cli.command()
153
+ @_provider_option
154
+ @click.argument("url")
155
+ @click.option("--type", "media_type", default="movie", show_default=True, help="Media type (movie/series).")
156
+ @click.option("--download", "is_download", is_flag=True, help="Sort for download priority.")
157
+ @click.option("--vlc", "open_vlc", is_flag=True, help="Open the top stream in VLC.")
158
+ @click.option("--json", "as_json", is_flag=True, help="Output raw JSON.")
159
+ def stream(
160
+ provider_name: str,
161
+ url: str,
162
+ media_type: str,
163
+ is_download: bool,
164
+ open_vlc: bool,
165
+ as_json: bool,
166
+ ) -> None:
167
+ """Extract stream/download links from a provider link."""
168
+ client = get_provider(provider_name)
169
+ streams = client.get_stream(url, is_download=is_download, media_type=media_type)
170
+ if as_json:
171
+ click.echo(json.dumps(streams, indent=2))
172
+ return
173
+ print_streams(streams, title=f"[{provider_name}] Extracted Streams")
174
+ if open_vlc and streams:
175
+ launch_vlc(streams[0]["link"])
176
+
177
+
178
+ @cli.command()
179
+ @_provider_option
180
+ @click.option("--set", "set_pair", nargs=2, type=str, metavar="KEY VALUE", help="Set a setting.")
181
+ @click.option("--reset", is_flag=True, help="Reset all settings to defaults.")
182
+ @click.option("--json", "as_json", is_flag=True, help="Output raw JSON.")
183
+ def settings(
184
+ provider_name: str,
185
+ set_pair: tuple[str, str] | None,
186
+ reset: bool,
187
+ as_json: bool,
188
+ ) -> None:
189
+ """View or update provider settings (persisted in kvStore)."""
190
+ kv = KVStore()
191
+ client = get_provider(provider_name, kv=kv)
192
+ schema = client.get_settings_schema()
193
+
194
+ if reset:
195
+ kv.clear()
196
+ console.print("[green]Reset all settings to defaults.[/green]")
197
+ return
198
+
199
+ if set_pair:
200
+ key, raw_val = set_pair
201
+ field_schema = next((f for f in schema if f["key"] == key), None)
202
+ if not field_schema:
203
+ raise click.ClickException(
204
+ f"Unknown setting '{key}' for '{provider_name}'. "
205
+ f"Valid keys: {[f['key'] for f in schema]}"
206
+ )
207
+ if field_schema.get("type") == "toggle":
208
+ val: Any = raw_val.lower() in ("1", "true", "yes", "on")
209
+ elif field_schema.get("type") == "select" and field_schema.get("options"):
210
+ valid_vals = [o["value"] for o in field_schema["options"]]
211
+ if raw_val not in valid_vals:
212
+ raise click.ClickException(f"Invalid value '{raw_val}'. Choose from: {valid_vals}")
213
+ val = raw_val
214
+ else:
215
+ val = raw_val
216
+ kv.set(key, val)
217
+ console.print(f"[green]Saved {key} = {val!r}[/green]")
218
+
219
+ current = {
220
+ field["key"]: (
221
+ kv.get(field["key"])
222
+ if kv.get(field["key"]) is not None
223
+ else field.get("defaultValue", "")
224
+ )
225
+ for field in schema
226
+ }
227
+ if as_json:
228
+ click.echo(json.dumps({"schema": schema, "values": current}, indent=2))
229
+ return
230
+ print_settings(schema, current, kv.path, title=f"{provider_name} Settings ({kv.path})")
231
+
232
+
233
+ @cli.command()
234
+ @click.option(
235
+ "-p",
236
+ "--provider",
237
+ "provider_name",
238
+ default=None,
239
+ help="Optional provider ID to launch directly.",
240
+ )
241
+ def interactive(provider_name: str | None) -> None:
242
+ """Launch an interactive search/browse/stream session."""
243
+ run_interactive(provider_name=provider_name)
244
+
245
+
246
+ if __name__ == "__main__":
247
+ cli()
vega_cli/config.py ADDED
@@ -0,0 +1,99 @@
1
+ URLS_ENDPOINT = (
2
+ "https://cdn.jsdelivr.net/gh/Zenda-Cross/vega-providers@main/urls.json"
3
+ )
4
+ CINEMETA_BASE_URL = "https://v3-cinemeta.strem.io/meta"
5
+ THEINTRODB_URL = "https://api.theintrodb.org/v2/media"
6
+
7
+ DEFAULT_HEADERS = {
8
+ "User-Agent": (
9
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
10
+ "AppleWebKit/537.36 (KHTML, like Gecko) "
11
+ "Chrome/129.0.0.0 Safari/537.36"
12
+ ),
13
+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
14
+ }
15
+
16
+ HUBCLOUD_DEFAULT_COOKIE = (
17
+ "ext_name=ojplmecpdpgccookcobabopnaifgidhf; xla=s4t; "
18
+ "cf_clearance=woQrFGXtLfmEMBEiGUsVHrUBMT8s3cmguIzmMjmvpkg-1770053679-1.2.1.1-"
19
+ "xBrQdciOJsweUF6F2T_OtH6jmyanN_TduQ0yslc_XqjU6RcHSxI7.YOKv6ry7oYo64868HYoULnVyww"
20
+ "536H2eVI3R2e4wKzsky6abjPdfQPxqpUaXjxfJ02o6jl3_Vkwr4uiaU7Wy596Vdst3y78HXvVmKdIoh"
21
+ "htPvp.vZ9_L7wvWdce0GRixjh_6JiqWmWMws46hwEt3hboaS1e1e4EoWCvj5b0M_jVwvSxBOAW5emFz"
22
+ "vT3QrnRh4nyYmKDERnY"
23
+ )
24
+
25
+ NETFLIX_MIRROR_DEFAULT_BASE_URL = "https://net52.cc"
26
+
27
+ NETFLIX_MIRROR_CATALOG = [
28
+ {"title": "Only on Netflix", "filter": "Only on Netflix"},
29
+ {"title": "New on Netflix", "filter": "New on Netflix"},
30
+ {"title": "Blockbuster Movies", "filter": "Blockbuster Movies"},
31
+ {"title": "US TV Shows Dubbed in Hindi", "filter": "US TV Shows Dubbed in Hindi"},
32
+ ]
33
+
34
+ CATALOG = [
35
+ {"title": "Latest", "filter": ""},
36
+ {"title": "Anime", "filter": "category/anime/"},
37
+ {"title": "Netflix", "filter": "category/netflix/"},
38
+ {"title": "4K", "filter": "category/2160p-4k/"},
39
+ ]
40
+
41
+ GENRES = [
42
+ {"title": "Action", "filter": "/category/action"},
43
+ {"title": "Crime", "filter": "/category/crime"},
44
+ {"title": "Comedy", "filter": "/category/comedy"},
45
+ {"title": "Drama", "filter": "/category/drama"},
46
+ {"title": "Horror", "filter": "/category/horror"},
47
+ {"title": "Family", "filter": "/category/family"},
48
+ {"title": "Sci-Fi", "filter": "/category/sifi"},
49
+ {"title": "Thriller", "filter": "/category/triller"},
50
+ {"title": "Romance", "filter": "/category/romance"},
51
+ {"title": "Fight", "filter": "/category/fight"},
52
+ ]
53
+
54
+ SETTINGS_SCHEMA = [
55
+ {
56
+ "key": "drive_quickDownload",
57
+ "type": "toggle",
58
+ "label": "Quick Download",
59
+ "description": "Automatically download the preferred server in 1-click",
60
+ "defaultValue": True,
61
+ },
62
+ {
63
+ "key": "drive_preferredDownloadServer",
64
+ "type": "select",
65
+ "label": "Preferred Download Server",
66
+ "description": "Server to prioritize for 1-click quick download",
67
+ "options": [
68
+ {"label": "Auto (Best Available)", "value": "auto"},
69
+ {"label": "CF Worker (Fastest)", "value": "cf worker"},
70
+ {"label": "CF Storage (R2 Direct)", "value": "cf storage"},
71
+ {"label": "GDrive (Google Direct)", "value": "gdrive"},
72
+ {"label": "Pixeldrain", "value": "pixeldrain"},
73
+ {"label": "FastDl", "value": "fastdl"},
74
+ {"label": "HubCdn", "value": "hubcdn"},
75
+ ],
76
+ "defaultValue": "auto",
77
+ },
78
+ {
79
+ "key": "drive_skipTimings",
80
+ "type": "toggle",
81
+ "label": "Skip Timings",
82
+ "description": "Fetch intro and recap timings automatically",
83
+ "defaultValue": True,
84
+ },
85
+ {
86
+ "key": "t_hash_t",
87
+ "type": "text",
88
+ "label": "NetMirror Session Cookie",
89
+ "description": "Verified t_hash_t session cookie for Netflix Mirror",
90
+ "defaultValue": "",
91
+ },
92
+ {
93
+ "key": "baseUrlOverride",
94
+ "type": "text",
95
+ "label": "NetMirror Base URL",
96
+ "description": "Custom Netflix Mirror domain",
97
+ "defaultValue": "https://net52.cc",
98
+ },
99
+ ]
vega_cli/display.py ADDED
@@ -0,0 +1,138 @@
1
+ """Rich console display helpers for Vega CLI."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pathlib import Path
6
+ from typing import Any
7
+
8
+ from rich.console import Console
9
+ from rich.panel import Panel
10
+ from rich.table import Table
11
+
12
+ console = Console()
13
+
14
+
15
+ def print_providers(providers: list[dict[str, Any]]) -> None:
16
+ """Render available Vega providers in a Rich table."""
17
+ table = Table(title=f"Vega Providers ({len(providers)})")
18
+ table.add_column("#", justify="right", style="cyan")
19
+ table.add_column("ID", style="bold green")
20
+ table.add_column("Name", style="bold")
21
+ table.add_column("Type", style="magenta")
22
+ table.add_column("Version", style="cyan")
23
+ table.add_column("Status")
24
+ for idx, p in enumerate(providers, start=1):
25
+ status = "[red]disabled[/red]" if p.get("disabled") else "[green]enabled[/green]"
26
+ table.add_row(
27
+ str(idx),
28
+ p.get("value", ""),
29
+ p.get("display_name", ""),
30
+ p.get("type", ""),
31
+ str(p.get("version", "")),
32
+ status,
33
+ )
34
+ console.print(table)
35
+
36
+
37
+ def print_catalog(
38
+ catalog: list[dict[str, str]],
39
+ genres: list[dict[str, str]],
40
+ *,
41
+ title: str = "Catalog & Genres",
42
+ ) -> None:
43
+ """Render catalog categories and genres in a Rich table."""
44
+ table = Table(title=title)
45
+ table.add_column("Group", style="cyan")
46
+ table.add_column("Title", style="bold")
47
+ table.add_column("Filter", style="green")
48
+ for item in catalog:
49
+ table.add_row("Catalog", item.get("title", ""), item.get("filter") or "(root)")
50
+ for item in genres:
51
+ table.add_row("Genre", item.get("title", ""), item.get("filter", ""))
52
+ console.print(table)
53
+
54
+
55
+ def print_posts(items: list[dict[str, str]], title: str) -> None:
56
+ """Render a list of posts in a Rich table."""
57
+ table = Table(title=title)
58
+ table.add_column("#", justify="right", style="cyan")
59
+ table.add_column("Title", style="bold")
60
+ table.add_column("Link", style="green")
61
+ for idx, item in enumerate(items, start=1):
62
+ table.add_row(str(idx), item.get("title", ""), item.get("link", ""))
63
+ console.print(table)
64
+
65
+
66
+ def print_meta(info: dict[str, Any]) -> None:
67
+ """Render post metadata and available links."""
68
+ console.print(
69
+ Panel(
70
+ f"[bold]{info.get('title', '')}[/bold] ({info.get('type', '')})\n"
71
+ f"IMDb: {info.get('imdbId') or 'N/A'}\n\n"
72
+ f"{info.get('synopsis') or 'No synopsis'}",
73
+ title="Metadata",
74
+ )
75
+ )
76
+ table = Table(title="Available Links")
77
+ table.add_column("#", justify="right", style="cyan")
78
+ table.add_column("Title", style="bold")
79
+ table.add_column("Quality", style="magenta")
80
+ for idx, item in enumerate(info.get("linkList") or [], start=1):
81
+ table.add_row(str(idx), item.get("title", ""), item.get("quality", ""))
82
+ console.print(table)
83
+
84
+
85
+ def print_episodes(episodes: list[dict[str, Any]], title: str = "Episodes") -> None:
86
+ """Render episode links in a Rich table."""
87
+ table = Table(title=title)
88
+ table.add_column("#", justify="right", style="cyan")
89
+ table.add_column("Title", style="bold")
90
+ table.add_column("Link", style="green")
91
+ for idx, ep in enumerate(episodes, start=1):
92
+ table.add_row(str(idx), ep.get("title", ""), ep.get("link", ""))
93
+ console.print(table)
94
+
95
+
96
+ def print_streams(
97
+ streams: list[dict[str, Any]],
98
+ *,
99
+ title: str = "Extracted Streams",
100
+ include_type: bool = True,
101
+ ) -> None:
102
+ """Render extracted stream/download links in a Rich table."""
103
+ table = Table(title=title)
104
+ table.add_column("#", justify="right", style="cyan")
105
+ table.add_column("Server", style="cyan")
106
+ if include_type:
107
+ table.add_column("Type", style="magenta")
108
+ table.add_column("Link", style="green")
109
+ for idx, stream in enumerate(streams, start=1):
110
+ row = [str(idx), stream.get("server", "")]
111
+ if include_type:
112
+ row.append(stream.get("type", ""))
113
+ row.append(stream.get("link", ""))
114
+ table.add_row(*row)
115
+ console.print(table)
116
+
117
+
118
+ def print_settings(
119
+ schema: list[dict[str, Any]],
120
+ current: dict[str, Any],
121
+ store_path: Path,
122
+ *,
123
+ title: str | None = None,
124
+ ) -> None:
125
+ """Render current provider settings in a Rich table."""
126
+ table = Table(title=title or f"Settings ({store_path})")
127
+ table.add_column("Key", style="cyan")
128
+ table.add_column("Label", style="bold")
129
+ table.add_column("Type", style="magenta")
130
+ table.add_column("Value", style="green")
131
+ for field in schema:
132
+ table.add_row(
133
+ field["key"],
134
+ field.get("label", field["key"]),
135
+ field.get("type", "text"),
136
+ str(current[field["key"]]),
137
+ )
138
+ console.print(table)