boramalper / magnetico

Autonomous (self-hosted) BitTorrent DHT search engine suite.
http://labs.boramalper.org/magnetico/
GNU Affero General Public License v3.0
3.06k stars 344 forks source link

Send torrent from magneticow to tranmission-daemon #168

Open tigre-bleu opened 6 years ago

tigre-bleu commented 6 years ago

Tranmission bittorent client has a web interface using transmission-daemon.

It would be a nice feature to be able to send a torrent directly from magneticow to transmission download list.

Several python wrappers exist shall make it quite easy to integrate.

boramalper commented 6 years ago

Wouldn't RSS feeds suffice?

seanbert-monkey commented 3 years ago

this hacky bit of perl does the thing you mention...

NB assumes all shows are '.' separated words and episode references e.g. Star.Wars

the script will fire off a download of everything in the XML from magneticow so strange things can happen f your how "name" is too generic!!

!/usr/bin/perl |

                                                                                                                                                                             |
use 5.010; use strict; use warnings;
use XML::LibXML;
my $show=$ARGV[0];
my $file="XML/".$show.".xml";
my $search=$show;
$search =~ s/./\%20/g;
my $cmd = "wget -q -O '".$file."' 'http://:8080/feed?query=".$search."'";
print $cmd,"\n";
system ( $cmd );
my $dom = XML::LibXML->load_xml(location => $file);
foreach my $magnet ($dom->findnodes('//enclosure/@url')) {
my $trans_cmd = "transmission-remote --add '".$magnet->to_literal()."' --download-dir '//".$show."' --auth transmission:transmission";
print $trans_cmd,"\n";
system ($trans_cmd);

}