• This repository has been archived on 29/May/2022
  • Stars
    star
    270
  • Rank 151,321 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Matches torrents with files and gets them seeded

AutoTorrent

NOT UPDATED ANYMORE: Check out the successor Autotorrent2 https://github.com/JohnDoee/autotorrent2

Given an input torrent, it will scan your collection for the files in the torrent. If all (or most) the files are found, a folder with links to all the files will be created and the torrent added to the torrent client.

All you need to do is download the torrents and AutoTorrent plays mix and match to make it possible to seed as much as possible across trackers.

Requirements

  • Linux, BSD, OSX - Something not windows
  • rTorrent, Deluge, qBittorrent or Transmission
  • Python 2.6+, 3.3+
  • Shell / SSH / Putty

Status

Master branch

https://coveralls.io/repos/github/JohnDoee/autotorrent/badge.svg?branch=master https://travis-ci.org/JohnDoee/autotorrent.svg?branch=master

Develop branch

https://coveralls.io/repos/github/JohnDoee/autotorrent/badge.svg?branch=develop https://travis-ci.org/JohnDoee/autotorrent.svg?branch=develop

Install

From PyPi (stable):

virtualenv autotorrent-env
autotorrent-env/bin/pip install autotorrent

From GitHub (develop):

virtualenv autotorrent-env
autotorrent-env/bin/pip install git+https://github.com/JohnDoee/autotorrent.git#develop

Create the configuration file

autotorrent-env/bin/autotorrent --create_config

Upgrade from previous version

Upgrading from PyPi (stable)

autotorrent-env/bin/pip install --upgrade autotorrent

Upgrading from Github (develop)

autotorrent-env/bin/pip install git+https://github.com/JohnDoee/autotorrent.git#develop --upgrade --force-reinstall

Flags

  • -a FILE, --addfile FILE - Add a new torrent file to the client. Wildcards can be used to expand to all files in a folder (eg: -a /some/folder/*.torrent)
  • -c CONFIG_FILE, --config CONFIG_FILE - Path to config file. Defaults to current terminal folder.
  • --create_config - Creates a new configuration file.
  • -d, --delete_torrents - Delete .torrent files when they are added to the client succesfully.
  • --dry-run - Don't add any torrents to client, just scan for files needed for torrents.
  • -h, --help - Shows help message and exits.
  • -l CLIENT, --client CLIENT - Name of client to use (when multiple configured). Read more here.
  • -r, --rebuild - Rebuilds the database (necessary for new files/file changes on disk).
  • -t, --test-connection - Test the connection to the torrent client.
  • --verbose - Increase output verbosity.

Configuration

All settings can be found and changed in autotorrent.conf, this file must reside in the same folder as autotorrent is executed from.

general

  • db - Path to the database file
  • store_path - Folder where the virtual folders seeded, resides
  • ignore_files - A comma seperated list of files that should be ignored (supports wildcards)
  • add_limit_size - Max size, in bytes, the total torrent size is allowed to vary
  • add_limit_percent - Max percent the total torrent size is allowed to vary
  • link_type - What kind of link should AutoTorrent make? the options are hard, soft and reflink (if supported).
  • scan_mode - options are unsplitable, normal and exact. These can be used in combination. See the scan_modes section for more information.

the add_limit_* variables allow for downloading of e.g. different NFOs and other small files that makes a difference in the torrents.

client

  • client - torrent client to use, choices are: rtorrent, deluge and transmission

rtorrent settings

  • url - URL to rtorrent, must be to the XMLRPC server or SCGI server.
  • label - Label added to torrents when added to rtorrent (used in rutorrent only)

the url supports both SCGI directly and XMLRPC via HTTP.

To use scgi, prefix the url with scgi instead of http, e.g. scgi://127.0.0.1:10000/

To use unix socket for scgi, make an url with no ip:port and instead a path, e.g. scgi:///tmp/rtorrent.socket

deluge settings

  • host - an ip:port pair, e.g. 127.0.0.1:12345
  • username - deluge rpc username
  • password - deluge rpc password
  • label - label the torrent, remember to enable the label plugin

transmission settings

  • url - an url where transmission can be reached, e.g. http://username:[email protected]:9091/transmission/rpc

qbittorrent settings

  • url - an url where qbittorrent web can be reached, e.g. http://127.0.0.1:8080
  • username - qbittorrent webui username
  • password - qbittorrent webui password
  • category - category applied to torrents added by AutoTorrent (similar to label)

disks

A list of disks where to build the search database from.

Scan modes

There are currently three scan modes supported by AutoTorrent. These modes can be used in combination and should all improve the end result.

The modes are named normal, exact and unsplitable. They can be combined by adding a comma between them, e.g. scan_mode=normal,exact,unsplitable

Mode: normal

It takes the filename and size and tries to find files with same name and size.

This mode cannot handle duplicate filename/size pairs.

Mode: exact

The perfect way to move torrent client as it tries to set the download path to the old path.

This mode does not allow for missing files and is intended to re-add non-renamed back to a torrent client.

Mode: unsplitable

This mode takes scene releases and extracted dvd/bluray isos into consideration and relies on the folder it thinks is the main / head folder. Perfect for cross-seeding scene releases.

Mode: hash_name

This mode tries to hashcheck files with the exact name as wanted, but the size might be different (up to 10% different). If pieces match, then it is resized to fit original size and written to the destination directory.

Make sure there is enough space in the target directory.

Mode: hash_size

This mode tries to hashcheck files with the exact size as wanted, but the name might be different.|

Mode: hash_slow

This mode tries to hashcheck files with a size within 10% of the original. If pieces match, then it is resized to fit original size and written to the destination directory.

Make sure there is enough space in the target directory.

This mode is very slow as it will try a lot of files.

Instructions

Start by installing and configuring.

Step 1

Build the database with

autotorrent-env/bin/autotorrent -r

this may take some time.

Step 2

Have some .torrent files ready and run

autotorrent-env/bin/autotorrent -a path/to/torrents/*.torrent

this command will spit out how it went with adding the torrents.

And you're good to go.

FAQ

Q: How are files with relative path in the configuration file, found?

The paths should be relative to the configuration file, e.g. /home/user/autotorrent-env/autotorrent.conf, then store_path=store_paths/X/ resolves to /home/user/autotorrent-env/store_path/.

Q: I have three sites I cross-seed between, how do you suggest I structure it?

Say, you have site X, Y and Z. You want to seed across the sites as they share lots of content. You download all your data into /home/user/downloads/. For this you will need three configuration file, one for each site.

AutoTorrent is installed into /home/user/autotorrent-env/.

Only store_path is recommended to vary between the configuration files (the others are optional).

  • store_path for site X - /home/user/autotorrent-env/store_paths/X/
  • store_path for site Y - /home/user/autotorrent-env/store_paths/Y/
  • store_path for site Z - /home/user/autotorrent-env/store_paths/Z/

disks paths can be:

  • disk1=/home/user/downloads/
  • disk2=/home/user/autotorrent-env/store_paths/X/
  • disk3=/home/user/autotorrent-env/store_paths/Y/
  • disk4=/home/user/autotorrent-env/store_paths/Z/

Q: Can I use the same Database file for several configuration files?

Yes, if they have the same disks. Don't worry about adding the store_path to the disks, AutoTorrent will figure it out.

Q: What problems can occur?

One big problem is that the files are not checked for their actual content, just if their filename matches and size matches. If AutoTorrent tries to use a file that is not complete, then you can end up sending loads of garbage to innocent peers, alhough they should blackball you quite fast.

Q: I want to cross-seed RARed scene releases, what do you think about that?

The actual .rar files must be completely downloaded and the same size. Things that can vary are: nfos, sfvs, samples and subs.

The releases must also have an sfv in the same folder as the rar files files.

Q: What are hardlinks and what are the risks or problems associated with using them?

See: http://www.cyberciti.biz/tips/understanding-unixlinux-symbolic-soft-and-hard-links.html

Q: Can I have multiple clients configured simultaneously?

Yes, this can be done by prefixing a name of your choosing, with client-. For example, you can name the section client-goodclient instead of just client. Then specify the new client/name without the prefix using the commandline argument

::
autotorrent -l goodclient

License

MIT, see LICENSE

More Repositories

1

deluge-streaming

Streaming plugin for deluge, making it possible to read torrents and download required parts on-demand.
Python
138
star
2

autotorrent2

Cross-seed matching and torrent lifecycle tool
Python
136
star
3

deluge-client

A very lightweight pure-python Deluge RPC Client
Python
87
star
4

magnet2torrent

Turn a bittorrent magnet link into a .torrent file
Python
62
star
5

spreadsheetui

A spreadsheet-like UI for your torrent clients.
Python
50
star
6

flexget-cross-seed

Get torrents for data you already have locally
Python
15
star
7

imdbparser

Basic IMDB Parser with a nice MIT license
Python
14
star
8

txasgiresource

Implementation of the ASGI application standard as a Twisted Resource
Python
11
star
9

pyrfc6266

Implementation of content-disposition header parsing without LEPL (rfc6266)
Python
11
star
10

rippy

Scrape websites using Chrome
Python
10
star
11

libtc

Bittorrent client abstraction to easily integrate a variety of clients.
Python
9
star
12

the-cute-collection

A list of audio/video based subtitle tools for syncing and alike.
Python
8
star
13

kodi-deluge-streaming

Stream torrents from Deluge directly in Kodi
Python
8
star
14

rtorrent-automover

Moves complete torrents automagically for rtorrent.
Python
7
star
15

malparser

MyAnimeList Parser
Python
5
star
16

rip-avgle

DEPRECATED - See https://github.com/JohnDoee/rippy
Python
5
star
17

StreamProtocol

Making stream links clickable and streamable
C#
4
star
18

pylev2

Levenshtein distance library for Python
C
3
star
19

wampyre

WAMP Router in Python made for embedded situations
Python
2
star
20

TimeoutThreadPoolExecutor

Backported ThreadPoolExecutor that also cleans up unused threads
Python
2
star
21

unplugged

A pluginsystem for Django and Twisted
Python
2
star
22

tidalstream-recoder

Reencodes files real-time and outputs a stream compatible with.... whatever
Python
1
star
23

rippy-webinterface

TypeScript
1
star
24

web-parsers

Parsing various websites for their delicious data and lack of API
HTML
1
star
25

rippy-docker

Python
1
star
26

grepmx

Grep emails in a file based on their MX
Python
1
star
27

spreadsheetui-webinterface

Webinterface for Spreadsheet UI
TypeScript
1
star
28

tidalstream.org

TidalStream website
CSS
1
star
29

thomas

Thomas allows parallel http downloads and is an alternative to Axel (and other stuff!)
Python
1
star
30

tidalstream-webinterface

Webinterface for TidalStream API Server
CoffeeScript
1
star