12 lines
392 B
Python
12 lines
392 B
Python
import bencodepy
|
|
import os
|
|
|
|
for filename in os.listdir('.'):
|
|
if filename[-7:] == 'torrent':
|
|
t = bencodepy.decode_from_file(filename)
|
|
if b'jack.yggtorrent.com' in t.get(b'announce', b''):
|
|
t[b'announce'] = t[b'announce'].replace(b'jack.yggtorrent.com', b'tracker.ygg.is')
|
|
with open(filename, 'wb') as f:
|
|
f.write(bencodepy.encode(t))
|
|
|