diff --git a/README.md b/README.md index 64734f0..2055bac 100644 --- a/README.md +++ b/README.md @@ -48,11 +48,11 @@

⭐ XHS-Downloader 开发计划及进度可前往 Projects 查阅

📸 程序截图

🎥 点击图片观看演示视频

- +
- +
- +

🔗 支持链接

diff --git a/README_EN.md b/README_EN.md index 84be1fe..8513d6a 100644 --- a/README_EN.md +++ b/README_EN.md @@ -49,11 +49,11 @@

⭐ The development plan and progress of XHS-Downloader can be found at Projects

📸 Program Screenshots

🎥 Click the images to watch the demo video

- +
- +
- +

🔗 Supported Links

@@ -285,7 +286,7 @@ async def example(): name_format str -1Format of works file name, separated by spaces between fields, supports fields: 收藏数量评论数量分享数量点赞数量作品标签作品ID作品标题作品描述作品类型发布时间最后更新时间作者昵称作者ID +#Format of works file name, separated by spaces between fields, supports fields: 收藏数量评论数量分享数量点赞数量作品标签作品ID作品标题作品描述作品类型发布时间最后更新时间作者昵称作者ID 发布时间 作者昵称 作品标题 diff --git a/source/CLI/main.py b/source/CLI/main.py index 3b03a53..48fc680 100644 --- a/source/CLI/main.py +++ b/source/CLI/main.py @@ -39,15 +39,13 @@ def inner(ctx: Context, param, value): class CLI: def __init__(self, ctx: Context, **kwargs): - # print(kwargs) self.ctx = ctx - self.url = kwargs.pop("url") - self.index = self.__format_index(kwargs.pop("index")) - self.path = kwargs.pop("settings") - self.update = kwargs.pop("update_settings") - # print(kwargs) + self.url = ctx.params.pop("url") + self.index = self.__format_index(ctx.params.pop("index")) + self.path = ctx.params.pop("settings") + self.update = ctx.params.pop("update_settings") self.settings = Settings(self.__check_settings_path()) - self.parameter = self.settings.run() | self.__clean_params(kwargs) + self.parameter = self.settings.run() | self.__clean_params(ctx.params) self.APP = XHS(**self.parameter) async def __aenter__(self): @@ -116,7 +114,8 @@ def help_(ctx: Context, param, value) -> None: options = ( ("--url", "-u", "str", _("小红书作品链接")), - ("--index", "-i", "str", _("下载指定序号的图片文件,仅对图文作品生效;多个序号输入示例:\"1 3 5 7\"")), + ("--index", "-i", "str", + fill(_("下载指定序号的图片文件,仅对图文作品生效;多个序号输入示例:\"1 3 5 7\""), width=55),), ("--work_path", "-wp", "str", _("作品数据 / 文件保存根路径")), ("--folder_name", "-fn", "str", _("作品文件储存文件夹名称")), ("--name_format", "-nf", "str", _("作品文件名称格式")), @@ -126,7 +125,7 @@ def help_(ctx: Context, param, value) -> None: ("--cookie", "-ck", "str", _("小红书网页版 Cookie,无需登录")), ("--proxy", "-p", "str", _("网络代理")), ("--timeout", "-t", "int", _("请求数据超时限制,单位:秒")), - ("--chunk", "-c", "int", _("下载文件时,每次从服务器获取的数据块大小,单位:字节")), + ("--chunk", "-c", "int", fill(_("下载文件时,每次从服务器获取的数据块大小,单位:字节"), width=55),), ("--max_retry", "-mr", "int", _("请求数据失败时,重试的最大次数")), ("--record_data", "-rd", "bool", _("是否记录作品数据至文件")), ("--image_format", "-if", "choice", _("图文作品文件下载格式,支持:PNG、WEBP")), @@ -141,7 +140,7 @@ def help_(ctx: Context, param, value) -> None: BrowserCookie.SUPPORT_BROWSER.keys(), start=1, )) - ), width=40)), + ), width=55)), ("--update_settings", "-us", "flag", _("是否更新配置文件")), ("--help", "-h", "flag", _("查看详细参数说明")), ("--version", "-v", "flag", _("查看 XHS-Downloader 版本")), @@ -218,4 +217,4 @@ async def main(): from click.testing import CliRunner runner = CliRunner() - result = runner.invoke(cli, ['-l', 'en_US', '-h']) + result = runner.invoke(cli, ['-l', 'en_US', '-u', '']) diff --git a/source/TUI/index.py b/source/TUI/index.py index 4805941..5bfebc3 100644 --- a/source/TUI/index.py +++ b/source/TUI/index.py @@ -90,7 +90,6 @@ def on_mount(self) -> None: ">" * 50}", style=MASTER), - animate=True, scroll_end=True, ) self.xhs.manager.print_proxy_tip(log=self.tip, ) @@ -102,12 +101,10 @@ async def deal_button(self): else: self.tip.write( Text(_("未输入任何小红书作品链接"), style=WARNING), - animate=True, scroll_end=True, ) self.tip.write( Text(">" * 50, style=GENERAL), - animate=True, scroll_end=True, ) @@ -132,7 +129,6 @@ async def deal(self): ) self.tip.write( Text(">" * 50, style=GENERAL), - animate=True, scroll_end=True, ) await self.app.action_back() diff --git a/source/TUI/monitor.py b/source/TUI/monitor.py index 3f1d638..f8f2787 100644 --- a/source/TUI/monitor.py +++ b/source/TUI/monitor.py @@ -53,7 +53,6 @@ def on_mount(self) -> None: Text(_( "程序会自动读取并提取剪贴板中的小红书作品链接,并自动下载链接对应的作品文件,如需关闭,请点击关闭按钮,或者向剪贴板写入 “close” 文本!"), style=MASTER), - animate=True, scroll_end=True, ) self.run_monitor() diff --git a/source/module/static.py b/source/module/static.py index 08d77de..b4e2ac4 100644 --- a/source/module/static.py +++ b/source/module/static.py @@ -2,7 +2,7 @@ VERSION_MAJOR = 2 VERSION_MINOR = 4 -VERSION_BETA = True +VERSION_BETA = False ROOT = Path(__file__).resolve().parent.parent.parent PROJECT = f"XHS-Downloader V{VERSION_MAJOR}.{ VERSION_MINOR}{" Beta" if VERSION_BETA else ""}" diff --git a/source/module/tools.py b/source/module/tools.py index 7510929..49ae686 100644 --- a/source/module/tools.py +++ b/source/module/tools.py @@ -22,7 +22,7 @@ async def inner(self, *args, **kwargs): def logging(log, text, style=INFO): string = Text(text, style=style) if log: - log.write(string, animate=True, scroll_end=True, ) + log.write(string, scroll_end=True, ) else: print(string) diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2761.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2761.png" deleted file mode 100644 index c868406..0000000 Binary files "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2761.png" and /dev/null differ diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2762.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2762.png" deleted file mode 100644 index fe3b2aa..0000000 Binary files "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2762.png" and /dev/null differ diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN1.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN1.png" new file mode 100644 index 0000000..204e104 Binary files /dev/null and "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN1.png" differ diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN2.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN2.png" new file mode 100644 index 0000000..b56bed5 Binary files /dev/null and "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN2.png" differ diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN1.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN1.png" new file mode 100644 index 0000000..424f63a Binary files /dev/null and "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN1.png" differ diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN2.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN2.png" new file mode 100644 index 0000000..efa7240 Binary files /dev/null and "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN2.png" differ diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN1.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN1.png" index b996edf..cbbd509 100644 Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN1.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN1.png" differ diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN2.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN2.png" index e58a97e..63c3c0d 100644 Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN2.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN2.png" differ diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN3.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN3.png" index 5e2c7d2..0e36c8e 100644 Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN3.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN3.png" differ diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN1.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN1.png" index 1bb62d9..4a3c3ce 100644 Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN1.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN1.png" differ diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN2.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN2.png" index bf0ad7e..ab3b37d 100644 Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN2.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN2.png" differ diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN3.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN3.png" index de1e408..f3daca8 100644 Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN3.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN3.png" differ