# Differential 差速器
一个可以自动生成PTGen,MediaInfo,截图,并且生成发种所需内容的脚本
# 为什么叫差速器
差速器是汽车上的一种能使左、右轮胎以不同转速转动的结构。使用同样的动力输入,差速器能够输出不同的转速。就如同这个工具之于PT资源,差速器帮你使用同一份资源,输出不同PT站点需要的发种数据。
# 差速器能做什么?
当把大部分配置填好时,你可以仅提供资源文件的路径和一个豆瓣链接,差速器会帮你生成发种所需要的影片信息,Mediainfo,截图并上传图床,nfo文件,种子文件,并自动填写发种页面的表单( 感谢树大的[脚本](https://github.com/techmovie/easy-upload)和明日大佬的[脚本](https://github.com/tomorrow505/auto_feed_js) )
![](./usage.gif)
# 如何安装差速器
> 可以移步我的[博客](https://2cn.io/dft)查看详细的教程
> 也可以到[Telegram群组](https://t.me/ptdft)来讨论各种问题
## Linux
### 一键脚本安装
对于`Debian 9+`/`Ubuntu 20.04+`/`Centos 8`/`Fedora 34+`/`Archlinux`,可以使用一键脚本安装
```shell
curl -Lso- https://raw.githubusercontent.com/LeiShi1313/Differential/main/install.sh | bash
```
### 手动安装
按照[这个](https://www.mono-project.com/download/stable/#download-lin)页面,安装Mono
```shell
# 安装ffmpeg和mediainfo
sudo apt install ffmpeg mediainfo zlib1g-dev libjpeg-dev
pip3 install Differential
```
## Windows
安装下载并安装Python和ffmpeg,然后把ffmpeg放到Path或者你的工作目录,确认在你的工作目录`ffmpeg.exe -version`有正确输出。
```PowerShell
pip.exe install Differential
```
## Mac OS
按照[这个](https://www.mono-project.com/docs/getting-started/install/mac/)页面,安装Mono
```shell
# 安装ffmpeg、mediainfo
brew install ffmpeg mediainfo
pip install Differential
```
# 如何使用差速器
差速器支持未经过重大修改的NexusPHP/Gazelle/Unit3D站点以及部分支持[easy-upload](https://github.com/techmovie/easy-upload)和[auto_feed_js](https://github.com/tomorrow505/auto_feed_js)支持的站点。
在使用前,请先使用`dft -h`查看本工具支持的站点/现有的插件。
请先参考`config.ini.example`,在`Default`块填上各个站点/插件通用的参数,比如图床相关的几个参数,然后在各站点/插件名字对应的块填上各自特有的参数,比如截图张数等等。
当配置文件完成后,你可以通过以下命令,一键获取发种所需要的信息。当然你也可以选择通过命令行来传递所有参数。
```shell
dft [插件名字] -f [种子文件夹] -u [豆瓣URL]
```
主要参数介绍:
- `config`: 配置文件的位置,默认读取当前文件夹下的`config.ini`
- `log`: log文件的路径
- `folder`: 种子文件或文件夹的路径
- `url`: 影片的豆瓣链接,事实上,所有PTGen支持的链接这里都支持
- `upload_url`: 发种页面的地址
- `make_torrent`: 是否制种,默认关闭
- `geenrate_nfo`: 是否利用mediainfo生成nfo文件,默认关闭
- `use_short_bdinfo`: 是否使用BDInfo的Quick Summary,默认使用完整的BDInfo
- `screenshot_count`: 截图生成的张数,默认为0,即不生成截图
- `image_hosting`: 图床的名称,现在支持ptpimg,chevereto,imgurl和SM.MS
- `image_hosting_url`: 如果是自建的图床,提供图床链接
- `ptgen_url`: PTGen的地址,默认是我自建的PTGen,可能会不稳定
- `announce_url`: 制种时的announce地址
- `encoder_log`: 压制log的地址,如果提供的话会在介绍的mediainfo部分附上压制log
- `easy_upload`: 默认关闭,开启的话会利用[easy-upload](https://github.com/techmovie/easy-upload)自动填充发种页面表单
- `auto_feed`: 默认关闭,开启的话会利用[auto_feed_js](https://github.com/tomorrow505/auto_feed_js)自动填充发种页面表单
- `trim_description`: 默认关闭,开启的话会省略掉上传链接的描述部分,以避免链接过长浏览器无法打开的问题
- `use_short_url`: 默认关闭,开启的话使用短链接服务把上传链接缩短
## 其他插件
为保护站点信息,请到[`plugins`](https://github.com/LeiShi1313/Differential/tree/main/differential/plugins)文件夹查看或者`dft [插件名称] -h`查看支持的参数
# TODO
- [ ] 更好的出错管理
- [ ] PTGen API Key支持
- [ ] imgbox支持
- [x] 短网址服务
- [x] 识别已经生成过的截图,不重复截图
- [x] 支持扫描原盘BDInfo
Raw data
{
"_id": null,
"home_page": "https://github.com/leishi1313/Differential",
"name": "Differential",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6.2",
"maintainer_email": null,
"keywords": "PT, mediainfo, ptgen, ptpimg",
"author": "Lei Shi",
"author_email": "me@leishi.io",
"download_url": "https://files.pythonhosted.org/packages/cd/86/52e9a9c1499e9cb305b4f0f45356b637bb92a65e70f39930872e0a43c2bf/Differential-0.6.4.tar.gz",
"platform": null,
"description": "# Differential \u5dee\u901f\u5668\n\u4e00\u4e2a\u53ef\u4ee5\u81ea\u52a8\u751f\u6210PTGen\uff0cMediaInfo\uff0c\u622a\u56fe\uff0c\u5e76\u4e14\u751f\u6210\u53d1\u79cd\u6240\u9700\u5185\u5bb9\u7684\u811a\u672c\n\n\n# \u4e3a\u4ec0\u4e48\u53eb\u5dee\u901f\u5668\n\u5dee\u901f\u5668\u662f\u6c7d\u8f66\u4e0a\u7684\u4e00\u79cd\u80fd\u4f7f\u5de6\u3001\u53f3\u8f6e\u80ce\u4ee5\u4e0d\u540c\u8f6c\u901f\u8f6c\u52a8\u7684\u7ed3\u6784\u3002\u4f7f\u7528\u540c\u6837\u7684\u52a8\u529b\u8f93\u5165\uff0c\u5dee\u901f\u5668\u80fd\u591f\u8f93\u51fa\u4e0d\u540c\u7684\u8f6c\u901f\u3002\u5c31\u5982\u540c\u8fd9\u4e2a\u5de5\u5177\u4e4b\u4e8ePT\u8d44\u6e90\uff0c\u5dee\u901f\u5668\u5e2e\u4f60\u4f7f\u7528\u540c\u4e00\u4efd\u8d44\u6e90\uff0c\u8f93\u51fa\u4e0d\u540cPT\u7ad9\u70b9\u9700\u8981\u7684\u53d1\u79cd\u6570\u636e\u3002\n\n# \u5dee\u901f\u5668\u80fd\u505a\u4ec0\u4e48\uff1f\n\u5f53\u628a\u5927\u90e8\u5206\u914d\u7f6e\u586b\u597d\u65f6\uff0c\u4f60\u53ef\u4ee5\u4ec5\u63d0\u4f9b\u8d44\u6e90\u6587\u4ef6\u7684\u8def\u5f84\u548c\u4e00\u4e2a\u8c46\u74e3\u94fe\u63a5\uff0c\u5dee\u901f\u5668\u4f1a\u5e2e\u4f60\u751f\u6210\u53d1\u79cd\u6240\u9700\u8981\u7684\u5f71\u7247\u4fe1\u606f\uff0cMediainfo\uff0c\u622a\u56fe\u5e76\u4e0a\u4f20\u56fe\u5e8a\uff0cnfo\u6587\u4ef6\uff0c\u79cd\u5b50\u6587\u4ef6\uff0c\u5e76\u81ea\u52a8\u586b\u5199\u53d1\u79cd\u9875\u9762\u7684\u8868\u5355\uff08 \u611f\u8c22\u6811\u5927\u7684[\u811a\u672c](https://github.com/techmovie/easy-upload)\u548c\u660e\u65e5\u5927\u4f6c\u7684[\u811a\u672c](https://github.com/tomorrow505/auto_feed_js) \uff09\n\n![](./usage.gif)\n\n\n# \u5982\u4f55\u5b89\u88c5\u5dee\u901f\u5668\n\n> \u53ef\u4ee5\u79fb\u6b65\u6211\u7684[\u535a\u5ba2](https://2cn.io/dft)\u67e5\u770b\u8be6\u7ec6\u7684\u6559\u7a0b\n> \u4e5f\u53ef\u4ee5\u5230[Telegram\u7fa4\u7ec4](https://t.me/ptdft)\u6765\u8ba8\u8bba\u5404\u79cd\u95ee\u9898\n\n## Linux\n\n### \u4e00\u952e\u811a\u672c\u5b89\u88c5\n\u5bf9\u4e8e`Debian 9+`/`Ubuntu 20.04+`/`Centos 8`/`Fedora 34+`/`Archlinux`\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e00\u952e\u811a\u672c\u5b89\u88c5\n```shell\ncurl -Lso- https://raw.githubusercontent.com/LeiShi1313/Differential/main/install.sh | bash\n```\n\n### \u624b\u52a8\u5b89\u88c5\n\u6309\u7167[\u8fd9\u4e2a](https://www.mono-project.com/download/stable/#download-lin)\u9875\u9762\uff0c\u5b89\u88c5Mono\n\n```shell\n# \u5b89\u88c5ffmpeg\u548cmediainfo\nsudo apt install ffmpeg mediainfo zlib1g-dev libjpeg-dev\npip3 install Differential\n```\n\n## Windows\n\n\u5b89\u88c5\u4e0b\u8f7d\u5e76\u5b89\u88c5Python\u548cffmpeg\uff0c\u7136\u540e\u628affmpeg\u653e\u5230Path\u6216\u8005\u4f60\u7684\u5de5\u4f5c\u76ee\u5f55\uff0c\u786e\u8ba4\u5728\u4f60\u7684\u5de5\u4f5c\u76ee\u5f55`ffmpeg.exe -version`\u6709\u6b63\u786e\u8f93\u51fa\u3002\n\n```PowerShell\npip.exe install Differential\n```\n\n## Mac OS\n\u6309\u7167[\u8fd9\u4e2a](https://www.mono-project.com/docs/getting-started/install/mac/)\u9875\u9762\uff0c\u5b89\u88c5Mono\n\n```shell\n# \u5b89\u88c5ffmpeg\u3001mediainfo\nbrew install ffmpeg mediainfo\npip install Differential\n```\n\n# \u5982\u4f55\u4f7f\u7528\u5dee\u901f\u5668\n\n\u5dee\u901f\u5668\u652f\u6301\u672a\u7ecf\u8fc7\u91cd\u5927\u4fee\u6539\u7684NexusPHP/Gazelle/Unit3D\u7ad9\u70b9\u4ee5\u53ca\u90e8\u5206\u652f\u6301[easy-upload](https://github.com/techmovie/easy-upload)\u548c[auto_feed_js](https://github.com/tomorrow505/auto_feed_js)\u652f\u6301\u7684\u7ad9\u70b9\u3002\n\u5728\u4f7f\u7528\u524d\uff0c\u8bf7\u5148\u4f7f\u7528`dft -h`\u67e5\u770b\u672c\u5de5\u5177\u652f\u6301\u7684\u7ad9\u70b9/\u73b0\u6709\u7684\u63d2\u4ef6\u3002\n\n\u8bf7\u5148\u53c2\u8003`config.ini.example`\uff0c\u5728`Default`\u5757\u586b\u4e0a\u5404\u4e2a\u7ad9\u70b9/\u63d2\u4ef6\u901a\u7528\u7684\u53c2\u6570\uff0c\u6bd4\u5982\u56fe\u5e8a\u76f8\u5173\u7684\u51e0\u4e2a\u53c2\u6570\uff0c\u7136\u540e\u5728\u5404\u7ad9\u70b9/\u63d2\u4ef6\u540d\u5b57\u5bf9\u5e94\u7684\u5757\u586b\u4e0a\u5404\u81ea\u7279\u6709\u7684\u53c2\u6570\uff0c\u6bd4\u5982\u622a\u56fe\u5f20\u6570\u7b49\u7b49\u3002\n\n\u5f53\u914d\u7f6e\u6587\u4ef6\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\uff0c\u4e00\u952e\u83b7\u53d6\u53d1\u79cd\u6240\u9700\u8981\u7684\u4fe1\u606f\u3002\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u9009\u62e9\u901a\u8fc7\u547d\u4ee4\u884c\u6765\u4f20\u9012\u6240\u6709\u53c2\u6570\u3002\n```shell\ndft [\u63d2\u4ef6\u540d\u5b57] -f [\u79cd\u5b50\u6587\u4ef6\u5939] -u [\u8c46\u74e3URL]\n```\n\n\u4e3b\u8981\u53c2\u6570\u4ecb\u7ecd\uff1a\n \n- `config`: \u914d\u7f6e\u6587\u4ef6\u7684\u4f4d\u7f6e\uff0c\u9ed8\u8ba4\u8bfb\u53d6\u5f53\u524d\u6587\u4ef6\u5939\u4e0b\u7684`config.ini`\n- `log`: log\u6587\u4ef6\u7684\u8def\u5f84\n- `folder`: \u79cd\u5b50\u6587\u4ef6\u6216\u6587\u4ef6\u5939\u7684\u8def\u5f84\n- `url`: \u5f71\u7247\u7684\u8c46\u74e3\u94fe\u63a5\uff0c\u4e8b\u5b9e\u4e0a\uff0c\u6240\u6709PTGen\u652f\u6301\u7684\u94fe\u63a5\u8fd9\u91cc\u90fd\u652f\u6301\n- `upload_url`: \u53d1\u79cd\u9875\u9762\u7684\u5730\u5740\n- `make_torrent`: \u662f\u5426\u5236\u79cd\uff0c\u9ed8\u8ba4\u5173\u95ed\n- `geenrate_nfo`: \u662f\u5426\u5229\u7528mediainfo\u751f\u6210nfo\u6587\u4ef6\uff0c\u9ed8\u8ba4\u5173\u95ed\n- `use_short_bdinfo`: \u662f\u5426\u4f7f\u7528BDInfo\u7684Quick Summary\uff0c\u9ed8\u8ba4\u4f7f\u7528\u5b8c\u6574\u7684BDInfo\n- `screenshot_count`: \u622a\u56fe\u751f\u6210\u7684\u5f20\u6570\uff0c\u9ed8\u8ba4\u4e3a0\uff0c\u5373\u4e0d\u751f\u6210\u622a\u56fe\n- `image_hosting`: \u56fe\u5e8a\u7684\u540d\u79f0\uff0c\u73b0\u5728\u652f\u6301ptpimg,chevereto,imgurl\u548cSM.MS\n- `image_hosting_url`: \u5982\u679c\u662f\u81ea\u5efa\u7684\u56fe\u5e8a\uff0c\u63d0\u4f9b\u56fe\u5e8a\u94fe\u63a5\n- `ptgen_url`: PTGen\u7684\u5730\u5740\uff0c\u9ed8\u8ba4\u662f\u6211\u81ea\u5efa\u7684PTGen\uff0c\u53ef\u80fd\u4f1a\u4e0d\u7a33\u5b9a\n- `announce_url`: \u5236\u79cd\u65f6\u7684announce\u5730\u5740\n- `encoder_log`: \u538b\u5236log\u7684\u5730\u5740\uff0c\u5982\u679c\u63d0\u4f9b\u7684\u8bdd\u4f1a\u5728\u4ecb\u7ecd\u7684mediainfo\u90e8\u5206\u9644\u4e0a\u538b\u5236log\n- `easy_upload`: \u9ed8\u8ba4\u5173\u95ed\uff0c\u5f00\u542f\u7684\u8bdd\u4f1a\u5229\u7528[easy-upload](https://github.com/techmovie/easy-upload)\u81ea\u52a8\u586b\u5145\u53d1\u79cd\u9875\u9762\u8868\u5355\n- `auto_feed`: \u9ed8\u8ba4\u5173\u95ed\uff0c\u5f00\u542f\u7684\u8bdd\u4f1a\u5229\u7528[auto_feed_js](https://github.com/tomorrow505/auto_feed_js)\u81ea\u52a8\u586b\u5145\u53d1\u79cd\u9875\u9762\u8868\u5355\n- `trim_description`: \u9ed8\u8ba4\u5173\u95ed\uff0c\u5f00\u542f\u7684\u8bdd\u4f1a\u7701\u7565\u6389\u4e0a\u4f20\u94fe\u63a5\u7684\u63cf\u8ff0\u90e8\u5206\uff0c\u4ee5\u907f\u514d\u94fe\u63a5\u8fc7\u957f\u6d4f\u89c8\u5668\u65e0\u6cd5\u6253\u5f00\u7684\u95ee\u9898\n- `use_short_url`: \u9ed8\u8ba4\u5173\u95ed\uff0c\u5f00\u542f\u7684\u8bdd\u4f7f\u7528\u77ed\u94fe\u63a5\u670d\u52a1\u628a\u4e0a\u4f20\u94fe\u63a5\u7f29\u77ed\n\n## \u5176\u4ed6\u63d2\u4ef6\n\n\u4e3a\u4fdd\u62a4\u7ad9\u70b9\u4fe1\u606f\uff0c\u8bf7\u5230[`plugins`](https://github.com/LeiShi1313/Differential/tree/main/differential/plugins)\u6587\u4ef6\u5939\u67e5\u770b\u6216\u8005`dft [\u63d2\u4ef6\u540d\u79f0] -h`\u67e5\u770b\u652f\u6301\u7684\u53c2\u6570\n\n\n# TODO\n- [ ] \u66f4\u597d\u7684\u51fa\u9519\u7ba1\u7406\n- [ ] PTGen API Key\u652f\u6301\n- [ ] imgbox\u652f\u6301\n- [x] \u77ed\u7f51\u5740\u670d\u52a1\n- [x] \u8bc6\u522b\u5df2\u7ecf\u751f\u6210\u8fc7\u7684\u622a\u56fe\uff0c\u4e0d\u91cd\u590d\u622a\u56fe\n- [x] \u652f\u6301\u626b\u63cf\u539f\u76d8BDInfo",
"bugtrack_url": null,
"license": null,
"summary": "a Python script for easy uploading torrents to varies PT sites.",
"version": "0.6.4",
"project_urls": {
"Homepage": "https://github.com/leishi1313/Differential"
},
"split_keywords": [
"pt",
" mediainfo",
" ptgen",
" ptpimg"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cd8652e9a9c1499e9cb305b4f0f45356b637bb92a65e70f39930872e0a43c2bf",
"md5": "11ffc27296cd915b245044d8e5b062dd",
"sha256": "4a58c59f0c37a43faf084239247429c2a7c64d0ff8aa42617be13293035069c1"
},
"downloads": -1,
"filename": "Differential-0.6.4.tar.gz",
"has_sig": false,
"md5_digest": "11ffc27296cd915b245044d8e5b062dd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.2",
"size": 1017986,
"upload_time": "2024-03-26T13:21:57",
"upload_time_iso_8601": "2024-03-26T13:21:57.654546Z",
"url": "https://files.pythonhosted.org/packages/cd/86/52e9a9c1499e9cb305b4f0f45356b637bb92a65e70f39930872e0a43c2bf/Differential-0.6.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-26 13:21:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "leishi1313",
"github_project": "Differential",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "loguru",
"specs": [
[
"==",
"0.5.3"
]
]
},
{
"name": "Pillow",
"specs": [
[
"==",
"9.0.1"
]
]
},
{
"name": "pymediainfo",
"specs": [
[
"==",
"5.1.0"
]
]
},
{
"name": "requests",
"specs": []
},
{
"name": "torf",
"specs": [
[
"==",
"3.1.3"
]
]
},
{
"name": "lxml",
"specs": [
[
"==",
"4.7.1"
]
]
},
{
"name": "bencode.py",
"specs": [
[
"==",
"4.0.0"
]
]
}
],
"lcname": "differential"
}