vega-cli 0.1.3__tar.gz → 0.1.4__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 (93) hide show
  1. {vega_cli-0.1.3 → vega_cli-0.1.4}/PKG-INFO +1 -1
  2. {vega_cli-0.1.3 → vega_cli-0.1.4}/pyproject.toml +1 -1
  3. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/display.py +1 -1
  4. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/images.py +28 -14
  5. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli.egg-info/PKG-INFO +1 -1
  6. {vega_cli-0.1.3 → vega_cli-0.1.4}/README.md +0 -0
  7. {vega_cli-0.1.3 → vega_cli-0.1.4}/setup.cfg +0 -0
  8. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/__init__.py +0 -0
  9. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/__main__.py +0 -0
  10. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/cli.py +0 -0
  11. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/config.py +0 -0
  12. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/downloader.py +0 -0
  13. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/history.py +0 -0
  14. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/html.py +0 -0
  15. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/interactive.py +0 -0
  16. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/player.py +0 -0
  17. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/__init__.py +0 -0
  18. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/ani_dream.py +0 -0
  19. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/anikoto.py +0 -0
  20. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/animesalt.py +0 -0
  21. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/animesub.py +0 -0
  22. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/animeworld.py +0 -0
  23. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/auto_embed.py +0 -0
  24. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/castle.py +0 -0
  25. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/cncverse.py +0 -0
  26. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/__init__.py +0 -0
  27. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/aes.py +0 -0
  28. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/aniskip.py +0 -0
  29. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/base_url.py +0 -0
  30. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/cinemeta.py +0 -0
  31. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/errors.py +0 -0
  32. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/__init__.py +0 -0
  33. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/abbasy.py +0 -0
  34. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/buzzheavier.py +0 -0
  35. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/cinejoy.py +0 -0
  36. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/gdflix.py +0 -0
  37. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/gofile.py +0 -0
  38. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/hubcloud.py +0 -0
  39. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/movy.py +0 -0
  40. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/st111477.py +0 -0
  41. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/transferit.py +0 -0
  42. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/vegadrive.py +0 -0
  43. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/vidstuck.py +0 -0
  44. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/zcloud.py +0 -0
  45. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/extractors/zypter.py +0 -0
  46. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/headers.py +0 -0
  47. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/http.py +0 -0
  48. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/net_mirror.py +0 -0
  49. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/theintrodb.py +0 -0
  50. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/common/unpack.py +0 -0
  51. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/disney_mirror.py +0 -0
  52. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/dramacool.py +0 -0
  53. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/drive.py +0 -0
  54. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/durbin_live.py +0 -0
  55. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/eon_movies.py +0 -0
  56. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/extraflix.py +0 -0
  57. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/four_khdhub.py +0 -0
  58. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/goku_hd.py +0 -0
  59. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/hdhub4u.py +0 -0
  60. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/internet_archive.py +0 -0
  61. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/kartoons.py +0 -0
  62. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/kartoons2.py +0 -0
  63. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/katmovies.py +0 -0
  64. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/kick_ass_anime.py +0 -0
  65. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/kiss_kh.py +0 -0
  66. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/live_tg_tv.py +0 -0
  67. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/lux_movies.py +0 -0
  68. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/mod.py +0 -0
  69. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/movie_box_web.py +0 -0
  70. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/movielinkdb.py +0 -0
  71. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/movies4u.py +0 -0
  72. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/moviezwap.py +0 -0
  73. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/mxplayer.py +0 -0
  74. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/netflix_mirror.py +0 -0
  75. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/one_cinevood.py +0 -0
  76. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/prime_mirror.py +0 -0
  77. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/rareanimes.py +0 -0
  78. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/registry.py +0 -0
  79. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/showbox.py +0 -0
  80. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/topmovies.py +0 -0
  81. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/torrentio.py +0 -0
  82. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/uhd.py +0 -0
  83. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/vega.py +0 -0
  84. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/youtube.py +0 -0
  85. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/providers/zeefliz.py +0 -0
  86. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/search_all.py +0 -0
  87. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/store.py +0 -0
  88. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli/utils.py +0 -0
  89. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli.egg-info/SOURCES.txt +0 -0
  90. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli.egg-info/dependency_links.txt +0 -0
  91. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli.egg-info/entry_points.txt +0 -0
  92. {vega_cli-0.1.3 → vega_cli-0.1.4}/vega_cli.egg-info/requires.txt +0 -0
  93. {vega_cli-0.1.3 → vega_cli-0.1.4}/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.1.3
3
+ Version: 0.1.4
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.1.3"
7
+ version = "0.1.4"
8
8
  description = "Pure-Python CLI for Vega streaming and download providers"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -240,7 +240,7 @@ def print_meta(info: dict[str, Any], *, show_image: bool = True) -> None:
240
240
  if show_image:
241
241
  poster_url = info.get("poster") or info.get("image") or ""
242
242
  if poster_url:
243
- render_image_url(poster_url, width=36, height=20)
243
+ render_image_url(poster_url, width=64, height=32)
244
244
  console.print(
245
245
  Panel(
246
246
  f"[bold]{info.get('title', '')}[/bold] ({info.get('type', '')})\n"
@@ -1,40 +1,52 @@
1
- """Cross-platform terminal image renderer (Kitty, iTerm2/WezTerm, and 24-bit half-block fallback)."""
1
+ """Cross-platform terminal image renderer (Kitty, iTerm2/WezTerm/Warp, and 24-bit half-block fallback)."""
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
5
  import base64
6
6
  import io
7
7
  import os
8
+ import shutil
8
9
  import sys
9
10
  from typing import Any
10
11
 
11
12
  import requests
12
- from PIL import Image
13
+ from PIL import Image, ImageEnhance
13
14
 
14
15
  from .config import DEFAULT_HEADERS
15
16
 
16
17
 
17
18
  def _detect_protocol() -> str:
18
19
  """Detect the best supported image protocol for the current terminal."""
20
+ override = os.environ.get("VEGA_IMAGE_PROTOCOL", "").strip().lower()
21
+ if override in ("kitty", "iterm2", "halfblock"):
22
+ return override
23
+
19
24
  term_program = os.environ.get("TERM_PROGRAM", "")
20
25
  term = os.environ.get("TERM", "")
21
26
  lc_terminal = os.environ.get("LC_TERMINAL", "")
22
27
 
23
- if os.environ.get("KITTY_WINDOW_ID") or "kitty" in term.lower() or term_program.lower() == "ghostty":
28
+ if (
29
+ os.environ.get("KITTY_WINDOW_ID")
30
+ or "kitty" in term.lower()
31
+ or term_program.lower() == "ghostty"
32
+ ):
24
33
  return "kitty"
25
- if term_program in ("iTerm.app", "WezTerm", "mintty") or lc_terminal == "iTerm2":
34
+ if (
35
+ term_program in ("iTerm.app", "WezTerm", "WarpTerminal", "mintty")
36
+ or lc_terminal == "iTerm2"
37
+ ):
26
38
  return "iterm2"
27
39
  return "halfblock"
28
40
 
29
41
 
30
- def _emit_iterm2(raw_bytes: bytes, cols: int = 30) -> None:
42
+ def _emit_iterm2(raw_bytes: bytes, cols: int = 44) -> None:
31
43
  b64 = base64.b64encode(raw_bytes).decode("ascii")
32
44
  seq = f"\x1b]1337;File=inline=1;width={cols};preserveAspectRatio=1:{b64}\x07\n"
33
45
  sys.stdout.write(seq)
34
46
  sys.stdout.flush()
35
47
 
36
48
 
37
- def _emit_kitty(img: Image.Image, cols: int = 30) -> None:
49
+ def _emit_kitty(img: Image.Image, cols: int = 44) -> None:
38
50
  buf = io.BytesIO()
39
51
  img.convert("RGBA").save(buf, format="PNG")
40
52
  b64 = base64.b64encode(buf.getvalue()).decode("ascii")
@@ -50,15 +62,16 @@ def _emit_kitty(img: Image.Image, cols: int = 30) -> None:
50
62
  sys.stdout.flush()
51
63
 
52
64
 
53
- def render_halfblock(img: Image.Image, max_width: int = 44, max_height: int = 24) -> str:
54
- """Render a PIL Image as 24-bit ANSI Unicode half-block art (cross-platform)."""
65
+ def render_halfblock(img: Image.Image, max_width: int = 64, max_height: int = 32) -> str:
66
+ """Render a PIL Image as crisp 24-bit ANSI Unicode half-block art (cross-platform)."""
55
67
  rgb = img.convert("RGB")
56
68
  w, h = rgb.size
57
69
  if w <= 0 or h <= 0:
58
70
  return ""
59
71
 
60
- # Each terminal row holds 2 vertical pixels (top + bottom half-block).
61
- target_w = min(max_width, w)
72
+ term_cols = shutil.get_terminal_size((80, 24)).columns
73
+ capped_w = max(16, min(max_width, term_cols - 2, w))
74
+ target_w = capped_w
62
75
  target_h = max(2, int(round((h / w) * target_w)))
63
76
  if target_h > max_height * 2:
64
77
  target_h = max_height * 2
@@ -67,6 +80,7 @@ def render_halfblock(img: Image.Image, max_width: int = 44, max_height: int = 24
67
80
  target_h += 1
68
81
 
69
82
  resized = rgb.resize((target_w, target_h), Image.Resampling.LANCZOS)
83
+ resized = ImageEnhance.Sharpness(resized).enhance(1.35)
70
84
  pixels: Any = resized.load()
71
85
  lines: list[str] = []
72
86
  for y in range(0, target_h, 2):
@@ -83,8 +97,8 @@ def render_halfblock(img: Image.Image, max_width: int = 44, max_height: int = 24
83
97
  def render_image_url(
84
98
  url: str,
85
99
  *,
86
- width: int = 36,
87
- height: int = 22,
100
+ width: int = 64,
101
+ height: int = 32,
88
102
  timeout: float = 5.0,
89
103
  ) -> bool:
90
104
  """Fetch an image URL and render it in the terminal. Returns True on success."""
@@ -106,10 +120,10 @@ def render_image_url(
106
120
 
107
121
  proto = _detect_protocol()
108
122
  if proto == "iterm2":
109
- _emit_iterm2(raw, cols=width)
123
+ _emit_iterm2(raw, cols=min(width, 44))
110
124
  return True
111
125
  if proto == "kitty":
112
- _emit_kitty(img, cols=width)
126
+ _emit_kitty(img, cols=min(width, 44))
113
127
  return True
114
128
 
115
129
  art = render_halfblock(img, max_width=width, max_height=height)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vega-cli
3
- Version: 0.1.3
3
+ Version: 0.1.4
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