Skip to content

Commit

Permalink
发布 1.9 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeanAmier committed Mar 30, 2024
1 parent a997fe1 commit f607be0
Show file tree
Hide file tree
Showing 47 changed files with 1,045 additions and 589 deletions.
44 changes: 27 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
</div>
<br>
<p>🔥 <b>小红书链接提取/作品采集工具</b>:提取账号发布、收藏、点赞作品链接;提取搜索结果作品、用户链接;采集小红书作品信息;提取小红书作品下载地址;下载小红书无水印作品文件!</p>
<p>❤️ 作者仅在 GitHub 发布 XHS-Downloader,未与任何个人或网站合作发布,项目没有任何收费计划,谨防上当受骗!</p>
<h1>📑 项目功能</h1>
<ul><b>程序功能</b>
<li>✅ 采集小红书作品信息</li>
Expand All @@ -27,6 +26,7 @@
<li>✅ 后台监听剪贴板下载作品</li>
<li>✅ 记录已下载作品 ID</li>
<li>✅ 支持命令行下载作品文件</li>
<li>✅ 从浏览器读取 Cookie</li>
<li>☑️ 支持 API 调用功能</li>
</ul>
<ul><b>脚本功能</b>
Expand Down Expand Up @@ -57,8 +57,9 @@
<p>⭐ 推荐使用 <a href="https://learn.microsoft.com/zh-cn/windows/terminal/install">Windows 终端</a> (Windows 11 默认终端)运行程序以便获得最佳显示效果!</p>
<h1>🥣 使用方法</h1>
<p>如果仅需下载无水印作品文件,建议选择 <b>程序运行</b>;如果有其他需求,建议选择 <b>源码运行</b>!</p>
<p>建议自行设置 <code>cookie</code> 参数,若不设置该参数,程序功能可能无法正常使用!</p>
<h2>🖱 程序运行</h2>
<p>Windows 10 及以上用户可前往 <a href="https://github.com/JoeanAmier/XHS-Downloader/releases/latest">Releases</a> 下载程序压缩包,解压后打开程序文件夹,双击运行 <code>main.exe</code> 即可使用。</p>
<p>Windows 10 及以上用户可前往 <a href="https://github.com/JoeanAmier/XHS-Downloader/releases/latest">Releases</a> 下载程序压缩包或安装包,解压或安装后打开程序文件夹,双击运行 <code>main.exe</code> 即可使用。</p>
<p>若通过此方式使用程序,文件默认下载路径为:<code>.\_internal\Download</code>;配置文件路径为:<code>.\_internal\settings.json</code></p>
<h2>⌨️ 源码运行</h2>
<ol>
Expand All @@ -69,6 +70,10 @@
</ol>
<h1>🛠 命令行模式</h1>
<p>项目支持命令行运行模式,若想要下载图文作品的部分图片,可以使用此模式传入需要下载的图片序号!</p>
<p>可以使用命令行从浏览器读取 Cookie 并写入配置文件!注意需要关闭对应浏览器才能读取数据!</p>
<p><code>bool</code> 类型参数支持使用 <code>true</code>、<code>false</code>、<code>1</code>、<code>0</code>、<code>yes</code>、<code>no</code>、<code>on</code> 或 <code>off</code>(不区分大小写)来设置。</p>
<p>命令示例:<code>python .\main.py --browser_cookie Chrome --update_settings</code></p>
<hr>
<img src="static/screenshot/命令行模式截图1.png" alt="">
<hr>
<img src="static/screenshot/命令行模式截图2.png" alt="">
Expand Down Expand Up @@ -96,7 +101,7 @@ async def example():
timeout = 5 # 请求数据超时限制,单位:秒,默认值:10
chunk = 1024 * 1024 * 10 # 下载文件时,每次从服务器获取的数据块大小,单位:字节
max_retry = 2 # 请求数据失败时,重试的最大次数,单位:秒,默认值:5
record_data = False # 是否记录作品数据至文件
record_data = False # 是否保存作品数据至文件
image_format = "WEBP" # 图文作品文件下载格式,支持:PNG、WEBP
folder_mode = False # 是否将每个作品的文件储存至单独的文件夹
async with XHS() as xhs:
Expand All @@ -114,17 +119,15 @@ async def example():
folder_mode=folder_mode,
) as xhs: # 使用自定义参数
download = True # 是否下载作品文件,默认值:False
efficient = True # 高效模式,禁用请求延时
# 返回作品详细信息,包括下载地址
# 获取数据失败时返回空字典
print(await xhs.extract(error_link, download, efficient=efficient))
print(await xhs.extract(demo_link, download, efficient=efficient))
print(await xhs.extract(error_link, download, ))
print(await xhs.extract(demo_link, download, ))
# 支持传入多个作品链接
print(await xhs.extract(multiple_links, download, efficient=efficient))
print(await xhs.extract(multiple_links, download, ))
</pre>
<h1>⚙️ 配置文件</h1>
<p>项目根目录下的 <code>settings.json</code> 文件,首次运行自动生成,可以自定义部分运行参数。</p>
<p>建议自行设置 <code>cookie</code> 参数,若不设置该参数,程序功能可能无法正常使用!</p>
<table>
<thead>
<tr>
Expand Down Expand Up @@ -186,7 +189,7 @@ async def example():
<tr>
<td align="center">record_data</td>
<td align="center">bool</td>
<td align="center">是否记录作品数据至 <code>TXT</code> 文件</td>
<td align="center">是否保存作品数据至文件,保存格式:<code>SQLite</code></td>
<td align="center">false</td>
</tr>
<tr>
Expand All @@ -204,8 +207,8 @@ async def example():
<tr>
<td align="center">language</td>
<td align="center">str</td>
<td align="center">设置程序语言,目前支持:<code>zh-CN</code>、<code>en-GB</code></td>
<td align="center">zh-CN</td>
<td align="center">设置程序语言,目前支持:<code>zh_CN</code>、<code>en_GB</code></td>
<td align="center">zh_CN</td>
</tr>
</tbody>
</table>
Expand All @@ -214,11 +217,12 @@ async def example():
<li>打开浏览器(可选无痕模式启动),访问 <code>https://www.xiaohongshu.com/explore</code></li>
<li>按下 <code>F12</code> 打开开发人员工具</li>
<li>选择 <code>网络</code> 选项卡</li>
<li>勾选 <code>保留日志</code></li>
<li>在 <code>过滤</code> 输入框输入 <code>cookie-name:web_session</code></li>
<li>选择 <code>Fetch/XHR</code> 筛选器</li>
<li>点击小红书页面任意作品</li>
<li>在 <code>网络</code> 选项卡挑选包含 Cookie 的数据包</li>
<li>检查 Cookie 是否包含 <code>web_session</code> 字段</li>
<li>全选复制包含 <code>web_session</code> 字段的 Cookie</li>
<li>在 <code>网络</code> 选项卡选择任意数据包(如果无数据包,重复步骤7)</li>
<li>全选复制 Cookie 写入程序或配置文件</li>
</ol>
<br>
<img src="static/screenshot/获取Cookie示意图.png" alt="">
Expand All @@ -242,11 +246,16 @@ async def example():
<p>如果您愿意,可以考虑提供资助为 <b>XHS-Downloader</b> 提供额外的支持!</p>
<h1>✉️ 联系作者</h1>
<ul>
<li>微信: Downloader_Tools</li>
<li>微信公众号: Downloader Tools</li>
<li>微信(其他事务): Downloader_Tools</li>
<li>微信公众号(问题解答): Downloader Tools</li>
<li>QQ 群聊(使用交流): <a href="https://github.com/JoeanAmier/XHS-Downloader/blob/master/static/QQ%E7%BE%A4%E8%81%8A%E4%BA%8C%E7%BB%B4%E7%A0%81.png">扫码加入群聊</a></li>
</ul>
<p><b>如果您对抖音 / TikTok 感兴趣,可以了解一下我的另一个开源项目 <a href="https://github.com/JoeanAmier/TikTokDownloader">TikTokDownloader</a></b></p>
<p><b>说明:</b>QQ 群聊仅限于讨论项目使用问题,严禁发布任何广告,严禁讨论任何账号交易、账号流量、流量变现、灰色产业等相关的内容!</p>
<p>✨ <b>作者的其他开源项目:</b></p>
<ul>
<li><b>TikTokDownloader(抖音 / TikTok)</b>:<a href="https://github.com/JoeanAmier/TikTokDownloader">https://github.com/JoeanAmier/TikTokDownloader</a></li>
<li><b>KS-Downloader(快手)</b>:<a href="https://github.com/JoeanAmier/KS-Downloader">https://github.com/JoeanAmier/KS-Downloader</a></li>
</ul>
<h1>⚠️ 免责声明</h1>
<ul>
<li>使用者对本项目的使用由使用者自行决定,并自行承担风险。作者对使用者使用本项目所产生的任何损失、责任、或风险概不负责。</li>
Expand All @@ -269,3 +278,4 @@ async def example():
* https://textual.textualize.io/
* https://aiosqlite.omnilib.dev/en/stable/
* https://click.palletsprojects.com/en/8.1.x/
* https://github.com/borisbabic/browser_cookie3
5 changes: 3 additions & 2 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<div align="center">
<p>🔥 <b>Xiaohongshu Artwork Collection Tool</b>: Collect information on Xiaohongshu artworks; Extract the download address of Xiaohongshu artworks; Download the Xiaohongshu watermark-free artwork files!</p>
<p>❤️ The author only releases XHS-Downloader on GitHub, without collaborating with any individuals or websites. Additionally, there are no charging plans for the tool!</p>
<p>⭐ Due to the author's limited energy, I was unable to update the English document in a timely manner, and the content may have become outdated. Suggest referring to Chinese documentation. If you want to contribute to translation, we warmly welcome you</p>
</div>
<h1>📑 The Project Features:</h1>
<ul>
Expand Down Expand Up @@ -195,8 +196,8 @@ async with XHS(work_path=work_path,
<tr>
<td align="center">language</td>
<td align="center">str</td>
<td align="center">Set programming language, currently support: <code>zh-CN</code>, <code>en-GB</code></td>
<td align="center">zh-CN</td>
<td align="center">Set programming language, currently support: <code>zh_CN</code>, <code>en_GB</code></td>
<td align="center">zh_CN</td>
</tr>
</tbody>
</table>
Expand Down
5 changes: 5 additions & 0 deletions locale/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 贡献指南

* 如果想要贡献支持更多语言,请参考 `zh_CN``en_GB` 的文件夹层级结构,复制 `locale/zh_CN/LC_MESSAGES/xhs.po` 文件并编辑翻译。
* 如果想要贡献改进翻译结果,请直接编辑 `xhs.po` 文件内容。
* 不需要提交 `xhs.mo` 文件,提交 `xhs.po` 文件后,作者会转换格式并合并。
Binary file added locale/en_GB/LC_MESSAGES/xhs.mo
Binary file not shown.
233 changes: 233 additions & 0 deletions locale/en_GB/LC_MESSAGES/xhs.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Language: en_GB\n"

msgid "免责声明\n"
msgstr "Disclaimer about XHS-Downloader:\n"
"\n"
"1. The user decides on their own use of this project and assumes all risks. The author is not responsible for any losses, liabilities, or risks incurred by the user in using this project.\n"
"2. The code and features provided by the author of this project are developed based on existing knowledge and technology. The author strives to ensure the correctness and security of the code but does not guarantee that the code is entirely free of errors or defects.\n"
"3. The user must strictly adhere to the requirements of the GNU General Public License v3.0 when using this project and appropriately acknowledge the use of code licensed under the GNU General Public License v3.0.\n"
"4. Under no circumstances may the user associate the author, contributors, or other relevant parties of this project with the user's actions, nor demand them to be held responsible for any losses or damages incurred by the user in using this project.\n"
"5. The user must independently research relevant laws and regulations when using the code and features of this project, ensuring that their use is legal and compliant. Any legal responsibilities and risks arising from violations of laws and regulations are the sole responsibility of the user.\n"
"6. The author of this project will not offer a paid version of the XHS-Downloader project and will not provide any commercial services related to the XHS-Downloader project.\n"
"7. Any secondary development, modification, or compilation of programs based on this project is not associated with the original author. The original author is not responsible for any consequences related to secondary development actions or their results. The user is solely responsible for all situations that may arise from secondary development.\n"
"\n"
"Before using the code and features of this project, please carefully consider and accept the above disclaimers. If you have any questions or do not agree with the statements above, please refrain from using the code and features of this project. If you proceed to use the code and features of this project, it will be considered that you fully understand and accept the disclaimers mentioned above, and willingly assume all risks and consequences associated with using this project.\n"

msgid "提取作品文件下载地址失败"
msgstr "Failed to extract the download address for the Xiaohongshu works files"

msgid "提取小红书作品链接失败"
msgstr "Failed to extract the links for Xiaohongshu works"

msgid "未输入任何小红书作品链接"
msgstr "No Xiaohongshu works links provided"

msgid "下载小红书作品文件失败"
msgstr "Failed to download the Xiaohongshu works files"

msgid "正在检查新版本,请稍等..."
msgstr "Checking for new version, please wait..."

msgid "当前版本为开发版, 可更新至正式版"
msgstr "The current version is a development version, and can be updated to the official version"

msgid "当前已是最新开发版"
msgstr "You are already using the latest development version"

msgid "当前已是最新正式版"
msgstr "You are already using the latest official version"

msgid "检测新版本失败"
msgstr "Failed to check for a new version"

msgid "开源协议"
msgstr "Open Source License"

msgid "项目地址"
msgstr "Project Address"

msgid "请输入小红书图文/视频作品链接"
msgstr "Please enter the link to the Xiaohongshu image/text or video works"

msgid "多个链接之间使用空格分隔"
msgstr "Separate multiple links with spaces"

msgid "下载无水印作品文件"
msgstr "Download images/video files"

msgid "读取剪贴板"
msgstr "Read the clipboard"

msgid "清空输入框"
msgstr "Clear the input box"

msgid "退出程序"
msgstr "Exit the program"

msgid "检查更新"
msgstr "Check for updates"

msgid "程序设置"
msgstr "Settings"

msgid "作品数据 / 文件保存根路径"
msgstr "Root path for saving works data / files"

msgid "作品文件储存文件夹名称"
msgstr "Name of the folder for storing works files"

msgid "小红书网页版 Cookie"
msgstr "Xiaohongshu Web Cookie"

msgid "网络代理"
msgstr "Network proxy"

msgid "记录作品数据"
msgstr "Record works data"

msgid "图片下载格式"
msgstr "Image download format"

msgid "作品文件夹归档模式"
msgstr "Folder archiving mode"

msgid "程序语言"
msgstr "Program language"

msgid "启动本地服务器"
msgstr "Start local server"

msgid "程序根路径"
msgstr "Program root path"

msgid "小红书网页版 Cookie,无需登录,参数已设置"
msgstr "Xiaohongshu web version cookie, no login required, parameters have been set"

msgid "小红书网页版 Cookie,无需登录,参数未设置"
msgstr "Xiaohongshu web version cookie, no login required, parameters not set"

msgid "默认 User-Agent"
msgstr "Default User-Agent"

msgid "不使用代理"
msgstr "No proxy"

msgid "保存配置"
msgstr "Save configuration"

msgid "放弃更改"
msgstr "Discard changes"

msgid "程序处理中..."
msgstr "Processing..."

msgid "已启动监听剪贴板模式"
msgstr "Currently in monitoring clipboard mode"

msgid "程序会自动读取并提取剪贴板中的小红书作品链接,并自动下载链接对应的作品文件,如需关闭,请点击关闭按钮,或者向剪贴板写入 “close” 文本!"
msgstr "The program will automatically read and extract the link to Xiaohongshu's works from the clipboard, and automatically download the corresponding work file. If you want to close it, please click the close button or write the \"close\" text to the clipboard!"

msgid "退出监听剪贴板模式"
msgstr "Exit monitoring clipboard mode"

msgid "请输入待删除的小红书作品链接或作品 ID"
msgstr "Please enter the link or ID of the Xiaohongshu works to be deleted"

msgid "支持输入作品 ID 或包含作品 ID 的作品链接,多个链接或 ID 之间使用空格分隔"
msgstr "Support input of works ID or links containing works ID, with multiple links or IDs separated by spaces"

msgid "删除指定作品 ID"
msgstr "Delete specified works ID"

msgid "返回首页"
msgstr "return"

msgid "小红书作品链接"
msgstr "Link to Xiaohongshu works"

msgid "下载指定序号的图片文件,仅对图文作品生效;多个序号输入示例:\"1 3 5 7\""
msgstr "Download image files with specified serial numbers, only effective for image works; Example of multiple serial numbers input: \"1 3 5 7\""

msgid "小红书网页版 Cookie,无需登录"
msgstr "Xiaohongshu web version cookie, no need to log in"

msgid "请求数据超时限制,单位:秒"
msgstr "Network request timeout limit, in seconds"

msgid "下载文件时,每次从服务器获取的数据块大小,单位:字节"
msgstr "When downloading a file, the size of the data block obtained from the server each time, in bytes"

msgid "请求数据失败时,重试的最大次数"
msgstr "The maximum number of retries when data request fails"

msgid "是否记录作品数据至文件"
msgstr "Record works data to file"

msgid "图文作品文件下载格式,支持:PNG、WEBP"
msgstr "Image works file download format, supporting: PNG, WEBP"

msgid "是否将每个作品的文件储存至单独的文件夹"
msgstr "Do you need to store the files of each works in a separate folder"

msgid "设置程序语言,目前支持:zh_CN、en_GB"
msgstr "Set program language, currently supports: zh_CN, en_GB"

msgid "读取指定配置文件"
msgstr "Read specified configuration file"

msgid "是否更新配置文件"
msgstr "Do you need to update the configuration file"

msgid "查看详细参数说明"
msgstr "View detailed parameter descriptions"

msgid "网络异常,请求 {0} 失败"
msgstr "Network error, failed to access {0}"

msgid "{0} 文件已存在,跳过下载"
msgstr "{0} already exists, skipping download"

msgid "文件 {0} 下载成功"
msgstr "file {0} download successful"

msgid "网络异常,{0} 下载失败"
msgstr "Network error, {0} download failed"

msgid "共 {0} 个小红书作品待处理..."
msgstr "{0} works from Xiaohongshu are awaiting processing..."

msgid "开始处理作品:{0}"
msgstr "Start processing the works: {0}"

msgid "{0} 获取数据失败"
msgstr "{0} failed to retrieve data"

msgid "{0} 提取数据失败"
msgstr "{0} failed to extract data"

msgid "作品处理完成:{0}"
msgstr "works processing completed: {0}"

msgid "检测到新版本:{0}.{1}"
msgstr "New version detected: {0}.{1}"

msgid "作品 {0} 存在下载记录,跳过下载"
msgstr "works {0} has a download record, skipping download"

msgid "从指定的浏览器读取小红书网页版 Cookie,需要关闭对应的浏览器,支持:1 Chrome, 2 Chromium, 3 Opera, 4 Opera GX, 5 Brave, 6 Edge, 7 Vivaldi, 8 Firefox, 9 LibreWolf, 10 Safari,输入浏览器类型或序号"
msgstr "To read the Xiaohongshu web version cookie from the specified browser, the corresponding browser needs to be closed. Supports: 1 Chrome, 2 Chromium, 3 Opera, 4 Opera GX, 5 Brave, 6 Edge, 7 Vivaldi, 8 Firefox, 9 LibreWolf, 10 Safari, enter the browser type or serial number"

msgid "查看 XHS-Downloader 版本"
msgstr "View XHS Downloader Version"

msgid "如果 XHS-Downloader 对您有帮助,请考虑为它点个 Star,感谢您的支持!"
msgstr "If XHS-Downloader is helpful to you, please consider giving it Star. Thank you for your support!"

msgid "作者的其他开源项目"
msgstr "Other open-source projects of the author"

msgid "文件 {0} 请求失败,响应码 {1}"
msgstr "File {0} request failed with response code {1}"
Loading

0 comments on commit f607be0

Please sign in to comment.