@@ -7,4 +7,6 @@ rtorrent:
rpc_port: 80 # Default port for your HTTP server
rpc_path: "/RPC2" # Location directive in your HTTP instance to connect to rTorrent
-
+t411:
+# t411_username: "login" # T411.me username
+# t411_password: "password" # T411.me password
@@ -13,7 +13,10 @@ require "sinatra"
require "xmlrpc/client"
require "sys/filesystem"
require "yaml"
+require "rest_client"
+require "nokogiri"
+require "open-uri"
+
require "rSeed/server"
require "rSeed/config"
require "rSeed/session"
@@ -72,7 +72,14 @@ module RSeed
end
def add(file)
+ begin
+ @client.call("load_start",file)
+ rescue XMLRPC::FaultException => e
+ puts "Error:"
+ puts e.faultCode
+ puts e.faultString
+ end
@@ -75,3 +75,6 @@ function bytesToSize(bytes, speed) {
}
};
+function poppupAddTorrent(){
+ window.open("/add", "Ajout d'un torrent", config='height=100, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no');
+}
@@ -0,0 +1,8 @@
+-# coding: utf-8
+.row
+ .col-md-4{:class => "col-md-offset-4"}
+ %form{:role => "form", :method => "post", :action => "add/t411"}
+ %h2.text-center Ajout Torrent
+ .form-group
+ %input{:type => "text", :name => "lien", :class => "form-control", :placeholder => "Lien", :style => "border-radius: 4px 4px 0 0;"}
+ %button{:type => "submit", :class => "btn btn-primary btn-lg btn-block", :style => "text-align='center'"} Go Go Go
@@ -30,7 +30,7 @@
%strong#down-info
%ul.left
%li
- %a.button.radius.alert{href: "#"} Add
+ %a.button.radius.alert{href: "#", onClick: "poppupAddTorrent()"} Add
%section.main-section{style: "margin: 50px 10px"}
%table{style: "width: 100%;"}
%thead