Skip to content

Instantly share code, notes, and snippets.

@2minchul
Last active November 20, 2021 17:42
Show Gist options
  • Save 2minchul/41619865e6b7140394633e0d7510610b to your computer and use it in GitHub Desktop.
Save 2minchul/41619865e6b7140394633e0d7510610b to your computer and use it in GitHub Desktop.
Update qBittorrent tracker list from url
import json
import os
import requests
trackers_list_url = 'https://newtrackon.com/api/stable'
qbt_host = 'http://localhost:8081'
custom_trackers = '''
http://open.acgnxtracker.com:80/announce
udp://fe.dealclub.de:6969/announce
udp://engplus.ru:6969/announce
udp://movies.zsw.ca:6969/announce
udp://code2chicken.nl:6969/announce
udp://abufinzio.monocul.us:6969/announce
udp://tracker.0x.tf:6969/announce
https://tracker.lilithraws.cf:443/announce
udp://tracker.zerobytes.xyz:1337/announce
udp://tracker.bitsearch.to:1337/announce
udp://tracker.haynet.io:6969/announce
udp://tracker.jordan.im:6969/announce
udp://jeremylee.sh:6969/announce
udp://tracker-de.ololosh.space:6969/announce
udp://tracker.auctor.tv:6969/announce
http://tracker.nucozer-tracker.ml:2710/announce
udp://tracker2.dler.com:80/announce
udp://tracker.altrosky.nl:6969/announce
https://trackme.theom.nz:443/announce
http://vps02.net.orel.ru:80/announce
udp://discord.heihachi.pw:6969/announce
udp://tracker.blacksparrowmedia.net:6969/announce
udp://tracker.dler.com:6969/announce
udp://tracker.monitorit4.me:6969/announce
udp://tracker.leech.ie:1337/announce
udp://bt2.archive.org:6969/announce
https://tracker.nitrix.me:443/announce
udp://tracker.ololosh.space:6969/announce
http://tracker.files.fm:6969/announce
udp://bt1.archive.org:6969/announce
udp://tracker1.bt.moack.co.kr:80/announce
https://tr.torland.ga:443/announce
udp://www.torrent.eu.org:451/announce
udp://tracker0.ufibox.com:6969/announce
https://tracker.kuroy.me:443/announce
udp://tracker.moeking.me:6969/announce
udp://6ahddutb1ucc3cp.ru:6969/announce
udp://mts.tvbit.co:6969/announce
udp://bubu.mapfactor.com:6969/announce
http://t.nyaatracker.com:80/announce
http://t.overflow.biz:6969/announce
udp://9.rarbg.com:2810/announce
http://bt.okmp3.ru:2710/announce
http://buny.uk:6969/announce
http://ipv4announce.sktorrent.eu:6969/announce
http://nyaa.tracker.wf:7777/announce
http://tracker.ipv6tracker.ru:80/announce
udp://tracker.birkenwald.de:6969/announce
udp://ipv6.tracker.zerobytes.xyz:16661/announce
udp://retracker.hotplug.ru:2710/announce
udp://escorts.subventas.com:53/announce
udp://tracker.beeimg.com:6969/announce
udp://ipv6.tracker.monitorit4.me:6969/announce
udp://tracker.moeking.eu.org:6969/announce
udp://tracker6.lelux.fi:6969/announce
udp://tracker.dix.tf:6969/announce
udp://tracker.pomf.se:80/announce
udp://mail.realliferpg.de:6969/announce
udp://tracker.theoks.net:6969/announce
udp://p4p.arenabg.com:1337/announce
http://anidex.moe:6969/announce
http://tracker.acgnx.se:80/announce
https://tracker.cryental.dev:443/announce
udp://tracker.opentrackr.org:1337/announce
udp://exodus.desync.com:6969/announce
udp://tracker.torrent.eu.org:451/announce
udp://open.stealth.si:80/announce
'''
if __name__ == '__main__':
response = requests.get(trackers_list_url)
response.raise_for_status()
trackers = response.text.split('\n') + custom_trackers.split('\n')
trackers = [line for line in set(trackers) if line]
response = requests.get(qbt_host + '/api/v2/app/preferences')
response.raise_for_status()
new_conf = response.json()
new_conf['add_trackers_enabled'] = True
new_conf['add_trackers'] = '\n'.join(trackers)
response = requests.post(
qbt_host + '/api/v2/app/setPreferences',
data={'json': json.dumps(new_conf)}, # use form-urlencoded, not json
)
response.raise_for_status()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment