deluge_path_change v0.1

Post Reply
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

deluge_path_change v0.1

Post by mhertz »

This CLI tool can be used to change path of torrents from torrents.state in your deluge profile dir, and big thanks to Cas for original tracker change script which this based from. Keep backups if trying it, as can be issues I missed, and only tested quickly on a few torrents, on linux and in my test win10 VM. it's for linux and windows, and for windows use the pyinstaller built exe(in a cmd-prompt) which I build to work on both 64/32-bit - little big(15mb) and slow running, because need include some deluge/libtorrent modules(pickling torrents.state triggers this deluge api dependency) which cannot be imported from windows install unfortunately, in contrary to linux(as freezed on windows). Doesn't trigger needing recheck files afterwards, atleast in quick tests here. It stops silent if worked without error. If your path on linux has restricted access, obviously need run with sudo in that case. If path exist locally, just use tab-completion in args. Need deluge closed.

Code: Select all

deluge_path_change -h                        

deluge_path_change v0.1:

Usage: <program> [OPTION]...

 -k             keep rest of path intact.
 -l             When -k, change all windows to linux path sep.
 -w             When -k, change all linux to windows path sep.
 -a             No search, replace all.
 -h             Help/usage.
 -d             Use deluge user account path, omitting need for -f.
 -s <PATTERN>   Search pattern.
 -r <PATTERN>   Replace pattern.
 -f <FILE>      Path to torrents.state file.
                If -f or -d  not given, running user's path used on linux, 
                and default deluge profile path on windows.

Without -k or -a, default is to replace only when search matches path completely.

Backup is made in same folder, with .old extension, though continually overwritten when repeated.
deluge_path_change.py (linux)
deluge_path_change.exe (windows) (virustotal-report)
Post Reply