Last active
May 22, 2020 08:48
-
-
Save dacioromero/8a7e96ab85e5df6f7a9b1b69c92e38c7 to your computer and use it in GitHub Desktop.
Update qBittorrent trackers from https://github.com/ngosang/trackerslist daily
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@daily /usr/local/bin/python3 /root/update-trackers.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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