一个可以自动生成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
Open source book about making Python packages.

Python packages Tomas Beuzen & Tiffany Timbers Python packages are a core element of the Python programming language and are how you create organized,

Python Packages 169 Jan 06, 2023
Data Structures and Algorithms Python - Practice data structures and algorithms in python with few small projects

Data Structures and Algorithms All the essential resources and template code nee

Hesham 13 Dec 01, 2022
MobaXterm-GenKey

MobaXterm-GenKey 你懂的!! 本地启动 需要安装Python3!!!

malaohu 328 Dec 29, 2022
Transform your boring distro into a hacking powerhouse.

Pentizer Transform your boring distro into a hacking powerhouse. Pentizer is a personal project that imports Kali and Parrot repositories in any Debia

Michail Tsimpliarakis 2 Nov 05, 2021
Liquid Rocket Engine Cooling Simulation

Liquid Rocket Engine Cooling Simulation NASA CEA The implemented class calls NASA CEA via RocketCEA. INSTALL GUIDE In progress install instructions fo

John Salib 1 Jan 30, 2022
Workshop OOP - Workshop OOP - Discover object-oriented programming

About: This is an open-source bot, the code is open for anyone to see, fork and

Francis Clairicia-Rose-Claire-Joséphine 5 May 02, 2022
Multi View Stereo on Internet Images

Evaluating MVS in a CPC Scenario This repository contains the set of artficats used for the ENGN8601/8602 research project. The thesis emphasizes on t

Namas Bhandari 1 Nov 10, 2021
Covid-ml-predictors - COVID predictions using AI.

COVID Predictions This repo contains ML models to be trained on COVID-19 data from the UK, sourced off of Kaggle here. This uses many different ML mod

1 Jan 09, 2022
Notes on the Deep Learning book from Ian Goodfellow, Yoshua Bengio and Aaron Courville (2016)

The Deep Learning Book - Goodfellow, I., Bengio, Y., and Courville, A. (2016) This content is part of a series following the chapter 2 on linear algeb

hadrienj 1.7k Jan 07, 2023
TimeWizard - A script that generates every single Time Wizard EDOPRO lflist possible

EDOPRO F&L list generator This project is just a script that generates every sin

Diamond Dude 2 Sep 28, 2022
This is the accompanying repository for the Bloomberg Global Coal Countdown website.

This is the accompanying repository for the Bloomberg Global Coal Countdown (BGCC) website. Data Sources Dashboard Data Schema and Validation License

7 Jun 01, 2022
Generate a wordlist to fuzz amounts or any other numerical values.

Generate a wordlist to fuzz amounts or any other numerical values. Based on Common Security Issues in Financially-Oriented Web Applications.

Ivan Šincek 3 Oct 14, 2022
Clock in automatically in SCU.

auto_clock_in Clock in automatically in SCU. Features send logs to Telegram bot How to use? pip install -r requirements.txt () edit user_list, token_A

2 Dec 13, 2021
Delayed iteration for polling and retries.

Does Python need yet another retry / poll library? It needs at least one that isn't coupled to decorators and functions. Decorators prevent the caller

A. Coady 22 Dec 29, 2022
Project Interface For nextcord-ext

Project Interface For nextcord-ext

nextcord-ext 1 Nov 13, 2021
Building an Investment Portfolio for Day Trade with Python

Montando um Portfólio de Investimentos para Day Trade com Python Instruções: Para reproduzir o projeto no Google Colab, faça o download do repositório

Paula Campigotto 9 Oct 26, 2021
It's a repo for Cramer's rule, which is some math crap or something idk

It's a repo for Cramer's rule, which is some math crap or something idk (just a joke, it's not crap; don't take that seriously, math teachers)

Module64 0 Aug 31, 2022
Age of Empires II recorded game parsing and summarization in Python 3.

mgz Age of Empires II recorded game parsing and summarization in Python 3. Supported Versions Age of Kings (.mgl) The Conquerors (.mgx) Userpatch 1.4

148 Dec 11, 2022
Cross-platform config and manager for click console utilities.

climan Help the project financially: Donate: https://smartlegion.github.io/donate/ Yandex Money: https://yoomoney.ru/to/4100115206129186 PayPal: https

3 Aug 31, 2021
A comprensive software collection for nmea manipulation

nmeatoolkit A comprensive software collection for nmea manipulation; it includes a library and a collections of command line tools. Library pipes: con

Davide Gessa 1 Sep 14, 2022