Как это работает, направляя вывод аддона браузера в приведенный ниже скрипт php вместо того, чтобы наводнить себя. Затем скрипт сохраняет торрент или магнит в определенный каталог часов, указанный параметром в URL-адресе дополнения. Отсюда плагин "AutoAdd" для deluge будет настроен для мониторинга различных каталогов наблюдения, которые вы хотите, и загрузки торрентов из каждого с выбранной меткой, а также загрузки каталога (или других настроек, доступных этим дополнением), специфичных для этого каталога просмотра.
<?php //specify hostname in addon as server.com/thisScript.php?label=labelName //tested with these addons: //https://addons.mozilla.org/en-US/firefox/addon/bittorrent-webui-120685/ //https://chrome.google.com/webstore/detail/remote-torrent-adder/oabphaconndgibllomdcjbfdghcmenci?hl=en //in deluge mode, others may work. //specify server address as server.com/path/storeTorrent.php?label=labelname //label folder must first be created //use with AutoAdd plugin, to watch directories, and add with individual labels and locations //http://dev.deluge-torrent.org/wiki/Plugins/AutoAdd (configure with pc client) //edit $watchDir to your base watch dir yours $watchDir = '/media/sdf1/home/private/deluge/watch/'; $label = str_replace(array("json",":"),"",$_REQUEST['label']); //file_put_contents('debug.txt', json_encode($_REQUEST).'--'.file_get_contents('php://input'));//debug full //file_put_contents('debug.txt', $label;//debug just label param if($label && is_dir($watchDir.$label)){ $json = file_get_contents('php://input'); $array = json_decode($json,true); if($array['method'] == 'core.add_torrent_magnet'){ preg_match('#magnet:\?xt=urn:btih:(?<hash>.*?)&dn=(?<filename>.*?)&tr=(?<trackers>.*?)$#', $array['params'][0], $magnet_link); file_put_contents($watchDir.$label.$magnet_link['hash'].'.magnet', $array['params'][0]); }else if($array['method'] == 'core.add_torrent_file'){ file_put_contents( $watchDir.$label.md5($array['params'][1]).'.torrent', base64_decode($array['params'][1])); } } else header(':', true, 401); header('Content-Type: application/json'); echo '{"id": 0, "result": true, "error": null}'; ?>