一个可以自动生成PTGen,MediaInfo,截图,并且生成发布所需内容的脚本

Overview

Differential 差速器

一个可以自动生成PTGen,MediaInfo,截图,并且生成发种所需内容的脚本

为什么叫差速器

差速器是汽车上的一种能使左、右轮胎以不同转速转动的结构。使用同样的动力输入,差速器能够输出不同的转速。就如同这个工具之于PT资源,差速器帮你使用同一份资源,输出不同PT站点需要的发种数据。

差速器能做什么?

当把大部分配置填好时,你可以仅提供资源文件的路径和一个豆瓣链接,差速器会帮你生成发种所需要的影片信息,Mediainfo,截图并上传图床,nfo文件,种子文件,并自动填写发种页面的表单( 感谢树大的脚本

如何安装差速器

Linux

# 安装ffmpeg和mediainfo
sudo apt install ffmpeg mediainfo
pip3 install Differential

Windows

安装下载并安装Python和ffmpeg,然后把ffmpeg放到Path或者你的工作目录,确认在你的工作目录ffmpeg.exe -version有正确输出。

pip.exe install Differential

Mac OS

# 安装ffmpeg
brew install ffmpeg
pip install Differential

如何使用差速器

差速器支持未经过重大修改的NexusPHP站点以及部分支持easy-upload支持的站点。 在使用前,请先使用dft -h查看本工具支持的站点/现有的插件。

请先参考config.ini.example,在Default块填上各个站点/插件通用的参数,比如图床相关的几个参数,然后在各站点/插件名字对应的块填上各自特有的参数,比如截图张数等等。

当配置文件完成后,你可以通过以下命令,一键获取发种所需要的信息。当然你也可以选择通过命令行来传递所有参数。

dft [插件名字] -f [种子文件夹] -u [豆瓣URL]

主要参数介绍:

  • config: 配置文件的位置,默认读取当前文件夹下的config.ini
  • log: log文件的路径
  • folder: 种子文件或文件夹的路径
  • url: 影片的豆瓣链接,事实上,所有PTGen支持的链接这里都支持
  • make_torrent: 是否制种,默认关闭
  • geenrate_nfo: 是否利用mediainfo生成nfo文件,默认关闭
  • screenshot_count: 截图生成的张数,默认为0,即不生成截图
  • image_hosting: 图床的名称,现在支持ptpimg,chevereto,imgurl和SM.MS
  • image_hosting_url: 如果是自建的图床,提供图床链接
  • ptgen_url: PTGen的地址,默认是我自建的PTGen,可能会不稳定
  • announce_url: 制种时的announce地址

NexusPHP

相比基础参数,NexusPHP插件特有的参数有:

  • upload_url: 发种页面的地址
  • encoder_log: 压制log的地址,如果提供的话会在介绍的mediainfo部分附上压制log
  • easy_upload: 默认开启,关闭的话会直接在命令行输出主/副标题,描述和mediainfo
  • trim_description: 默认关闭,开启的话会省略掉上传链接的描述部分,以避免链接过长浏览器无法打开的问题

其他插件

为保护站点信息,请到plugins文件夹查看或者dft [插件名称] -h查看支持的参数

TODO

  • [] 更好的出错管理
  • 识别已经生成过的截图,不重复截图
You might also like...
Comments
  • Bump pillow from 9.0.0 to 9.0.1

    Bump pillow from 9.0.0 to 9.0.1

    Bumps pillow from 9.0.0 to 9.0.1.

    Release notes

    Sourced from pillow's releases.

    9.0.1

    https://pillow.readthedocs.io/en/stable/releasenotes/9.0.1.html

    Changes

    • In show_file, use os.remove to remove temporary images. CVE-2022-24303 #6010 [@​radarhere, @​hugovk]
    • Restrict builtins within lambdas for ImageMath.eval. CVE-2022-22817 #6009 [radarhere]
    Changelog

    Sourced from pillow's changelog.

    9.0.1 (2022-02-03)

    • In show_file, use os.remove to remove temporary images. CVE-2022-24303 #6010 [radarhere, hugovk]

    • Restrict builtins within lambdas for ImageMath.eval. CVE-2022-22817 #6009 [radarhere]

    Commits
    • 6deac9e 9.0.1 version bump
    • c04d812 Update CHANGES.rst [ci skip]
    • 4fabec3 Added release notes for 9.0.1
    • 02affaa Added delay after opening image with xdg-open
    • ca0b585 Updated formatting
    • 427221e In show_file, use os.remove to remove temporary images
    • c930be0 Restrict builtins within lambdas for ImageMath.eval
    • 75b69dd Dont need to pin for GHA
    • cd938a7 Autolink CWE numbers with sphinx-issues
    • 2e9c461 Add CVE IDs
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump pillow from 8.3.2 to 9.0.0

    Bump pillow from 8.3.2 to 9.0.0

    Bumps pillow from 8.3.2 to 9.0.0.

    Release notes

    Sourced from pillow's releases.

    9.0.0

    https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html

    Changes

    ... (truncated)

    Changelog

    Sourced from pillow's changelog.

    9.0.0 (2022-01-02)

    • Restrict builtins for ImageMath.eval(). CVE-2022-22817 #5923 [radarhere]

    • Ensure JpegImagePlugin stops at the end of a truncated file #5921 [radarhere]

    • Fixed ImagePath.Path array handling. CVE-2022-22815, CVE-2022-22816 #5920 [radarhere]

    • Remove consecutive duplicate tiles that only differ by their offset #5919 [radarhere]

    • Improved I;16 operations on big endian #5901 [radarhere]

    • Limit quantized palette to number of colors #5879 [radarhere]

    • Fixed palette index for zeroed color in FASTOCTREE quantize #5869 [radarhere]

    • When saving RGBA to GIF, make use of first transparent palette entry #5859 [radarhere]

    • Pass SAMPLEFORMAT to libtiff #5848 [radarhere]

    • Added rounding when converting P and PA #5824 [radarhere]

    • Improved putdata() documentation and data handling #5910 [radarhere]

    • Exclude carriage return in PDF regex to help prevent ReDoS #5912 [hugovk]

    • Fixed freeing pointer in ImageDraw.Outline.transform #5909 [radarhere]

    • Added ImageShow support for xdg-open #5897 [m-shinder, radarhere]

    • Support 16-bit grayscale ImageQt conversion #5856 [cmbruns, radarhere]

    • Convert subsequent GIF frames to RGB or RGBA #5857 [radarhere]

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • NameError: name 'main_file' is not defined

    NameError: name 'main_file' is not defined

    2022-05-04 15:19:43.543 | WARNING | differential.utils.mediainfo:get_resolution:183 - 无法获取到视频的分辨率 2022-05-04 15:19:43.544 | ERROR | main::8 - An error has been caught in function '', process 'MainProcess' (933041), thread 'MainThread' (140306609316480): Traceback (most recent call last):

    File "/home/lei/.pyenv/versions/3.9.10/bin/dft", line 8, in sys.exit(main()) │ │ └ <function main at 0x7f9baca2bc10> │ └ └ <module 'sys' (built-in)> File "/home/lei/.pyenv/versions/3.9.10/lib/python3.9/site-packages/differential/main.py", line 24, in main REGISTERED_PLUGINSplugin.upload() │ │ └ {'generate_nfo': False, 'make_torrent': True, 'screenshot_count': 0, 'optimize_screenshot': 'true', 'image_hosting': <ImageHo... │ └ 'NexusPHP' └ {'nexusphp': <class 'differential.plugins.nexusphp.NexusPHP'>, 'nexus': <class 'differential.plugins.nexusphp.NexusPHP'>, 'ne... File "/home/lei/.pyenv/versions/3.9.10/lib/python3.9/site-packages/differential/plugins/base.py", line 1079, in upload self._prepare() │ └ <function Base._prepare at 0x7f9bab4a6ee0> └ <differential.plugins.nexusphp.NexusPHP object at 0x7f9bab411be0> File "/home/lei/.pyenv/versions/3.9.10/lib/python3.9/site-packages/differential/plugins/base.py", line 796, in _prepare self._screenshots = self._get_screenshots() │ │ │ └ <function Base._get_screenshots at 0x7f9bab4a6e50> │ │ └ <differential.plugins.nexusphp.NexusPHP object at 0x7f9bab411be0> │ └ [] └ <differential.plugins.nexusphp.NexusPHP object at 0x7f9bab411be0> File "/home/lei/.pyenv/versions/3.9.10/lib/python3.9/site-packages/differential/plugins/base.py", line 765, in _get_screenshots temp_dir = self._make_screenshots() │ └ <function Base._make_screenshots at 0x7f9bab4a6dc0> └ <differential.plugins.nexusphp.NexusPHP object at 0x7f9bab411be0> File "/home/lei/.pyenv/versions/3.9.10/lib/python3.9/site-packages/differential/plugins/base.py", line 719, in _make_screenshots duration = get_duration(self._mediainfo) │ │ └ <pymediainfo.MediaInfo object at 0x7f9bad5c4f70> │ └ <differential.plugins.nexusphp.NexusPHP object at 0x7f9bab411be0> └ <function get_duration at 0x7f9babeedee0> File "/home/lei/.pyenv/versions/3.9.10/lib/python3.9/site-packages/differential/utils/mediainfo.py", line 174, in get_duration logger.error(f"未找到视频Track,请检查{main_file}是否为支持的文件") │ └ <function Logger.error at 0x7f9bacb09550> └ <loguru.logger handlers=[(id=0, level=10, sink=), (id=1, level=5, sink='test.log')]>

    NameError: name 'main_file' is not defined

    bug 
    opened by LeiShi1313 0
Releases(0.6.2)
Owner
Lei Shi
咸鱼一个
Lei Shi
An implementation to rank your favourite songs from World of Walker

World-Of-Walker-Elo An implementation to rank your favourite songs from Alan Walker's 2021 album World of Walker. Uses the Elo rating system, which is

1 Nov 26, 2021
Edorado93 - Unraveling a Rockstar! -- Too much? Fine, Unraveling a humble programmer then?

Hi, I'm Sachin Malhotra ( ⛄ 💻 🎃 🍺 ) Let me set the records straight. Roger Federer is the GOAT and I will not hear otherwise! Now that we have that

Sachin Malhotra 7 Dec 25, 2022
Automated Changelog/release note generation

Quickly generate changelogs and release notes by analysing your git history. A tool written in python, but works on any language.

Documatic 95 Jan 03, 2023
MIXLAB_NASA_TICKET mixlab 灵感来源于NASA的火星船票

MIXLAB_NASA_TICKET mixlab 灵感来源于NASA的火星船票,我们想要使用开源的代码来定制化这一设计。 其中photo_to_cartoon 是paddle的开源代码:https://github.com/minivision-ai/photo2cartoon-paddle 也借

tongji_cy 38 Feb 20, 2022
Functional collections extension functions for Python

pyfuncol pyfuncol Installation Usage API Documentation Compatibility Contributing License A Python functional collections library. It extends collecti

Andrea Veneziano 32 Nov 16, 2022
A small site to list shared directories

Nebula Server Directories This site can be used to list folder and subdirectories in your server : Python It's required to have Python 3.8 or more ins

Adrien J. 1 Dec 28, 2021
A beautiful and useful prompt for your shell

A Powerline style prompt for your shell A beautiful and useful prompt generator for Bash, ZSH, Fish, and tcsh: Shows some important details about the

Buck Ryan 6k Jan 08, 2023
Covid-19-Trends - A project that me and my friends created as the CSC110 Final Project at UofT

Covid-19-Trends Introduction The COVID-19 pandemic has caused severe financial s

1 Jan 07, 2022
A simple tool made in Python language

Simple tool Uma simples ferramenta feita 100% em linguagem Python 💻 Requisitos: Python3 instalado em seu dispositivo Clonagem e acesso 📳 git clone h

josh washington 4 Dec 07, 2021
This is the old code for bitcoin risk metric, the whole purpose form it is to help you DCA your investment according to bitcoin risk.

About The Project This is the old code for bitcoin risk metric, the whole purpose form it is to help you DCA your investment according to bitcoin risk

BitcoinRaven 2 Aug 03, 2022
Job Guy Backend

جاب‌گای چیست؟ اونجا وضعیت چطوریه؟ یه سوال به همین کلیت و ابهام معمولا وقتی برای یه شرکت رزومه می‌فرستیم این سوال کلی و بزرگ برای همه پیش میاد.اونجا وض

Jobguy.work 217 Dec 25, 2022
Simple utlity for sniffing decrypted HTTP/HTTPS traffic on a jailbroken iOS device into an HAR format.

Description iOS devices contain a hidden feature for sniffing decrypted HTTP/HTTPS traffic from all processes using the CFNetwork framework into an HA

83 Dec 25, 2022
🙌Kart of 210+ projects based on machine learning, deep learning, computer vision, natural language processing and all. Show your support by ✨ this repository.

ML-ProjectKart 📌 Repository This kart showcases the finest collection of all projects based on machine learning, deep learning, computer vision, natu

Prathima Kadari 203 Dec 28, 2022
Tools I'm building in order to help my investments decisions

b3-tools Tools I'm building in order to help my investments decisions. Based in the REITs I've in my personal portifolio I ran a script that scrapy th

Rafael Cassau 2 Jan 21, 2022
This is a backport of the BaseExceptionGroup and ExceptionGroup classes from Python 3.11.

This is a backport of the BaseExceptionGroup and ExceptionGroup classes from Python 3.11. It contains the following: The exceptiongroup.BaseExceptionG

Alex Grönholm 19 Dec 15, 2022
Reproduction repository for the MDX 2021 Hybrid Demucs model

Submission This is the submission for MDX 2021 Track A, for Track B go to the track_b branch. Submission Summary Submission ID: 151378 Submitter: defo

Alexandre Défossez 62 Dec 18, 2022
Generate your personal 8-bit avatars using Cellular Automata, a mathematical model that simulates life, survival, and extinction

Try the interactive demo here ✨ ✨ Sprites-as-a-Service is an open-source web application that allows you to generate custom 8-bit sprites using Cellul

Lj Miranda 265 Dec 26, 2022
Machine Learning powered app to decide whether a photo is food or not.

Food Not Food dot app ( 🍔 🚫 🍔 ) Code for building a machine Learning powered app to decide whether a photo is of food or not. See it working live a

Daniel Bourke 48 Dec 28, 2022
Account Manager / Nuker with GUI.

Account Manager / Nuker Remove all friends Block all friends Leave all servers Mass create servers Close all dms Mass dm Exit Setup git clone https://

Lodi#0001 1 Oct 23, 2021
Password manager using MySQL and Python 3.10.2

Password Manager Password manager using MySQL and Python 3.10.2 Installation Install my-project with github git clone https://github.com/AyaanSiddiq

1 Feb 18, 2022