Added rutorrent options to GUI, restructured the watchdir options (local/remote)

This commit is contained in:
evilhero 2016-05-11 09:59:32 -04:00
parent 162094b980
commit aa48391aae
5 changed files with 223 additions and 88 deletions

View File

@ -261,7 +261,7 @@
<td>
<fieldset>
<legend>Usenet</legend>
<input type="radio" name="nzb_downloader" id="nzb_downloader_sabnzbd" value="0" ${config['nzb_downloader_sabnzbd']}>Sabnzbd <input type="radio" name="nzb_downloader" id="nzb_downloader_nzbget" value="1" ${config['nzb_downloader_nzbget']}> NZBget <input type="radio" name="nzb_downloader" id="nzb_downloader_blackhole" value="2" ${config['nzb_downloader_blackhole']}>Black Hole
<input type="radio" name="nzb_downloader" id="nzb_downloader_sabnzbd" value="0" ${config['nzb_downloader_sabnzbd']}> Sabnzbd&nbsp;&nbsp;<input type="radio" name="nzb_downloader" id="nzb_downloader_nzbget" value="1" ${config['nzb_downloader_nzbget']}> NZBget&nbsp;&nbsp;<input type="radio" name="nzb_downloader" id="nzb_downloader_blackhole" value="2" ${config['nzb_downloader_blackhole']}> Black Hole
</fieldset>
<fieldset id="sabnzbd_options">
<div class="row">
@ -390,22 +390,53 @@
<input id="enable_torrents" type="checkbox" onclick="initConfigCheckbox($(this));" name="enable_torrents" value=1 ${config['enable_torrents']} /><label>Use Torrents</label>
</div>
<div class="config">
<input type="radio" name="torrent_downloader" id="torrent_downloader_watchlist" value="0" ${config['torrent_downloader_watchlist']}>Local Watchdir
<input type="radio" name="torrent_downloader" id="torrent_downloader_utorrent" value="1" ${config['torrent_downloader_utorrent']}> uTorrent
<!-- <input type="radio" name="torrent_downloader" id="torrent_downloader_rtorrent" value="2" ${config['torrent_downloader_rtorrent']}>rTorrent -->
<input type="radio" name="torrent_downloader" id="torrent_downloader_seedbox" value="3" ${config['torrent_downloader_seedbox']}>Seedbox
<div class="row">
<label>Minimum # of seeders</label>
<input type="text" name="minseeds" value="${config['minseeds']}" size="10">
</div>
<div class="row">
<label>Minimum # of seeders</label>
<input type="text" name="minseeds" value="${config['minseeds']}" size="10">
</div>
<input type="radio" name="torrent_downloader" id="torrent_downloader_watchlist" value="0" ${config['torrent_downloader_watchlist']}> Watchdir&nbsp;&nbsp;
<input type="radio" name="torrent_downloader" id="torrent_downloader_utorrent" value="1" ${config['torrent_downloader_utorrent']}> uTorrent&nbsp;&nbsp;
<input type="radio" name="torrent_downloader" id="torrent_downloader_rtorrent" value="2" ${config['torrent_downloader_rtorrent']}> rTorrent&nbsp;&nbsp;
<!--<input type="radio" name="torrent_downloader" id="torrent_downloader_transmission" value="3" ${config['torrent_downloader_transmission']}> Transmission-->
</div>
</fieldset>
<fieldset id="watchlist_options">
<div Class="row">
<div class="row checkbox left clearfix">
<input id="local_watchdir" type="checkbox" name="torrent_local" value="1" ${config['torrent_local']} /><label>Local Watch dir</label>
</div>
<div id="watchdir_local_options">
<div class="row">
<label>Watch Directory</label>
<input type="text" name="local_watchdir" value="${config['local_watchdir']}" size="30"><br/>
<small>Local Folder your torrent client watches</small>
</div>
</div>
</div>
<div class="row checkbox left clearfix">
<input id="remote_watchdir" type="checkbox" name="torrent_seedbox" value="1" ${config['torrent_seedbox']} /><label>Remote Watch dir</label>
</div>
<div id="watchdir_remote_options">
<div class="row">
<label>Seedbox Host</label>
<input type="text" name="seedbox_host" value="${config['seedbox_host']}" size="30">
</div>
<div class="row">
<label>Seedbox Port (SFTP)</label>
<input type="text" name="seedbox_port" value="${config['seedbox_port']}" size="30">
</div>
<div class="row">
<label>Seedbox Username</label>
<input type="text" name="seedbox_user" value="${config['seedbox_user']}" size="30">
</div>
<div class="row">
<label>Seedbox Password</label>
<input type="password" name="seedbox_pass" value="${config['seedbox_pass']}" size="30">
</div>
<div class="row">
<label>Watch Directory</label>
<input type="text" name="seedbox_watchdir" value="${config['seedbox_watchdir']}" size="30"><br/>
<small>Folder path your torrent seedbox client watches</small>
</div>
</fieldset>
<fieldset id="utorrent_options">
<div class="row">
@ -426,31 +457,51 @@
<small>Label for your uTorrent downloads</small>
</div>
</fieldset>
<fieldset id="seedbox_options">
<fieldset id="rtorrent_options">
<small class="heading"><span style="float: left; margin-right: .3em; margin-top: 4px;" class="ui-icon ui-icon-info"></span>Will *ONLY* work if rtorrent has RPC Support</small>
<div class="row">
<label>rTorrent Host:Port/RPC</label>
<input type="text" name="rtorrent_host" value="${config['rtorrent_host']}" size="30">
<small>ie. https://my.rtorrent:80/myuser/RPC1</small>
</div>
<div class="row">
<label>rTorrent Username</label>
<input type="text" name="rtorrent_username" value="${config['rtorrent_username']}" size="30">
</div>
<div class="row">
<label>rTorrent Password</label>
<input type="password" name="rtorrent_password" value="${config['rtorrent_password']}" size="30">
</div>
<div class="row">
<label>Watch Directory</label>
<input type="text" name="rtorrent_directory" value="${config['rtorrent_directory']}" size="30"><br/>
<small>Folder path where torrent download will be assigned</small>
</div>
<div class="row">
<label>Label</label>
<input type="text" name="rtorrent_label" value="${config['rtorrent_label']}" size="30"><br/>
<small>Label to assign for torrents</small>
</div>
<div class="row checkbox left clearfix">
<input id="rtorrent_startonload" type="checkbox" name="rtorrent_startonload" value="1" ${config['rtorrent_startonload']} /><label>Start Torrent on Successful Load</label>
<small>Automatically start torrent on successful loading within rtorrent client</small>
</div>
</fieldset>
<!-- <fieldset id="transmission_options">
<div class="row">
<label>Seedbox Host</label>
<input type="text" name="seedbox_host" value="${config['seedbox_host']}" size="30">
<label>Transmission Host</label>
<input type="text" name="transmission_host" value="${config['transmission_host']}" size="30">
</div>
<div class="row">
<label>Seedbox Port (SFTP)</label>
<input type="text" name="seedbox_port" value="${config['seedbox_port']}" size="30">
<label>Transmission Username</label>
<input type="text" name="transmission_username" value="${config['transmission_username']}" size="30">
</div>
<div class="row">
<label>Seedbox Username</label>
<input type="text" name="seedbox_user" value="${config['seedbox_user']}" size="30">
</div>
<div class="row">
<label>Seedbox Password</label>
<input type="password" name="seedbox_pass" value="${config['seedbox_pass']}" size="30">
</div>
<div class="row">
<label>Watch Directory</label>
<input type="text" name="seedbox_watchdir" value="${config['seedbox_watchdir']}" size="30"><br/>
<small>Folder path your torrent seedbox client watches</small>
<label>Transmission Password</label>
<input type="password" name="transmission_password" value="${config['transmission_password']}" size="30">
</div>
</fieldset>
</div>
</fieldset>
-->
</td>
</tr>
@ -1288,6 +1339,46 @@
}
});
if ($("#local_watchdir").is(":checked"))
{
$("#watchdir_local_options").show();
}
else
{
$("#watchdir_local_options").hide();
}
$("#local_watchdir").click(function(){
if ($("#local_watchdir").is(":checked"))
{
$("#watchdir_local_options").slideDown();
}
else
{
$("#watchdir_local_options").slideUp();
}
});
if ($("#remote_watchdir").is(":checked"))
{
$("#watchdir_remote_options").show();
}
else
{
$("#watchdir_remote_options").hide();
}
$("#remote_watchdir").click(function(){
if ($("#remote_watchdir").is(":checked"))
{
$("#watchdir_remote_options").slideDown();
}
else
{
$("#watchdir_remote_options").slideUp();
}
});
if ($("#nzb_downloader_sabnzbd").is(":checked"))
{
$("#nzbget_options,#blackhole_options").hide();
@ -1306,23 +1397,23 @@
if ($("#torrent_downloader_watchlist").is(":checked"))
{
$("#utorrent_options,#rtorrent_options,#seedbox_options").hide();
$("#utorrent_options,#rtorrent_options,#transmission_options").hide();
$("#watchlist_options").show();
}
if ($("#torrent_downloader_utorrent").is(":checked"))
{
$("#watchlist_options,#rtorrent_options,#seedbox_options").hide();
$("#watchlist_options,#rtorrent_options,#transmission_options").hide();
$("#utorrent_options").show();
}
if ($("#torrent_downloader_rtorrent").is(":checked"))
{
$("#utorrent_options,#watchlist_options,#seedbox_options").hide();
$("#utorrent_options,#watchlist_options,#transmission_options").hide();
$("#rtorrent_options").show();
}
if ($("#torrent_downloader_seedbox").is(":checked"))
if ($("#torrent_downloader_transmission").is(":checked"))
{
$("#utorrent_options,#rtorrent_options,#watchlist_options").hide();
$("#seedbox_options").show();
$("#transmission_options").show();
}
@ -1341,19 +1432,19 @@
}
if ($("#torrent_downloader_watchlist").is(":checked"))
{
$("#utorrent_options,#rtorrent_options,#seedbox_options").fadeOut("fast", function() { $("#watchlist_options").fadeIn() });
$("#utorrent_options,#rtorrent_options,#transmission_options").fadeOut("fast", function() { $("#watchlist_options").fadeIn() });
}
if ($("#torrent_downloader_utorrent").is(":checked"))
{
$("#watchlist_options,#rtorrent_options,#seedbox_options").fadeOut("fast", function() { $("#utorrent_options").fadeIn() });
$("#watchlist_options,#rtorrent_options,#transmission_options").fadeOut("fast", function() { $("#utorrent_options").fadeIn() });
}
if ($("#torrent_downloader_rtorrent").is(":checked"))
{
$("#utorrent_options,#watchlist_options,#seedbox_options").fadeOut("fast", function() { $("#rtorrent_options").fadeIn() });
$("#utorrent_options,#watchlist_options,#transmission_options").fadeOut("fast", function() { $("#rtorrent_options").fadeIn() });
}
if ($("#torrent_downloader_seedbox").is(":checked"))
if ($("#torrent_downloader_transmission").is(":checked"))
{
$("#utorrent_options,#rtorrent_options,#watchlist_options").fadeOut("fast", function() { $("#seedbox_options").fadeIn() });
$("#utorrent_options,#rtorrent_options,#watchlist_options").fadeOut("fast", function() { $("#transmission_options").fadeIn() });
}
});

View File

@ -349,8 +349,10 @@ FAILED_DOWNLOAD_HANDLING = 0
FAILED_AUTO = 0
ENABLE_TORRENTS = 0
TORRENT_DOWNLOADER = None #0 = watchfolder, #1 = uTorrent, #2 = rTorrent, #3 = seedbox
TORRENT_DOWNLOADER = None #0 = watchfolder, #1 = uTorrent, #2 = rTorrent, #3 = transmission
MINSEEDS = 0
USE_WATCHDIR = False
TORRENT_LOCAL = False
LOCAL_WATCHDIR = None
TORRENT_SEEDBOX = False
@ -391,6 +393,11 @@ UTORRENT_USERNAME = None
UTORRENT_PASSWORD = None
UTORRENT_LABEL = None
USE_TRANSMISSION = False
TRANSMISSION_HOST = None
TRANSMISSION_USERNAME = None
TRANSMISSION_PASSWORD = None
def CheckSection(sec):
""" Check if INI section exists, if not create it """
try:
@ -449,10 +456,11 @@ def initialize():
USE_NZBGET, NZBGET_HOST, NZBGET_PORT, NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_PRIORITY, NZBGET_DIRECTORY, NZBSU, NZBSU_UID, NZBSU_APIKEY, NZBSU_VERIFY, DOGNZB, DOGNZB_APIKEY, DOGNZB_VERIFY, \
NEWZNAB, NEWZNAB_NAME, NEWZNAB_HOST, NEWZNAB_APIKEY, NEWZNAB_VERIFY, NEWZNAB_UID, NEWZNAB_ENABLED, EXTRA_NEWZNABS, NEWZNAB_EXTRA, \
ENABLE_TORZNAB, TORZNAB_NAME, TORZNAB_HOST, TORZNAB_APIKEY, TORZNAB_CATEGORY, TORZNAB_VERIFY, \
EXPERIMENTAL, ALTEXPERIMENTAL, USE_RTORRENT, RTORRENT_HOST, RTORRENT_USERNAME, RTORRENT_PASSWORD, RTORRENT_STARTONLOAD, RTORRENT_LABEL, RTORRENT_DIRECTORY, USE_UTORRENT, UTORRENT_HOST, UTORRENT_USERNAME, UTORRENT_PASSWORD, UTORRENT_LABEL, \
EXPERIMENTAL, ALTEXPERIMENTAL, USE_RTORRENT, RTORRENT_HOST, RTORRENT_USERNAME, RTORRENT_PASSWORD, RTORRENT_STARTONLOAD, RTORRENT_LABEL, RTORRENT_DIRECTORY, \
USE_UTORRENT, UTORRENT_HOST, UTORRENT_USERNAME, UTORRENT_PASSWORD, UTORRENT_LABEL, USE_TRANSMISSION, TRANSMISSION_HOST, TRANSMISSION_USERNAME, TRANSMISSION_PASSWORD, \
ENABLE_META, CMTAGGER_PATH, CBR2CBZ_ONLY, CT_TAG_CR, CT_TAG_CBL, CT_CBZ_OVERWRITE, UNRAR_CMD, CT_SETTINGSPATH, UPDATE_ENDED, INDIE_PUB, BIGGIE_PUB, IGNORE_HAVETOTAL, SNATCHED_HAVETOTAL, PROVIDER_ORDER, \
dbUpdateScheduler, searchScheduler, RSSScheduler, WeeklyScheduler, VersionScheduler, FolderMonitorScheduler, \
ENABLE_TORRENTS, TORRENT_DOWNLOADER, MINSEEDS, TORRENT_LOCAL, LOCAL_WATCHDIR, TORRENT_SEEDBOX, SEEDBOX_HOST, SEEDBOX_PORT, SEEDBOX_USER, SEEDBOX_PASS, SEEDBOX_WATCHDIR, \
ENABLE_TORRENTS, TORRENT_DOWNLOADER, MINSEEDS, USE_WATCHDIR, TORRENT_LOCAL, LOCAL_WATCHDIR, TORRENT_SEEDBOX, SEEDBOX_HOST, SEEDBOX_PORT, SEEDBOX_USER, SEEDBOX_PASS, SEEDBOX_WATCHDIR, \
ENABLE_RSS, RSS_CHECKINTERVAL, RSS_LASTRUN, FAILED_DOWNLOAD_HANDLING, FAILED_AUTO, ENABLE_TORRENT_SEARCH, ENABLE_KAT, KAT_PROXY, KAT_VERIFY, ENABLE_32P, MODE_32P, KEYS_32P, RSSFEED_32P, USERNAME_32P, PASSWORD_32P, AUTHKEY_32P, PASSKEY_32P, FEEDINFO_32P, VERIFY_32P, SNATCHEDTORRENT_NOTIFY, \
PROWL_ENABLED, PROWL_PRIORITY, PROWL_KEYS, PROWL_ONSNATCH, NMA_ENABLED, NMA_APIKEY, NMA_PRIORITY, NMA_ONSNATCH, PUSHOVER_ENABLED, PUSHOVER_PRIORITY, PUSHOVER_APIKEY, PUSHOVER_USERKEY, PUSHOVER_ONSNATCH, BOXCAR_ENABLED, BOXCAR_ONSNATCH, BOXCAR_TOKEN, \
PUSHBULLET_ENABLED, PUSHBULLET_APIKEY, PUSHBULLET_DEVICEID, PUSHBULLET_ONSNATCH, LOCMOVE, NEWCOM_DIR, FFTONEWCOM_DIR, \
@ -473,6 +481,7 @@ def initialize():
CheckSection('Torznab')
CheckSection('Torrents')
CheckSection('uTorrent')
CheckSection('Transmission')
# Set global variables based on config file or use defaults
try:
HTTP_PORT = check_setting_int(CFG, 'General', 'http_port', 8090)
@ -668,9 +677,9 @@ def initialize():
FAILED_AUTO = bool(check_setting_int(CFG, 'General', 'failed_auto', 0))
ENABLE_TORRENTS = bool(check_setting_int(CFG, 'Torrents', 'enable_torrents', 0))
MINSEEDS = check_setting_str(CFG, 'Torrents', 'minseeds', '0')
# TORRENT_LOCAL = bool(check_setting_int(CFG, 'Torrents', 'torrent_local', 0)) -- Depriciated
TORRENT_LOCAL = bool(check_setting_int(CFG, 'Torrents', 'torrent_local', 0))
LOCAL_WATCHDIR = check_setting_str(CFG, 'Torrents', 'local_watchdir', '')
# TORRENT_SEEDBOX = bool(check_setting_int(CFG, 'Torrents', 'torrent_seedbox', 0)) -- Depriciated
TORRENT_SEEDBOX = bool(check_setting_int(CFG, 'Torrents', 'torrent_seedbox', 0))
SEEDBOX_HOST = check_setting_str(CFG, 'Torrents', 'seedbox_host', '')
SEEDBOX_PORT = check_setting_str(CFG, 'Torrents', 'seedbox_port', '')
SEEDBOX_USER = check_setting_str(CFG, 'Torrents', 'seedbox_user', '')
@ -759,18 +768,23 @@ def initialize():
PR_NUM = 0 # provider counter here (used for provider orders)
PR = []
TORRENT_DOWNLOADER = check_setting_int(CFG, 'General', 'torrent_downloader', 0)
if TORRENT_DOWNLOADER == 0: TORRENT_LOCAL = True
if TORRENT_DOWNLOADER == 0: USE_WATCHDIR = True
elif TORRENT_DOWNLOADER == 1: USE_UTORRENT = True
elif TORRENT_DOWNLOADER == 2: USE_RTORRENT = True
elif TORRENT_DOWNLOADER == 3: TORRENT_SEEDBOX = True
elif TORRENT_DOWNLOADER == 3: USE_TRANSMISSION = True
else:
TORRENT_DOWNLOADER = 0
USE_WATCHDIR = True
TORRENT_LOCAL = True
#USE_UTORRENT = bool(check_setting_int(CFG, 'uTorrent', 'use_utorrent', 0))
UTORRENT_HOST = check_setting_str(CFG, 'uTorrent', 'utorrent_host', '')
UTORRENT_USERNAME = check_setting_str(CFG, 'uTorrent', 'utorrent_username', '')
UTORRENT_PASSWORD = check_setting_str(CFG, 'uTorrent', 'utorrent_password', '')
UTORRENT_LABEL = check_setting_str(CFG, 'uTorrent', 'utorrent_label', '')
TRANSMISSION_HOST = check_setting_str(CFG, 'Transmission', 'transmission_host', '')
TRANSMISSION_USERNAME = check_setting_str(CFG, 'Transmission', 'transmission_username', '')
TRANSMISSION_PASSWORD = check_setting_str(CFG, 'Transmission', 'transmission_password', '')
#add torrents to provider counter.
if ENABLE_TORRENT_SEARCH:
@ -985,7 +999,7 @@ def initialize():
CONFIG_VERSION = '2'
if 'http://' not in SAB_HOST[:7] and 'https://' not in SAB_HOST[:8]:
if all(['http://' not in SAB_HOST[:7], 'https://' not in SAB_HOST[:8], SAB_HOST != '', SAB_HOST is not None]):
SAB_HOST = 'http://' + SAB_HOST
if not LOG_DIR:
@ -1408,9 +1422,9 @@ def config_write():
new_config['Torrents'] = {}
new_config['Torrents']['enable_torrents'] = int(ENABLE_TORRENTS)
new_config['Torrents']['minseeds'] = int(MINSEEDS)
# new_config['Torrents']['torrent_local'] = int(TORRENT_LOCAL) - Depriciated
new_config['Torrents']['torrent_local'] = int(TORRENT_LOCAL)
new_config['Torrents']['local_watchdir'] = LOCAL_WATCHDIR
# new_config['Torrents']['torrent_seedbox'] = int(TORRENT_SEEDBOX) - Depriciated
new_config['Torrents']['torrent_seedbox'] = int(TORRENT_SEEDBOX)
new_config['Torrents']['seedbox_host'] = SEEDBOX_HOST
new_config['Torrents']['seedbox_port'] = SEEDBOX_PORT
new_config['Torrents']['seedbox_user'] = SEEDBOX_USER
@ -1484,12 +1498,16 @@ def config_write():
new_config['Newznab']['newznab'] = int(NEWZNAB)
new_config['uTorrent'] = {}
#new_config['uTorrent']['use_utorrent'] = int(USE_UTORRENT)
new_config['uTorrent']['utorrent_host'] = UTORRENT_HOST
new_config['uTorrent']['utorrent_username'] = UTORRENT_USERNAME
new_config['uTorrent']['utorrent_password'] = UTORRENT_PASSWORD
new_config['uTorrent']['utorrent_label'] = UTORRENT_LABEL
new_config['Transmission'] = {}
new_config['Transmission']['transmission_host'] = TRANSMISSION_HOST
new_config['Transmission']['transmission_username'] = TRANSMISSION_USERNAME
new_config['Transmission']['transmission_password'] = TRANSMISSION_PASSWORD
# Need to unpack the extra newznabs for saving in config.ini
flattened_newznabs = []
for newznab in EXTRA_NEWZNABS:

View File

@ -726,20 +726,20 @@ def torsend2client(seriesname, issue, seriesyear, linkit, site):
if linkit[-7:] != "torrent": # and site != "KAT":
filename += ".torrent"
if mylar.USE_UTORRENT:
filepath = os.path.join(mylar.CACHE_DIR,filename)
logger.fdebug('filename for torrent set to : ' + filepath)
elif mylar.TORRENT_LOCAL and mylar.LOCAL_WATCHDIR is not None:
filepath = os.path.join(mylar.LOCAL_WATCHDIR, filename)
logger.fdebug('filename for torrent set to : ' + filepath)
elif mylar.TORRENT_SEEDBOX and mylar.SEEDBOX_WATCHDIR is not None:
if any([mylar.USE_UTORRENT, mylar.USE_RTORRENT]):
filepath = os.path.join(mylar.CACHE_DIR, filename)
logger.fdebug('filename for torrent set to : ' + filepath)
else:
logger.error('No Local Watch Directory or Seedbox Watch Directory specified. Set it and try again.')
return "fail"
elif mylar.USE_WATCHDIR:
if mylar.TORRENT_LOCAL and mylar.LOCAL_WATCHDIR is not None:
filepath = os.path.join(mylar.LOCAL_WATCHDIR, filename)
logger.fdebug('filename for torrent set to : ' + filepath)
elif mylar.TORRENT_SEEDBOX and mylar.SEEDBOX_WATCHDIR is not None:
filepath = os.path.join(mylar.CACHE_DIR, filename)
logger.fdebug('filename for torrent set to : ' + filepath)
else:
logger.error('No Local Watch Directory or Seedbox Watch Directory specified. Set it and try again.')
return "fail"
if site == '32P':
url = 'https://32pag.es/torrents.php'
@ -904,24 +904,24 @@ def torsend2client(seriesname, issue, seriesyear, linkit, site):
utorrent.labelTorrent(hash)
return "pass"
elif mylar.TORRENT_LOCAL:
return "pass"
elif mylar.TORRENT_SEEDBOX:
if mylar.RTORRENT_HOST:
import test
rp = test.RTorrent()
torrent_info = rp.main(filepath=filepath)
logger.info(torrent_info)
if torrent_info:
return "pass"
else:
return "fail"
elif mylar.USE_WATCHDIR:
if mylar.TORRENT_LOCAL:
return "pass"
else:
tssh = ftpsshup.putfile(filepath, filename)
return tssh
elif mylar.USE_RTORRENT:
import test
rp = test.RTorrent()
torrent_info = rp.main(filepath=filepath)
logger.info(torrent_info)
if torrent_info:
return "pass"
else:
return "fail"
if __name__ == '__main__':
#torrents(sys.argv[1])
#torrentdbsearch(sys.argv[1], sys.argv[2], sys.argv[3])

View File

@ -2015,7 +2015,6 @@ def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, direc
#torrents (32P & KAT)
elif nzbprov == '32P' or nzbprov == 'KAT' or nzbprov == 'Torznab':
logger.fdebug("sending .torrent to watchdir.")
logger.fdebug("ComicName:" + ComicName)
logger.fdebug("link:" + link)
logger.fdebug("Torrent Provider:" + nzbprov)
@ -2040,10 +2039,17 @@ def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, direc
else:
logger.error('Unable to send torrent - check logs and settings (this would be marked as a BAD torrent if Failed Handling was enabled)')
return "torrent-fail"
if mylar.TORRENT_LOCAL:
sent_to = "your local Watch folder"
else:
sent_to = "your seedbox Watch folder"
if mylar.USE_WATCHDIR:
if TORRENT_LOCAL:
sent_to = "your local Watch folder"
else:
sent_to = "your seedbox Watch folder"
elif mylar.USE_UTORRENT:
sent_to = "your uTorrent client"
elif mylar.USE_RTORRENT:
sent_to = "your rTorrent client"
elif mylar.USE_TRANSMISSION:
sent_to = "your Transmission client"
#end torrents
else:

View File

@ -3588,11 +3588,20 @@ class WebInterface(object):
"torrent_downloader_watchlist": helpers.radio(mylar.TORRENT_DOWNLOADER, 0),
"torrent_downloader_utorrent": helpers.radio(mylar.TORRENT_DOWNLOADER, 1),
"torrent_downloader_rtorrent": helpers.radio(mylar.TORRENT_DOWNLOADER, 2),
"torrent_downloader_seedbox": helpers.radio(mylar.TORRENT_DOWNLOADER, 3),
"torrent_downloader_transmission": helpers.radio(mylar.TORRENT_DOWNLOADER, 3),
"utorrent_host": mylar.UTORRENT_HOST,
"utorrent_username": mylar.UTORRENT_USERNAME,
"utorrent_password": mylar.UTORRENT_PASSWORD,
"utorrent_label": mylar.UTORRENT_LABEL,
"rtorrent_host": mylar.RTORRENT_HOST,
"rtorrent_username": mylar.RTORRENT_USERNAME,
"rtorrent_password": mylar.RTORRENT_PASSWORD,
"rtorrent_directory": mylar.RTORRENT_DIRECTORY,
"rtorrent_label": mylar.RTORRENT_LABEL,
"rtorrent_startonload": helpers.checked(mylar.RTORRENT_STARTONLOAD),
"transmission_host": mylar.TRANSMISSION_HOST,
"transmission_username": mylar.TRANSMISSION_USERNAME,
"transmission_password": mylar.TRANSMISSION_PASSWORD,
"blackhole_dir": mylar.BLACKHOLE_DIR,
"usenet_retention": mylar.USENET_RETENTION,
"use_nzbsu": helpers.checked(mylar.NZBSU),
@ -3621,7 +3630,9 @@ class WebInterface(object):
"provider_order": mylar.PROVIDER_ORDER,
"enable_torrents": helpers.checked(mylar.ENABLE_TORRENTS),
"minseeds": mylar.MINSEEDS,
"torrent_local": helpers.checked(mylar.TORRENT_LOCAL),
"local_watchdir": mylar.LOCAL_WATCHDIR,
"torrent_seedbox": helpers.checked(mylar.TORRENT_SEEDBOX),
"seedbox_watchdir": mylar.SEEDBOX_WATCHDIR,
"seedbox_host": mylar.SEEDBOX_HOST,
"seedbox_port": mylar.SEEDBOX_PORT,
@ -3915,7 +3926,8 @@ class WebInterface(object):
enable_meta=0, cbr2cbz_only=0, cmtagger_path=None, ct_tag_cr=0, ct_tag_cbl=0, ct_cbz_overwrite=0, unrar_cmd=None, enable_rss=0, rss_checkinterval=None, failed_download_handling=0, failed_auto=0, enable_torrent_search=0, enable_kat=0, enable_32p=0, mode_32p=0, rssfeed_32p=None, passkey_32p=None, username_32p=None, password_32p=None, snatchedtorrent_notify=0,
enable_torrents=0, minseeds=0, local_watchdir=None, seedbox_watchdir=None, seedbox_user=None, seedbox_pass=None, seedbox_host=None, seedbox_port=None,
prowl_enabled=0, prowl_onsnatch=0, prowl_keys=None, prowl_priority=None, nma_enabled=0, nma_apikey=None, nma_priority=0, nma_onsnatch=0, pushover_enabled=0, pushover_onsnatch=0, pushover_apikey=None, pushover_userkey=None, pushover_priority=None, boxcar_enabled=0, boxcar_onsnatch=0, boxcar_token=None,
pushbullet_enabled=0, pushbullet_apikey=None, pushbullet_deviceid=None, pushbullet_onsnatch=0, torrent_downloader=0, utorrent_host=None, utorrent_username=None, utorrent_password=None, utorrent_label=None,
pushbullet_enabled=0, pushbullet_apikey=None, pushbullet_deviceid=None, pushbullet_onsnatch=0, torrent_downloader=0, torrent_local=0, torrent_seedbox=0, utorrent_host=None, utorrent_username=None, utorrent_password=None, utorrent_label=None,
rtorrent_host=None, rtorrent_username=None, rtorrent_password=None, rtorrent_directory=None, rtorrent_label=None, rtorrent_startonload=0, transmission_host=None, transmission_username=None, transmission_password=None,
preferred_quality=0, move_files=0, rename_files=0, add_to_csv=1, cvinfo=0, lowercase_filenames=0, folder_format=None, file_format=None, enable_extra_scripts=0, extra_scripts=None, enable_pre_scripts=0, pre_scripts=None, post_processing=0, file_opts=None, syno_fix=0, search_delay=None, chmod_dir=0777, chmod_file=0660, chowner=None, chgroup=None,
tsab=None, destination_dir=None, create_folders=1, replace_spaces=0, replace_char=None, use_minsize=0, minsize=None, use_maxsize=0, maxsize=None, autowant_all=0, autowant_upcoming=0, comic_cover_local=0, zero_level=0, zero_level_n=None, interface=None, dupeconstraint=None, ddump=0, duplicate_dump=None, **kwargs):
mylar.COMICVINE_API = comicvine_api
@ -3981,19 +3993,27 @@ class WebInterface(object):
mylar.ENABLE_TORRENTS = int(enable_torrents)
mylar.MINSEEDS = int(minseeds)
mylar.TORRENT_DOWNLOADER = int(torrent_downloader)
#mylar.TORRENT_LOCAL = int(torrent_local)
mylar.TORRENT_LOCAL = int(torrent_local)
mylar.LOCAL_WATCHDIR = local_watchdir
#mylar.TORRENT_SEEDBOX = int(torrent_seedbox)
mylar.TORRENT_SEEDBOX = int(torrent_seedbox)
mylar.SEEDBOX_WATCHDIR = seedbox_watchdir
mylar.SEEDBOX_HOST = seedbox_host
mylar.SEEDBOX_PORT = seedbox_port
mylar.SEEDBOX_USER = seedbox_user
mylar.SEEDBOX_PASS = seedbox_pass
#mylar.USE_UTORRENT = int(use_utorrent)
mylar.UTORRENT_HOST = utorrent_host
mylar.UTORRENT_USERNAME = utorrent_username
mylar.UTORRENT_PASSWORD = utorrent_password
mylar.UTORRENT_LABEL = utorrent_label
mylar.RTORRENT_HOST = rtorrent_host
mylar.RTORRENT_USERNAME = rtorrent_username
mylar.RTORRENT_PASSWORD = rtorrent_password
mylar.RTORRENT_DIRECTORY = rtorrent_directory
mylar.RTORRENT_LABEL = rtorrent_label
mylar.RTORRENT_STARTONLOAD = int(rtorrent_startonload)
mylar.TRANSMISSION_HOST = transmission_host
mylar.TRANSMISSION_USERNAME = transmission_username
mylar.TRANSMISSION_PASSWORD = transmission_password
mylar.ENABLE_TORRENT_SEARCH = int(enable_torrent_search)
mylar.ENABLE_KAT = int(enable_kat)
mylar.ENABLE_32P = int(enable_32p)
@ -4151,10 +4171,10 @@ class WebInterface(object):
elif mylar.NZB_DOWNLOADER == 1: mylar.USE_NZBGET = True
elif mylar.NZB_DOWNLOADER == 2: mylar.USE_BLACKHOLE = True
if mylar.TORRENT_DOWNLOADER == 0: mylar.TORRENT_LOCAL = True
if mylar.TORRENT_DOWNLOADER == 0: mylar.USE_WATCHDIR = True
elif mylar.TORRENT_DOWNLOADER == 1: mylar.USE_UTORRENT = True
elif mylar.TORRENT_DOWNLOADER == 2: mylar.USE_RTORRENT = True
elif mylar.TORRENT_DOWNLOADER == 3: mylar.USE_SEEDBOX = True
elif mylar.TORRENT_DOWNLOADER == 3: mylar.USE_TRANSMISSION = True
# Write the config
mylar.config_write()