├── lang ├── zh-cn.js ├── es.js ├── cs.js ├── da.js ├── en.js ├── fi.js ├── it.js ├── lv.js ├── no.js ├── sk.js ├── sr.js ├── tr.js ├── pt.js ├── ru.js ├── zh-tw.js ├── pl.js ├── ko.js ├── nl.js ├── hu.js ├── de.js ├── el.js ├── fr.js ├── sv.js ├── vi.js └── uk.js ├── plugin.info ├── conf.php ├── init.js ├── action.php └── readme.md /lang/zh-cn.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Chinese Simplified language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "获取 webseed.torrent"; 10 | theUILang.cantFindTorrent = "这个下载的 torrent 源文件未找到."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); 13 | -------------------------------------------------------------------------------- /lang/es.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Spanish language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Obtener webseed.torrent"; 10 | theUILang.cantFindTorrent = "Archivo torrent original no encontrado."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/cs.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Czech language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/da.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Danish language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/en.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * English language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/fi.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Finnish language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/it.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Italian language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/lv.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Latvian language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/no.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Norwegian language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/sk.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Slovak language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/sr.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Serbian language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/tr.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Turkish language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/pt.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Portuguese language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/ru.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Russian language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Получить webseed.torrent"; 10 | theUILang.cantFindTorrent = "Исходный webseed.torrent файл недоступен для данной закачки."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/zh-tw.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Chinese Traditional language file. 5 | * 6 | * Author: 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Get webseed.torrent"; 10 | theUILang.cantFindTorrent = "Source torrent file for this download not found."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/pl.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Polish language file. 5 | * 6 | * Author: Dare (piczok@gmail.com) 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Pobierz plik webseed.torrent"; 10 | theUILang.cantFindTorrent = "Plik webseed.torrent nie znaleziony."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/ko.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Korean language file. 5 | * 6 | * Author: Limerainne (limerainne@gmail.com) 7 | */ 8 | 9 | theUILang.getWebSeedSource = "webseed.torrent 얻기"; 10 | theUILang.cantFindTorrent = "이 다운로드 항목에 해당하는 원본 토렌트 파일을 찾지 못했습니다."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); 13 | -------------------------------------------------------------------------------- /plugin.info: -------------------------------------------------------------------------------- 1 | plugin.description: This plugin creates a webseed-only torrent for the user to download. That torrent can be opened on a local torrent client to get files from the ruTorrent server directly. 2 | plugin.author: zvodd 3 | plugin.version: 1.0 4 | rtorrent.remote: error 5 | plugin.help: https://github.com/Novik/ruTorrent/wiki/Plugins -------------------------------------------------------------------------------- /lang/nl.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Dutch language file. 5 | * 6 | * Author: rascalli (rascallim@gmail.com) 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Download webseed.torrent"; 10 | theUILang.cantFindTorrent = "Torrent file voor deze download niet gevonden."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/hu.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Hungarian language file. 5 | * 6 | * Author: Olivér (titititatatatititi@gmail.com) 7 | */ 8 | 9 | theUILang.getWebSeedSource = "webseed.torrent letöltése"; 10 | theUILang.cantFindTorrent = "A letöltés torrent fájlja nem található."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/de.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * German language file. 5 | * 6 | * Author: Dario Rugani (kontakt@rugani.de) 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Hole webseed.torrent"; 10 | theUILang.cantFindTorrent = "Quell Torrent-Datei für diesen Download nicht gefunden."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/el.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Greek language file. 5 | * 6 | * Author: Chris Kanatas (ckanatas@gmail.com) 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Λήψη αρχείου webseed.torrent"; 10 | theUILang.cantFindTorrent = "Το πηγαίο αρχείο torrent για αυτή τη λήψη δεν βρέθηκε."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/fr.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * French language file. 5 | * 6 | * Author: Nicobubulle (nicobubulle@gmail.com) 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Télécharger le webseed.torrent"; 10 | theUILang.cantFindTorrent = "Le fichier source du torrent n'a pas été trouvé."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/sv.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Swedish language file. 5 | * 6 | * Author: Magnus Holm (holmen@brasse.se) 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Hämta webseed torrentfil"; 10 | theUILang.cantFindTorrent = "Torrentfilen för denna nedladdning kunde inte hittas."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); 13 | -------------------------------------------------------------------------------- /lang/vi.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Vietnamese language file. 5 | * 6 | * Author: Ta Xuan Truong (truongtx8 AT gmail DOT com) 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Lấy tập tin webseed.torrent"; 10 | theUILang.cantFindTorrent = "Không tìm thấy tập tin torrent gốc đang tải."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /lang/uk.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PLUGIN SOURCE 3 | * 4 | * Ukrainian language file. 5 | * 6 | * Author: Oleksandr Natalenko (oleksandr@natalenko.name) 7 | */ 8 | 9 | theUILang.getWebSeedSource = "Отримати файл webseed.torrent"; 10 | theUILang.cantFindTorrent = "Вихідний файл webseed.torrent недоступний для цього завантаження."; 11 | 12 | thePlugins.get("webseedsource").langLoaded(); -------------------------------------------------------------------------------- /conf.php: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /init.js: -------------------------------------------------------------------------------- 1 | plugin.loadLang(); 2 | 3 | if(plugin.canChangeMenu()) 4 | { 5 | theWebUI.getWebSeedSource = function( id ) 6 | { 7 | $("#webseedsrchash").val(id); 8 | $("#getWebSeedSource").submit(); 9 | } 10 | 11 | plugin.createMenu = theWebUI.createMenu; 12 | theWebUI.createMenu = function( e, id ) 13 | { 14 | plugin.createMenu.call(this, e, id); 15 | if(plugin.enabled) 16 | { 17 | var el = theContextMenu.get( theUILang.Properties ); 18 | if( el ) 19 | theContextMenu.add( el, [theUILang.getWebSeedSource, (this.getTable("trt").selCount > 1) || (id.length>40) ? null : "theWebUI.getWebSeedSource('" + id + "')"] ); 20 | } 21 | } 22 | } 23 | 24 | plugin.onLangLoaded = function() 25 | { 26 | $(document.body).append($("").css({visibility: "hidden"}).attr( { name: "webseedsrcfrm", id: "webseedsrcfrm" } ).width(0).height(0).load(function() 27 | { 28 | $("#webseedsrchash").val(''); 29 | var d = (this.contentDocument || this.contentWindow.document); 30 | if(d && (d.location.href != "about:blank")) 31 | try { eval(d.body.textContent ? d.body.textContent : d.body.innerText); } catch(e) {} 32 | })); 33 | $(document.body).append( 34 | $('
').width(0).height(0)); 37 | } 38 | 39 | plugin.onRemove = function() 40 | { 41 | $('#webseedsrcfrm').remove(); 42 | $('#getWebSeedSource').remove(); 43 | } -------------------------------------------------------------------------------- /action.php: -------------------------------------------------------------------------------- 1 | $value){ 16 | $this->{$key} = $value; 17 | } 18 | $url = $webseedurl; 19 | if ($dlpath != "") { 20 | $url = $url . "/" . $dlpath . "/"; 21 | } 22 | $this->{"url-list"} = [$url]; 23 | $this->{"announce-list"} = []; 24 | $this->{"announce"} = null; 25 | $this->{"private"} = 1; 26 | return; 27 | } 28 | 29 | } 30 | function serve_file($webseedurl, $webseedbase){ 31 | if(isset($_REQUEST['result'])) 32 | cachedEcho('noty(theUILang.cantFindTorrent,"error");',"text/html"); 33 | if(isset($_REQUEST['hash'])) 34 | { 35 | $torrent = rTorrent::getSource($_REQUEST['hash']); 36 | if($torrent){ 37 | $req = new rXMLRPCRequest(); 38 | $req->addCommand(new rXMLRPCCommand( "d.get_directory", $_REQUEST['hash'])); 39 | $req->run(); 40 | $basepath = $req->val[0]; 41 | $req = new rXMLRPCRequest(); 42 | $req->addCommand(new rXMLRPCCommand( "d.get_base_filename", $_REQUEST['hash'])); 43 | $req->run(); 44 | $filename = $req->val[0]; 45 | $basepath = str_replace($webseedbase, "", $basepath); 46 | $basepath = trim(str_replace($filename, "", $basepath), "/"); 47 | $newtorrent = new WeebSeedTorrent($torrent, $basepath, $webseedurl); 48 | toLog("Generating torrent with url_list:" . implode(",", $newtorrent->{"url-list"})); 49 | 50 | if (is_null($filename)){ 51 | $filename = '(webseed) '.$newtorrent->getName($_REQUEST['hash']).'.torrent'; 52 | }else{ 53 | $filename = '(webseed) '.$filename.'.torrent'; 54 | } 55 | if(isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'],'MSIE')){ 56 | $filename = rawurlencode($filename); 57 | } 58 | 59 | if ($newtorrent) 60 | $newtorrent->send($filename); 61 | } 62 | } 63 | } 64 | serve_file($webseedurl, $webseedbase); 65 | header("HTTP/1.0 302 Moved Temporarily"); 66 | header("Location: ".$_SERVER['PHP_SELF'].'?result=0'); 67 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | * __ruTorrent Plugin to create a webseed only torrent.__ 2 | 3 | * __Adds a right-click menu item to ruTorrent for downloading a webseed torrent.__ 4 | 5 | ### Webseed Torrents 6 | 7 | Useful for downloading a private torrent from a seedbox completely intact with out affecting download/seed ratios. 8 | The main reason for doing this is to facilitate downlading a completey intact folder stucture of the torrent and being able to use a local torrent client to do the last mile file transfer to you local machine, rather than using FTP or rSync. 9 | 10 | A webseed-only torrent is stripped of all tracker information and includes only a http(s) "webseed". 11 | The local torrent client makes use of the web seed torrent by downloading files of the torrent, directly via http from your seedbox. 12 | 13 | ##### Caveats 14 | 15 | You should be VERY careful about who you share your webseed.torrent files with. 16 | THEY SHOULD NEVER BE SHARED PUBLICLY - as they contain a direct link to your private seedbox, (AND depending on your configuration, may contain Authetication Credentials - HTTP Auth username and password.) 17 | 18 | Webseed torrents can experience poor speeds in libtorrent based clients. 19 | Clients known to get good speeds are Deluge 2, [Aria2](https://aria2.github.io/), [uGet](http://ugetdm.com) with Aira2 backend, and also Free Download Manager for Windows. 20 | 21 | **Configuration requires ruTorrent's downloads folder to be served over http.** e.g. accessable by URL like `http://seedbox.example.com/downloads` 22 | However, the URL path does not need to be indexable (list folder contents). See [zvodd/webseeder](https://github.com/zvodd/webseeder) project for a stand alone http(s) server that can fulfill this requirement (necessitates custom ports.) 23 | 24 | ### Install 25 | 26 | Copy this repo into your `/srv/rutorrent/plugins` folder named `webseedsource`. 27 | From `/srv/rutorrent/plugins` directory run: 28 | ``` 29 | git clone https://github.com/zvodd/rutorrent-webseed-download-plugin.git webseedsource 30 | ``` 31 | You should now have a `/srv/rutorrent/plugins/webseedsource` directory. 32 | 33 | #### Configuration 34 | 35 | Edit the variables in `conf.php`. 36 | 37 | ##### WebSeed URL 38 | 39 | This is put inside the torrent file itself and is how your local torrent file finds actually accesses the payload data. 40 | 41 | Set the `$weebseedurl` variable to point to the base URL of your web server's download location. e.g. 42 | 43 | ``` 44 | $webseedurl = "https://example.com/downloads"; 45 | ``` 46 | 47 | Replace `example.com`with your server's domain name or IP address. 48 | Also replace `/downloads` with the correct website path to your downloads. 49 | Prefix with `http://` or `https://` appropriate to your server config. 50 | 51 | The URL must be a "live" http/https location with the `path` component mapped to ruTorrent's download folder. i.e. served with Apache or nginx. 52 | 53 | ##### HTTP Auth (Optional) 54 | 55 | This is required if the web address to your downloads is behind HTTP Auth. If not; DO NOT include the `username:password` part in the line. 56 | 57 | **Note**: Only non-Auth or Auth Basic HTTP URIs work (for torrent clients tested), Auth Basic URIs follow this format: 58 | 59 | ``` 60 | $webseedurl = "https://username:password@example.com/downloads"; 61 | ``` 62 | 63 | ##### Set local path of torrent folder. 64 | 65 | Finally modify `$webseedbase` to point to the OS folder path of your served rtorrent downloads folder. 66 | For example if seedbox's url for serving `https://example.com/downloads` gets files from `/home/user/rtorrent_downloads` then the line should be: 67 | 68 | ``` 69 | $webseedbase = "/home/user/rtorrent_downloads"; 70 | ``` 71 | 72 | 73 | ### Apache Config for HTTP Auth Digest configs. 74 | 75 | **Tested with QuickBox.io seedboxes** 76 | 77 | If you have ruTorrent `fileshare` plugin, you can create a symlink to your rutorrent downloads folder in the fileshare plugin's folder: 78 | ``` 79 | ln -s /home/user/rtorrent_downloads /srv/rutorrent/home/fileshare/webseed 80 | ``` 81 | 82 | Assuming it has an appropraite apache2 config entry that allows `FollowSymLinks` e.g. a file in `/etc/apache2/site-enabled/*.conf` similiar to this: 83 | 84 | ``` 85 |