From c88ac3de3db21005b9721d1913d025920c289f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=A8?= Date: Sat, 12 Apr 2025 10:40:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(app):=20=E6=94=AF=E6=8C=81=20API=20?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E8=AE=BE=E7=BD=AE=E4=B8=B4=E6=97=B6=E4=BB=A3?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + README.md | 46 ++++++++++++++++++++----- README_EN.md | 46 ++++++++++++++++++++----- example.py | 19 +++++++++++ pyproject.toml | 2 +- requirements.txt | Bin 1430 -> 840 bytes source/application/app.py | 7 ++-- source/application/request.py | 62 ++++++++++++++++++++++++++++++++-- source/module/manager.py | 1 + source/module/model.py | 3 +- static/Release_Notes.md | 5 +-- static/赞助商_TikHub_Logo.png | Bin 0 -> 5149 bytes uv.lock | 2 +- 13 files changed, 167 insertions(+), 27 deletions(-) create mode 100644 static/赞助商_TikHub_Logo.png diff --git a/.gitignore b/.gitignore index 0177fc8..c02b6fa 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ __pycache__/ *.db *.json /.idea/ +/Temp/ diff --git a/README.md b/README.md index ce56ce7..b81c696 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-
+XHS-Downloader

XHS-Downloader

简体中文 | English

JoeanAmier%2FXHS-Downloader | Trendshift @@ -155,7 +155,13 @@ cookie str 请求数据时使用的 Cookie;可选参数 -配置文件 Cookie 值 +配置文件 cookie 参数 + + +proxy +str +请求数据时使用的代理;可选参数 +配置文件 proxy 参数 skip @@ -167,18 +173,20 @@

代码示例:

-def api_demo():
+async def example_api():
+    """通过 API 设置参数,适合二次开发"""
     server = "http://127.0.0.1:6666/xhs/"
     data = {
-        "url": "https://www.xiaohongshu.com/explore/123456789",
+        "url": "",  # 必需参数
         "download": True,
         "index": [
             3,
             6,
             9,
         ],
+        "proxy": "http://127.0.0.1:10808",
     }
-    response = requests.post(server, json=data)
+    response = post(server, json=data, timeout=10)
     print(response.json())
 

📜 其他说明

@@ -560,9 +568,31 @@ A: 由于权限限制,您无法直接触发主仓库的 Actions。请通过 Fo
  • TikTokDownloader(抖音、TikTok)https://github.com/JoeanAmier/TikTokDownloader
  • KS-Downloader(快手、KuaiShou)https://github.com/JoeanAmier/KS-Downloader
  • -

    💰 项目赞助

    -PyCharm logo -

    JetBrains 支持全球开源社区认可的活跃项目,并为非商业开发提供免费许可证。

    + +# 💰 项目赞助 + +## JetBrains 工具 + +![PyCharm logo](https://resources.jetbrains.com/storage/products/company/brand/logos/PyCharm.svg) + +**JetBrains** 支持全球开源社区认可的活跃项目,并为非商业开发提供免费许可证。 + +*** + +## TikHub + +TikHub +

    TikHub 是一家领先的数据接口服务供应商,专注于提供高质量的数据接口,涵盖了多个热门平台,包括 抖音、TikTok、小红书、Instagram、Twitter 和 快手 等平台。

    +

    TikHub 还提供定制化的服务,如直播间监控、作品监控和达人监控,以满足不同业务场景的需求。

    +

    通过每日签到,用户可以免费获取一定额度的使用量;可以使用我的 推荐链接https://user.tikhub.io/users/signup?referral_code=ZrdH8McC推荐码ZrdH8McC,注册并充值即可获得 $2 额度!

    +

    TikHub 提供以下服务:

    +

    ⚠️ 免责声明

    -

    💰 Sponsor

    -PyCharm logo + +# 💰 Project Sponsorship + +## JetBrains Tools + +![PyCharm logo](https://resources.jetbrains.com/storage/products/company/brand/logos/PyCharm.svg) +

    JetBrains support active projects recognized within the global open-source community with complimentary licenses for non-commercial development.

    + +*** + +## TikHub + +TikHub +

    TikHub is a leading data interface service provider, specializing in offering high-quality data interfaces for multiple popular platforms, including DouYin, TikTok, Xiaohongshu, Instagram, Twitter, and Kuaishou.

    +

    TikHub also provides customized services such as live streaming room monitoring, post monitoring, and influencer monitoring to meet the needs of different business scenarios.

    +

    Through daily sign-ins, users can obtain a certain quota of usage for free. You can use my referral linkhttps://user.tikhub.io/users/signup?referral_code=ZrdH8McC or Referral CodeZrdH8McC,Register and recharge to receive $2 limit!

    +

    TikHub Provide the following services:

    +

    ⚠️ Disclaimer