anipy-cli 3.4.8__py3-none-any.whl → 3.4.9__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.4.8"
2
+ __version__ = "3.4.9"
anipy_cli/arg_parser.py CHANGED
@@ -25,6 +25,7 @@ class CliArgs:
25
25
  mal_password: Optional[str]
26
26
  config: bool
27
27
  seasonal_search: Optional[str]
28
+ subtitles: bool
28
29
 
29
30
 
30
31
  def parse_args(override_args: Optional[list[str]] = None) -> CliArgs:
@@ -175,6 +176,15 @@ def parse_args(override_args: Optional[list[str]] = None) -> CliArgs:
175
176
  help="Override all configured download locations",
176
177
  )
177
178
 
179
+ options_group.add_argument(
180
+ "-so",
181
+ "--sub-only",
182
+ required=False,
183
+ dest="subtitles",
184
+ action="store_true",
185
+ help="Download only subtitles",
186
+ )
187
+
178
188
  options_group.add_argument(
179
189
  "--mal-password",
180
190
  required=False,
@@ -70,7 +70,7 @@ class DownloadCli(CliBase):
70
70
  assert self.lang is not None
71
71
 
72
72
  errors = DownloadComponent(self.options, self.dl_path, "download").download_anime(
73
- [(self.anime, self.lang, self.episodes)], only_skip_ep_on_err=True
73
+ [(self.anime, self.lang, self.episodes)], only_skip_ep_on_err=True, sub_only=self.options.subtitles
74
74
  )
75
75
  DownloadComponent.serve_download_errors(errors, only_skip_ep_on_err=True)
76
76
 
@@ -41,6 +41,7 @@ class DownloadComponent:
41
41
  picked: List[Tuple[Anime, LanguageTypeEnum, List[Episode]]],
42
42
  after_success_ep: SuccessfulEpDownload = lambda anime, ep, lang: None,
43
43
  only_skip_ep_on_err: bool = False,
44
+ sub_only: bool = False,
44
45
  ) -> List[Tuple[Anime, Episode]]:
45
46
  """
46
47
  Attributes:
@@ -72,6 +73,7 @@ class DownloadComponent:
72
73
  eps,
73
74
  after_success_ep,
74
75
  only_skip_ep_on_err,
76
+ sub_only,
75
77
  )
76
78
 
77
79
  return failed
@@ -85,11 +87,12 @@ class DownloadComponent:
85
87
  eps: List[Episode],
86
88
  after_success_ep: SuccessfulEpDownload = lambda anime, ep, lang: None,
87
89
  only_skip_ep_on_err: bool = False,
90
+ sub_only: bool = False,
88
91
  ) -> List[Tuple[Anime, Episode]]:
89
92
  fails = []
90
93
  for ep in eps:
91
94
  try:
92
- self.download_ep(spinner, downloader, anime, lang, ep)
95
+ self.download_ep(spinner, downloader, anime, lang, ep, sub_only)
93
96
  except Exception as e:
94
97
  if only_skip_ep_on_err:
95
98
  error_msg = f"! Issues downloading episode {ep} of {anime.name}. Skipping..."
@@ -117,6 +120,7 @@ class DownloadComponent:
117
120
  anime: Anime,
118
121
  lang: LanguageTypeEnum,
119
122
  ep: Episode,
123
+ sub_only: bool = False,
120
124
  ):
121
125
  config = Config()
122
126
 
@@ -137,14 +141,20 @@ class DownloadComponent:
137
141
  )
138
142
 
139
143
  spinner.set_text("Downloading...")
140
-
141
- downloader.download(
142
- stream,
143
- get_download_path(anime, stream, parent_directory=self.dl_path),
144
- container=config.remux_to,
145
- ffmpeg=self.options.ffmpeg or config.ffmpeg_hls,
146
- post_dl_cb=get_post_download_scripts_hook(self.mode, anime, spinner)
147
- )
144
+
145
+ if not sub_only:
146
+ downloader.download(
147
+ stream,
148
+ get_download_path(anime, stream, parent_directory=self.dl_path),
149
+ container=config.remux_to,
150
+ ffmpeg=self.options.ffmpeg or config.ffmpeg_hls,
151
+ post_dl_cb=get_post_download_scripts_hook(self.mode, anime, spinner)
152
+ )
153
+ else:
154
+ downloader.download_sub(
155
+ stream,
156
+ get_download_path(anime, stream, parent_directory=self.dl_path)
157
+ )
148
158
 
149
159
  @staticmethod
150
160
  def serve_download_errors(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: anipy-cli
3
- Version: 3.4.8
3
+ Version: 3.4.9
4
4
  Summary: Watch and Download anime from the comfort of your Terminal
5
5
  License: GPL-3.0
6
6
  Keywords: anime,cli
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Programming Language :: Python :: 3.13
17
- Requires-Dist: anipy-api (>=3.4.8,<4.0.0)
17
+ Requires-Dist: anipy-api (>=3.4.9,<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,18 +1,18 @@
1
- anipy_cli/__init__.py,sha256=zjXWAOAxRpnYzcXe_Lvx-Q68uFakPzNp9AA6rM-2G0Q,48
2
- anipy_cli/arg_parser.py,sha256=0L2ZamTMVp5jFF9gdrFXRNwm1E5WznwY8PbYjiV_LRE,6244
1
+ anipy_cli/__init__.py,sha256=WUczqOPVeOAkQsDR_pcsas5aNccbg6mvXfO0-mZpc4c,48
2
+ anipy_cli/arg_parser.py,sha256=efUOHrMcKkEELbkxsudSzHC0FF2Z_tSFDTmDBqirVGY,6459
3
3
  anipy_cli/cli.py,sha256=Bk2H15VRF34yKLbGgKVq0A2vdByMJj-JTyx7Ep-JbH0,2238
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=ioZ-V0WfGYBqETFkd8epGrT9dPHwsRJ1qvIdqf4waIs,2551
7
7
  anipy_cli/clis/default_cli.py,sha256=aJrJwtwdD7l-Z3dMjSHlvMvgTVnwA3_OXwS-9DZQIy8,3078
8
- anipy_cli/clis/download_cli.py,sha256=K8hqkxTeQ5Ao5LR2rimxX099IWf2I_KDGySIZzuIIVI,2320
8
+ anipy_cli/clis/download_cli.py,sha256=RW-rLrgbBjFgD1j-qpj7XI-RbFoV9TxF27dPMdz40Ac,2353
9
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
13
13
  anipy_cli/config.py,sha256=x9u5UHbPMewsA2q7XMHs6pvfFfTGzTxgROER2LEZESI,17746
14
14
  anipy_cli/discord.py,sha256=c6mdqnEdblzZBYs3cGP66oDeS4ySm59OfTRP-R-Duls,1160
15
- anipy_cli/download_component.py,sha256=3GCPoWIEjhN1rBtOt8NQg9lqBTI4OHV3gG2RZ3NMzcA,5248
15
+ anipy_cli/download_component.py,sha256=sHmYpVpr2tXc4zrr9pai_uBa8fYcP6y__rGjHpDUtOA,5614
16
16
  anipy_cli/mal_proxy.py,sha256=me2ESB442pYeNEpHY8mqrOEb477UA0uAg2LprKcp8sM,7098
17
17
  anipy_cli/menus/__init__.py,sha256=aIzbphxAW-QGfZwR1DIegFZuTJp1O3tSUnai0f0f4lY,185
18
18
  anipy_cli/menus/base_menu.py,sha256=g5b9Z7SpvCxcq_vqObcPzxLwcXeGPltLgSwa0sEzyfk,1140
@@ -21,7 +21,7 @@ anipy_cli/menus/menu.py,sha256=ejTOGVG8fFJhTT7t23kA_uBbF5pkNcdvj4cGAIPvdt8,8101
21
21
  anipy_cli/menus/seasonal_menu.py,sha256=NT9dfQUdN1DFu6wAf9hdWOfVBB7EfFiUECAcW6fqHgs,8995
22
22
  anipy_cli/prompts.py,sha256=RW1jqNq6RQY7BqV77vrCtEuyfyc8ArtdwCH73S3-c-k,11909
23
23
  anipy_cli/util.py,sha256=8AzEeoSPXMGTdTrArhE0COhSuYP_MCvYIeGHv5X7haU,6841
24
- anipy_cli-3.4.8.dist-info/METADATA,sha256=gOWjpN276iuw2JJOx4g3i8GCQWKbnqLBglKFJDe0o9Y,3481
25
- anipy_cli-3.4.8.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
26
- anipy_cli-3.4.8.dist-info/entry_points.txt,sha256=86iXpcm_ECFndrt0JAI2mqYfXC2Ar7mGi0iOaxCrNP0,51
27
- anipy_cli-3.4.8.dist-info/RECORD,,
24
+ anipy_cli-3.4.9.dist-info/METADATA,sha256=3VxZUTELlpNemhLO_MHjkupvfRhcZyxPleiai5SPPdQ,3481
25
+ anipy_cli-3.4.9.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
26
+ anipy_cli-3.4.9.dist-info/entry_points.txt,sha256=86iXpcm_ECFndrt0JAI2mqYfXC2Ar7mGi0iOaxCrNP0,51
27
+ anipy_cli-3.4.9.dist-info/RECORD,,