Skip to content

Instantly share code, notes, and snippets.

@dacioromero
Last active May 22, 2020 08:48
Show Gist options
  • Save dacioromero/8a7e96ab85e5df6f7a9b1b69c92e38c7 to your computer and use it in GitHub Desktop.
Save dacioromero/8a7e96ab85e5df6f7a9b1b69c92e38c7 to your computer and use it in GitHub Desktop.
Update qBittorrent trackers from https://github.com/ngosang/trackerslist daily
@daily /usr/local/bin/python3 /root/update-trackers.py
attrdict==2.0.1
certifi==2020.4.5.1
chardet==3.0.4
idna==2.9
qbittorrent-api==2020.5.3
requests==2.23.0
six==1.15.0
urllib3==1.25.9
import qbittorrentapi, requests
qb = qbittorrentapi.Client(host='localhost:8080')
qb.auth_log_in()
new_trackers = requests.get('https://ngosang.github.io/trackerslist/trackers_best.txt').text.split()
for torrent in qb.torrents_info():
trackers = torrent.trackers[3:]
# This is optional
if trackers:
torrent.remove_trackers(t['url'] for t in trackers)
torrent.add_trackers(new_trackers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment