Created
February 16, 2025 17:04
-
-
Save LevitatingBusinessMan/78b4f4a1cdd5dd98f25da47adb739401 to your computer and use it in GitHub Desktop.
Copy torrents form transmission to deluge
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'json' | |
torrent_ids = `transmission-remote -l`.lines.drop(1).map{_1.split(" ").first.sub("*","")}[..-2] | |
json = JSON.parse `transmission-remote -t #{torrent_ids.join(",")} --json --info` | |
torrents = json["arguments"]["torrents"] | |
puts "found #{torrents.length} torrents" | |
for torrent in torrents | |
puts "Adding #{torrent["id"]} '#{torrent["name"]}' to '#{torrent["downloadDir"]}'" | |
`deluge-console add '#{torrent["magnetLink"]}' --path '#{torrent["downloadDir"]}'` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo -u deluge ruby transmission2deluge.rb
will likely crash if a duplicate torrent is created