Metadata-Version: 2.3
Name: pptu
Version: 2026.10.24.1
Summary: Python P2P Torrent Uploader
Author: pcroland, varyg
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: beautifulsoup4>=4.12.3,<5.0.0
Requires-Dist: guessit>=4.1.0,<5.0.0
Requires-Dist: humanize>=4.9.0,<5.0.0
Requires-Dist: langcodes>=3.4.0,<4.0.0
Requires-Dist: lxml>=6.0.1,<7.0.0
Requires-Dist: platformdirs>=4.2.2,<5.0.0
Requires-Dist: pymediainfo>=7.0.0,<8.0.0
Requires-Dist: pyotp>=2.9.0,<3.0.0
Requires-Dist: pyoxipng>=9.0.0,<10.0.0
Requires-Dist: pyrosimple>=2.14.0,<3.0.0
Requires-Dist: rich>=15.0.0,<16.0.0
Requires-Dist: toml>=0.10.2,<1.0.0
Requires-Dist: torf>=4.2.7,<5.0.0
Requires-Dist: pillow>=13.0.0
Requires-Dist: cloup>=3.0.7,<4.0.0
Requires-Dist: niquests[full,utls]>=3.15.2
Requires-Dist: ordered-set>=4.1.0,<5.0.0
Requires-Dist: orjson>=3.11.3
Requires-Dist: beaupy>=3.10.2
Requires-Dist: language-data>=1.3.0
Requires-Dist: pymal-ng>=1.0.0
Requires-Python: >=3.11, <3.15
Project-URL: Homepage, https://github.com/encoding-hun/pptu
Project-URL: Source, https://github.com/encoding-hun/pptu
Description-Content-Type: text/markdown

<p align="center"><img width="350" src="logo/logo.svg"><br>Python P2P Torrent Uploader</p>

## Requirements

- Python 3.10 to 3.13
- Python package dependencies (`uv sync --frozen` – requires uv 0.8.0 or newer – or `pip install .`)
- torrenttools (for creating torrents, optional)
- MediaInfo CLI (for generating tech info)
- FFmpeg (for generating snapshots)

## Supported trackers

<table>
  <tr>
    <th>Name</th>
    <th>Acronym</th>
    <th>Auth</th>
    <th>Protection</th>
    <th>Captcha</th>
    <th>Server upload allowed</th>
  </tr>
  <tr>
    <th colspan="6">General</th>
  </tr>
  <tr>
    <th>BroadcasTheNet</th>
    <td align="center"><code>BTN</code></td>
    <td align="center">Credentials/<br />Cookies</td>
    <td align="center"><img src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png" width="14" /> None</td>
    <td align="center"><img src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png" width="14" /> No</td>
    <td><img src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png" width="14" /> Dedicated servers only, requires staff approval</td>
  </tr>
  <tr>
    <th>HDBits</th>
    <td align="center"><code>HDB</code></td>
    <td align="center">Credentials/<br />Cookies</td>
    <td align="center"><img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png" width="14" /> Cloudflare</td>
    <td align="center"><img width="14" src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png"> Simple</td>
    <td><img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png" width="14" /> Yes, if IP whitelisted in profile or 2FA enabled</td>
  </tr>
  <tr>
    <th>nCore</th>
    <td align="center"><code>nC</code></td>
    <td align="center">Credentials/<br />Cookies</td>
    <td align="center"><img src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png" width="14" /> None</td>
    <td align="center"><img src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png" width="14" /> No</td>
    <td><img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png" width="14" /> Yes</td>
  </tr>
  <tr>
    <th>nekoBT</th>
    <td align="center"><code>nBT</code></td>
    <td align="center">API key</td>
    <td align="center"><img src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png" width="14" /> None</td>
    <td align="center"><img src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png" width="14" /> No</td>
    <td><img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png" width="14" /> Yes</td>
  </tr>
  <tr>
    <th>Nyaa</th>
    <td align="center"><code>nyaa</code></td>
    <td align="center">Credentials</td>
    <td align="center"><img src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png" width="14" /> DDoS-Guard</td>
    <td align="center"><img src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png" width="14" /> No</td>
    <td><img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png" width="14" /> Yes</td>
  </tr>
  <tr>
    <th>PassThePopcorn</th>
    <td align="center"><code>PTP</code></td>
    <td align="center">Credentials/<br />Cookies</td>
    <td align="center"><img src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png" width="14" /> None</td>
    <td align="center"><img src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png" width="14" /> No</td>
    <td><img src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png" width="14" /> Dedicated servers only, requires staff approval</td>
  </tr>
  <tr>
    <th colspan="6">AvistaZ Network</th>
  </tr>
  <tr>
    <th>AvistaZ</td>
    <td align="center"><code>AvZ</code></td>
    <td align="center" rowspan="3">Credentials/<br />Cookies</td>
    <td align="center" rowspan="3"><img src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png" width="14" /> None</td>
    <td align="center" rowspan="3"><img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png" width="14" /> Yes</td>
    <td rowspan="3"><img src="https://github.githubassets.com/images/icons/emoji/unicode/2714.png" width="14" /> Yes, if IP whitelisted in profile</td>
  </tr>
  <tr>
    <th>CinemaZ</th>
    <td align="center"><code>CZ</code></td>
  </tr>
  <tr>
    <th>PrivateHD</th>
    <td align="center"><code>PHD</code></td>
  </tr>
</table>

For sites with captcha, a 2captcha API key is required to solve the captcha. Manual solving may be added in the future.
"Simple" captchas can be solved automatically without 2captcha or user interaction.

### PassThePopcorn

- Credential auth requires passkey in addition to username and password.

### AvistaZ Network

- Using credential auth is strongly recommended as cookies always expire within a few days.

## Installation

Install dependencies and the script with `./install.py`. You can re-run the script to update after a git pull.

## Setup

Copy `config.example.toml` to `~/.config/pptu/config.toml` and edit it as appropriate.

For credential-based auth, add your credentials in `~/.config/pptu/config.toml`:

```
[TRACKER]
username = "yourusername"
password = "yourpassword"
```

Optionally, you may specify `totp_secret` for automating 2FA logins.
Optionally, you may specify `img_uploader` for image host site.

For cookie-based auth, place cookies in `~/.local/share/pptu/cookies/TRACKER.txt`.

`TRACKER` is the name or the abbreviation of the tracker above (all lowercase).

## Usage

```
❯ pptu -h

Usage: pptu [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

Options:
   -v, --version                      Show the version and exit.
   -i, --input PATH                   Files or directories to create torrents for.
   --fast-upload / --no-fast-upload   Upload only after all steps succeed (or force-disable).
   -c, --confirm                      Ask for confirmation before uploading.
   -a, --auto                         Run non-interactively (never prompt).
   -ds, --disable-snapshots           Skip creating description snapshots.
   -s, --skip-upload                  Create torrents but don't upload.
   -n, --note TEXT                    Note to attach to the upload.
   -lt, --list-trackers               Show the list of supported trackers and exit.
   -h, --help                         Show this message and exit.

Uploaders (9):
   AvistaZ          https://avistaz.to/
   BroadcasTheNet   https://broadcasthe.net/
   CinemaZ          https://cinemaz.to/
   HDBits           https://hdbits.org/
   nCore            https://ncore.pro/
   nekoBT           https://nekobt.to/
   Nyaa             https://nyaa.si/
   PassThePopcorn   https://passthepopcorn.me/
   PrivateHD        https://privatehd.to/

```

### Example

```shell
pptu -i /path/example.mkv -i /path/example2.mkv hdb nc --request-id 12356
```
