Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@matrixd
Last active November 4, 2022 15:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matrixd/b9a875717fa1950db03f to your computer and use it in GitHub Desktop.
Save matrixd/b9a875717fa1950db03f to your computer and use it in GitHub Desktop.
Import all torrents from deluge to transmission
import os
import re
#it's supposed that you are in "state" directory
#~/.config/deluge/state
f = open("torrents.state")
buf = f.read()
f.close()
p = re.findall("sg21\\nS\'([^']+)", buf)
t = re.findall("sg25\\nS\'(\w+)\'", buf)
for n in range(0,len(p)):
print(t[n]+".torrent")
print(p[n])
#if you don't run transmission as a daemon, you have to change this string
#don't forget to check port:host
os.system("transmission-remote localhost:9091 -a %s -w %s" % (t[n]+".torrent",p[n]))
print('--------')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment