Giter Site home page Giter Site logo

py3createtorrent's Introduction

py3createtorrent

Create torrents via command line!

py3createtorrent is a comprehensive shell/commandline utility for creating torrents (Linux & Windows).

Features

Some of the features:

  • create torrents with multiple trackers or trackerless torrents
  • automatically choose the most reliable trackers from ngosang/trackerslist
  • fast torrent creation thanks to multithreading
  • add webseeds to torrents
  • create private torrents (disabled DHT, ...)
  • exclude specific files/folders
  • exclude files/folders based on regular expressions
  • specify custom piece sizes
  • specify custom creation dates

Basic usage

Creating a torrent is as simple as:

py3createtorrent -t udp://tracker.opentrackr.org:1337/announce file_or_folder

The shortcut bestN can be used for conveniently adding the best N trackers from ngosang/trackerslist. Example:

py3createtorrent -t best3 file_or_folder

Multiple trackers can also be specified manually by using -t multiple times, for example:

py3createtorrent -t udp://tracker.opentrackr.org:1337/announce -t udp://tracker.cyberia.is:6969/announce file_or_folder

Install

You can install py3createtorrent by executing:

pip3 install py3createtorrent

Of course, you need to have Python 3 installed on your system. py3createtorrent requires Python 3.5 or later.

Full documentation

https://py3createtorrent.readthedocs.io/en/latest/user.html

py3createtorrent's People

Contributors

cpurules avatar dependabot[bot] avatar rsnitsch avatar toasteruwu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

py3createtorrent's Issues

Error with path exceeded than 260 characters in Windows

I cannot create some torrent that have too long path in directory. Is it about with MAX_PATH?

py3createtorrent_max_path

I tried to enable long path registry with this link but it can't solved.

PS: I'm currently using it in Windows 10, I don't know about this problem in Linux.

About RegEx issue

When I want to use the -e option to exclude specific file types like rar, r00, r01, r02,... r99, etc.

-exclude-pattern '^.*\.r.*$'

image

It gives such error.
image

But this RegEx is OK with the following command,
ls |grep -E '^.*\.r.*$'
So I am wondering if py3createtorrent only support RegEx formats in your examples, like "(jpg|JPG)$" only?

UnicodeEncodeError

This filename causes a crash, I renamed the file but still wanted to report:

'Chemie (1983)(Gerd K'$'\366''nig).sna'

Traceback (most recent call last):
File "/usr/local/bin/py3createtorrent", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/py3createtorrent.py", line 913, in main
info = create_multi_file_info(input_path, torrent_files, piece_length, args.include_md5, threads=args.threads)
File "/usr/local/lib/python3.9/dist-packages/py3createtorrent.py", line 255, in create_multi_file_info
printv("Processing file '%s'... " % os.path.relpath(path, directory), end="")
File "/usr/local/lib/python3.9/dist-packages/py3createtorrent.py", line 125, in printv
print(*args, **kwargs)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcf6' in position 106: surrogates not allowed

Support for usage as a module

py3createtorrent can as of now only be used as a CLI tool but it'd be super useful if it exposed methods to use from other python modules.

Make "master" the default branch again

IDK why you made the "develop" branch the default, but that's not really good.
It's confusing to have a "master" branch, but it not being the master branch.

I suggest you make a PR to merge all the stuff from develop into master, and then change the default back to master. For the sake of following the standard and not confusing people.

I would do it myself, but to make a PR for two branches of your repo, I would need to be a collaborator.

@rsnitsch

Is 16MiB a hard limit for max pieces size?

Hi author,

Thanks for sharing the great tools! I am using your implementation to prototype torrent seeding for large language models in huggingface. Those files (usually >10GB) will lead to many chunks thus make .torrent file itself very large.

I am considering whether we should increase the piece_length in calculate_piece_length(), but noticing there is one comment saying

Proceeding:
1. Start with 256 KIB.
2. While piece count > 2000: double piece length.
3. While piece count < 8:    use half the piece length.

However, enforce these bounds:
- minimum piece length = 16 KiB.
- maximum piece length = 16 MiB.

I checked the specification and documents for torrent protocal but didn't find the source of 16MiB. I wonder is this a hard limit?

Faulty torrent name and 'name' field when using relative path '.'

@SMooxx reported in #10 that creating a torrent for a directory referenced via "." results in faulty torrent names.

Original report:

Another issue here. I used to use mktorrent which can support ‘relative path'.
But it seems py3createtorrent can't support 'relative path' here. For example, If I use it like this,
py3createtorrent -v -p 8192 -P -s FL -o ~/example.torrent -d -1 -t https://tracker/announce.php --exclude-pattern "(^.*\.r.*|sfv)$" ./
It will create a torrent with a wierd name [. ] in its name field, and I can't add this torrent to my torrent client anyway.
image

If I change the path to full path, the torrent created will be OK.

Link: #10 (comment)

Support for optimise alignment (Piece-Aligned, BEP-47) ?

I have reviewed the usage documentation and it seems that there is no mention of support for this feature.
Could u plz support this feature (Based on BEP-47) when creating v1 torrent?
cuz torrents containing multi files often get stuck at 99.x% when download, if not piece-aligned when creating.
thanks.


Padding files and extended file attributes.

https://www.bittorrent.org/beps/bep_0047.html
Padding files are synthetic files inserted into the file list to let the following file start at a piece boundary. That means their length should fill up the remainder of the piece length of the file that is supposed to be padded.

Related Information:

https://forum.qbittorrent.org/viewtopic.php?p=41005#p41005

Remove created_by attribute

Hi, in the code I see there is a reference to no_created_by but I don't see any CLI option. Are there any plans to add this? Thank you!

Torrent name assignment

I am trying to get the program to use the name of the file as the name it will show in the torrent but the torrent is not created.
using a bat file

the torrent is not created if the name contains parentheses

-n "%~nx1" %*

Trackerless torrent

How do I create one?
It’s a requirement of some site which modifies created .torrent later by own means.

noob question

when i execute the command it say

IOError: [Errno 13] Permission denied: 'Flirting (1988) NTSC DVD5.mkv.torrent'
Could not write the torrent file. Check torrent name and your privileges.

on debian.
thanks

run fails with "SyntaxError: invalid syntax"

Running py3createtorrent results in immediate SyntaxError.

‣ py3createtorrent
Traceback (most recent call last):
  File "/usr/local/bin/py3createtorrent", line 5, in <module>
    from py3createtorrent import main
  File "/usr/local/lib/python3.5/dist-packages/py3createtorrent.py", line 339
    parts: List[str] = []
         ^
SyntaxError: invalid syntax

Using python 3.5.3, py3createtorrent version 1.0.0.dev2. Installed using python -m pip install py3createtorrent.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.