anipy-cli 3.1.1__py3-none-any.whl → 3.1.3__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.

Potentially problematic release.


This version of anipy-cli might be problematic. Click here for more details.

anipy_cli/__init__.py CHANGED
@@ -1,2 +1,2 @@
1
1
  __appname__ = "anipy-cli"
2
- __version__ = "3.1.1"
2
+ __version__ = "3.1.3"
anipy_cli/arg_parser.py CHANGED
@@ -6,7 +6,7 @@ from typing import Optional, Union
6
6
  from anipy_cli import __version__
7
7
 
8
8
 
9
- @dataclass(frozen=True)
9
+ @dataclass()
10
10
  class CliArgs:
11
11
  download: bool
12
12
  binge: bool
@@ -1,5 +1,6 @@
1
1
  from typing import TYPE_CHECKING, Optional
2
2
 
3
+ from InquirerPy.base.control import Choice
3
4
  from anipy_api.anime import Anime
4
5
  from anipy_api.locallist import LocalList, LocalListEntry
5
6
  from InquirerPy import inquirer
@@ -42,7 +43,10 @@ class HistoryCli(CliBase):
42
43
 
43
44
  entry = inquirer.fuzzy( # type: ignore
44
45
  message="Select History Entry:",
45
- choices=history,
46
+ choices=[
47
+ Choice(value=h, name=f"{n + 1}. {repr(h)}")
48
+ for n, h in enumerate(history)
49
+ ],
46
50
  long_instruction="To cancel this prompt press ctrl+z",
47
51
  mandatory=False,
48
52
  ).execute()
@@ -50,8 +54,8 @@ class HistoryCli(CliBase):
50
54
  if entry is None:
51
55
  return False
52
56
 
53
- self.history_entry = entry
54
- self.anime = Anime.from_local_list_entry(entry)
57
+ self.history_entry = LocalListEntry.from_dict(entry)
58
+ self.anime = Anime.from_local_list_entry(self.history_entry)
55
59
 
56
60
  def process(self):
57
61
  assert self.anime is not None
anipy_cli/menus/menu.py CHANGED
@@ -1,8 +1,10 @@
1
1
  import sys
2
2
  from typing import TYPE_CHECKING, List
3
3
 
4
+ from InquirerPy import inquirer
5
+ from InquirerPy.base.control import Choice
4
6
  from anipy_api.download import Downloader
5
- from anipy_api.provider import LanguageTypeEnum
7
+ from anipy_api.provider import LanguageTypeEnum, ProviderStream
6
8
  from anipy_api.locallist import LocalList
7
9
 
8
10
  from anipy_cli.colors import colors, cprint
@@ -15,7 +17,7 @@ from anipy_cli.prompts import pick_episode_prompt, search_show_prompt
15
17
  if TYPE_CHECKING:
16
18
  from anipy_api.anime import Anime
17
19
  from anipy_api.player import PlayerBase
18
- from anipy_api.provider import Episode, ProviderStream
20
+ from anipy_api.provider import Episode
19
21
 
20
22
  from anipy_cli.arg_parser import CliArgs
21
23
 
@@ -53,6 +55,7 @@ class Menu(MenuBase):
53
55
  MenuOption("Select from history", self.selec_hist, "h"),
54
56
  MenuOption("Search for Anime", self.search, "a"),
55
57
  MenuOption("Add to seasonals", self.add_seasonal, "t"),
58
+ MenuOption("Change video quality", self.change_quality, "v"),
56
59
  MenuOption("Print Video Info", self.video_info, "i"),
57
60
  MenuOption("Download Episode", self.download_video, "d"),
58
61
  MenuOption("Quit", self.quit, "q"),
@@ -168,6 +171,36 @@ class Menu(MenuBase):
168
171
  )
169
172
  cprint(colors.GREEN, "Anime added to seasonals!")
170
173
 
174
+ def change_quality(self):
175
+ with DotSpinner(
176
+ "Extracting streams for ",
177
+ colors.BLUE,
178
+ f"{self.anime.name} ({self.lang})",
179
+ " Episode ",
180
+ self.stream.episode,
181
+ "...",
182
+ ):
183
+ streams = self.anime.get_videos(self.stream.episode, self.lang)
184
+ streams.reverse()
185
+
186
+ stream = inquirer.select( # type: ignore
187
+ message="Select Stream:",
188
+ choices=[
189
+ Choice(value=s, name=f"{s.resolution}p - {s.url}") for s in streams
190
+ ],
191
+ long_instruction="To skip this prompt press ctrl+z",
192
+ mandatory=False,
193
+ ).execute()
194
+
195
+ if stream is None:
196
+ return
197
+
198
+ stream = ProviderStream(**stream)
199
+ self.options.quality = stream.resolution
200
+ self.stream = stream
201
+ self.player.play_title(self.anime, self.stream)
202
+ self.print_options()
203
+
171
204
  def download_video(self):
172
205
  config = Config()
173
206
  with DotSpinner("Starting Download...") as s:
anipy_cli/prompts.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import time
2
2
  from typing import TYPE_CHECKING, Optional, List, Tuple
3
3
  from InquirerPy import inquirer
4
+ from InquirerPy.base.control import Choice
4
5
  from anipy_api.provider import (
5
6
  BaseProvider,
6
7
  FilterCapabilities,
@@ -72,7 +73,9 @@ def search_show_prompt(
72
73
 
73
74
  anime = inquirer.fuzzy( # type: ignore
74
75
  message="Select Show:",
75
- choices=results,
76
+ choices=[
77
+ Choice(value=r, name=f"{n + 1}. {repr(r)}") for n, r in enumerate(results)
78
+ ],
76
79
  long_instruction=(
77
80
  "\nS = Anime is available in sub\n"
78
81
  "D = Anime is available in dub\n"
@@ -118,8 +121,15 @@ def season_search_prompt(provider: "BaseProvider") -> Optional["Anime"]:
118
121
 
119
122
  anime = inquirer.fuzzy( # type: ignore
120
123
  message="Select Show:",
121
- choices=results,
122
- long_instruction="\nS = Anime is available in sub\nD = Anime is available in dub\nTo skip this prompt press ctrl+z",
124
+ choices=[
125
+ Choice(value=r, name=f"{n + 1}. {repr(r)}") for n, r in enumerate(results)
126
+ ],
127
+ long_instruction=(
128
+ "\nS = Anime is available in sub\n"
129
+ "D = Anime is available in dub\n"
130
+ "First two letters indicate the provider\n"
131
+ "To skip this prompt press ctrl+z"
132
+ ),
123
133
  mandatory=False,
124
134
  ).execute()
125
135
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: anipy-cli
3
- Version: 3.1.1
3
+ Version: 3.1.3
4
4
  Summary: Watch and Download anime from the comfort of your Terminal
5
5
  Home-page: https://sdaqo.github.io/anipy-cli
6
6
  License: GPL-3.0
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.9
14
14
  Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
- Requires-Dist: anipy-api (>=3.1.1,<4.0.0)
17
+ Requires-Dist: anipy-api (>=3.1.3,<4.0.0)
18
18
  Requires-Dist: appdirs (>=1.4.4,<2.0.0)
19
19
  Requires-Dist: inquirerpy (>=0.3.4,<0.4.0)
20
20
  Requires-Dist: pypresence (>=4.3.0,<5.0.0)
@@ -1,12 +1,12 @@
1
- anipy_cli/__init__.py,sha256=B-408YFF0kwtP9-BovstzctP6hecE0JVRzCv29D12es,48
2
- anipy_cli/arg_parser.py,sha256=r2yxTYqKdhKvbzj8Pg00_4lmhK8mguxAVbg9G2vM-II,5299
1
+ anipy_cli/__init__.py,sha256=_0O8IeC_1fwHLVlr_mixygdwNkCjS24DFw9gZFxIw4E,48
2
+ anipy_cli/arg_parser.py,sha256=r2lroeHRyOA5_4RfNngClEsY9NXpNA96voOQDetuU7Y,5288
3
3
  anipy_cli/cli.py,sha256=Ah5BE-u_SjcuzU5dQ5cSHtUloVRApCWwTK5i49yQtH8,1922
4
4
  anipy_cli/clis/__init__.py,sha256=Y00uiPWiMvvRImxJMvfLA55BOkMUOrrx5vJUNvquNsY,411
5
5
  anipy_cli/clis/base_cli.py,sha256=xPr_J8hKs7LkDLvmK6zyL1ZTZRpyC2IuFss8KsaDstU,817
6
6
  anipy_cli/clis/binge_cli.py,sha256=eSvdOo_BRSb8-Xp48ZDcelqUBlDPdyQqu8OV0vc4szo,2281
7
7
  anipy_cli/clis/default_cli.py,sha256=yuHyDqTgnq84I522mUkY1An5c114qqIYW-Xbm1SsDl4,2806
8
8
  anipy_cli/clis/download_cli.py,sha256=y_8Txs6SSi60BvPCUcKDZg6zlN-w-eatM_O5ld0pzcQ,3187
9
- anipy_cli/clis/history_cli.py,sha256=shaYPzqvXfWlRndHVpz8KwDlKjXXsUXzyZCHwUfrjuQ,2666
9
+ anipy_cli/clis/history_cli.py,sha256=2ccv6BpQQpUhY4K-KM7lO9qxVLXBrmCY5lec6czipSE,2863
10
10
  anipy_cli/clis/mal_cli.py,sha256=_tSLgDUOa6GOZNyCncSSzaVj088y5GAKkHVRSndLLxk,2258
11
11
  anipy_cli/clis/seasonal_cli.py,sha256=GV2TQNm9UotG1cxfYbrFFgg7Jmy8SFa7w_GlFtPdRVE,616
12
12
  anipy_cli/colors.py,sha256=voXC7z1Fs9tHg4zzNTNMIrt9k-EVgJ3_xEf5KiW2xgo,916
@@ -16,11 +16,11 @@ anipy_cli/mal_proxy.py,sha256=wIsku2_dl8vKD2K99L63OlzA3L5fl-VmyeiXC9VrxI4,6981
16
16
  anipy_cli/menus/__init__.py,sha256=aIzbphxAW-QGfZwR1DIegFZuTJp1O3tSUnai0f0f4lY,185
17
17
  anipy_cli/menus/base_menu.py,sha256=g5b9Z7SpvCxcq_vqObcPzxLwcXeGPltLgSwa0sEzyfk,1140
18
18
  anipy_cli/menus/mal_menu.py,sha256=tJYq5J3k89_0BKFiWavn9Gqh5Z7uXtoUFqJaa3fT4o4,24105
19
- anipy_cli/menus/menu.py,sha256=68n0EQSqxu2mPXiAXiHXmWk6FaJzSfHis2VkDRSRpmQ,6772
19
+ anipy_cli/menus/menu.py,sha256=UQJ1hpyDT0i03ecIjBbFRp4PFh6FTNHDhSwSBSAhQEI,7860
20
20
  anipy_cli/menus/seasonal_menu.py,sha256=VBmeXanJb-vS5TXiK79KgtJ5vPW87gIOdpN_EijAG_U,9097
21
- anipy_cli/prompts.py,sha256=NK8HvbF0WjOr2Ph3OAtBgI6k9kHGbWXiBzVLEcDfEHU,7229
21
+ anipy_cli/prompts.py,sha256=seNeErTP1om1wpRUN-rbUUI8bAGRmu48ScQjztzKkeE,7564
22
22
  anipy_cli/util.py,sha256=e9k29kGOi_h4RPrQfKMsg-8xNZHO-fLfBSma6SjGfYg,7684
23
- anipy_cli-3.1.1.dist-info/METADATA,sha256=O6vRYvbjrxwyU0JosslVHlv9BNUQEvmF0DkJmFrW7Aw,3418
24
- anipy_cli-3.1.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
25
- anipy_cli-3.1.1.dist-info/entry_points.txt,sha256=86iXpcm_ECFndrt0JAI2mqYfXC2Ar7mGi0iOaxCrNP0,51
26
- anipy_cli-3.1.1.dist-info/RECORD,,
23
+ anipy_cli-3.1.3.dist-info/METADATA,sha256=Aikw4D1uBk9oYKokboLJRZEy2lfCsP-VaLm4WEDCK5k,3418
24
+ anipy_cli-3.1.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
25
+ anipy_cli-3.1.3.dist-info/entry_points.txt,sha256=86iXpcm_ECFndrt0JAI2mqYfXC2Ar7mGi0iOaxCrNP0,51
26
+ anipy_cli-3.1.3.dist-info/RECORD,,