File: change_torrent_file.py

package info (click to toggle)
python-transmission-rpc 7.0.11-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 440 kB
  • sloc: python: 2,605; sh: 9; makefile: 4
file content (12 lines) | stat: -rw-r--r-- 354 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
from transmission_rpc import Client

client = Client()

t = client.get_torrent(0)

client.change_torrent(
    t.hashString,
    files_unwanted=[f.id for f in t.get_files() if f.name.endswith(".txt")],
    priority_high=[f.id for f in t.get_files() if f.name.endswith(".mp4")],
    priority_low=[f.id for f in t.get_files() if f.name.endswith(".txt")],
)