Skip to content

Instantly share code, notes, and snippets.

@LevitatingBusinessMan
Created February 16, 2025 17:04
Show Gist options
  • Save LevitatingBusinessMan/78b4f4a1cdd5dd98f25da47adb739401 to your computer and use it in GitHub Desktop.
Save LevitatingBusinessMan/78b4f4a1cdd5dd98f25da47adb739401 to your computer and use it in GitHub Desktop.
Copy torrents form transmission to deluge
#!/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
@LevitatingBusinessMan
Copy link
Author

sudo -u deluge ruby transmission2deluge.rb

will likely crash if a duplicate torrent is created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment