1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Fixed a couple of bugs related to deluge

This commit is contained in:
tlex 2014-05-11 10:31:38 +03:00
parent 8b77dddaaf
commit d0105a2f6a
5 changed files with 21 additions and 8 deletions

View File

@ -362,6 +362,14 @@
</label> </label>
</div> </div>
<div class="field-pair" id="Torrent_Verify_Cert">
<input type="checkbox" name="torrent_verify_cert" class="enabler" id="torrent_verify_cert" #if $sickbeard.TORRENT_VERIFY_CERT == True then "checked=\"checked\"" else ""# />
<label class="nocheck clearfix" for="torrent_verify_cert">
<span class="component-title" id="torrent_verify_cert_desc">Verify Certificate</span>
<span class="component-desc">Disable if you get "Deluge: Authentication Error" in your log</span>
</label>
</div>
<div class="field-pair" id="Torrent_username"> <div class="field-pair" id="Torrent_username">
<label class="nocheck clearfix"> <label class="nocheck clearfix">
<span class="component-title" id="username_desc">Torrent Username</span> <span class="component-title" id="username_desc">Torrent Username</span>

View File

@ -71,6 +71,7 @@ $(document).ready(function(){
} else if (selectedProvider == "deluge"){ } else if (selectedProvider == "deluge"){
$('#t_blackhole_settings').hide(); $('#t_blackhole_settings').hide();
$('#torrent_settings').show(); $('#torrent_settings').show();
$('#Torrent_Verify_Cert').show();
$('#Torrent_Label').show(); $('#Torrent_Label').show();
$('#Torrent_username').show(); $('#Torrent_username').show();
$('#Torrent_Path').show(); $('#Torrent_Path').show();

View File

@ -304,6 +304,7 @@ TORRENT_SEED_TIME = ''
TORRENT_PAUSED = False TORRENT_PAUSED = False
TORRENT_HIGH_BANDWIDTH = False TORRENT_HIGH_BANDWIDTH = False
TORRENT_LABEL = '' TORRENT_LABEL = ''
TORRENT_VERIFY_CERT = True
USE_XBMC = False USE_XBMC = False
XBMC_ALWAYS_ON = True XBMC_ALWAYS_ON = True
@ -489,7 +490,7 @@ def initialize(consoleLogging=True):
HANDLE_REVERSE_PROXY, USE_NZBS, USE_TORRENTS, NZB_METHOD, NZB_DIR, DOWNLOAD_PROPERS, PREFER_EPISODE_RELEASES, ALLOW_HIGH_PRIORITY, TORRENT_METHOD, \ HANDLE_REVERSE_PROXY, USE_NZBS, USE_TORRENTS, NZB_METHOD, NZB_DIR, DOWNLOAD_PROPERS, PREFER_EPISODE_RELEASES, ALLOW_HIGH_PRIORITY, TORRENT_METHOD, \
SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, SAB_HOST, \ SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, SAB_HOST, \
NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_HOST, NZBGET_USE_HTTPS, currentSearchScheduler, backlogSearchScheduler, \ NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_HOST, NZBGET_USE_HTTPS, currentSearchScheduler, backlogSearchScheduler, \
TORRENT_USERNAME, TORRENT_PASSWORD, TORRENT_HOST, TORRENT_PATH, TORRENT_RATIO, TORRENT_SEED_TIME, TORRENT_PAUSED, TORRENT_HIGH_BANDWIDTH, TORRENT_LABEL, \ TORRENT_USERNAME, TORRENT_PASSWORD, TORRENT_HOST, TORRENT_PATH, TORRENT_RATIO, TORRENT_SEED_TIME, TORRENT_PAUSED, TORRENT_HIGH_BANDWIDTH, TORRENT_LABEL, TORRENT_VERIFY_CERT, \
USE_XBMC, XBMC_ALWAYS_ON, XBMC_NOTIFY_ONSNATCH, XBMC_NOTIFY_ONDOWNLOAD, XBMC_NOTIFY_ONSUBTITLEDOWNLOAD, XBMC_UPDATE_FULL, XBMC_UPDATE_ONLYFIRST, \ USE_XBMC, XBMC_ALWAYS_ON, XBMC_NOTIFY_ONSNATCH, XBMC_NOTIFY_ONDOWNLOAD, XBMC_NOTIFY_ONSUBTITLEDOWNLOAD, XBMC_UPDATE_FULL, XBMC_UPDATE_ONLYFIRST, \
XBMC_UPDATE_LIBRARY, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, \ XBMC_UPDATE_LIBRARY, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, \
USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, TRAKT_REMOVE_WATCHLIST, TRAKT_USE_WATCHLIST, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktWatchListCheckerSchedular, \ USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, TRAKT_REMOVE_WATCHLIST, TRAKT_USE_WATCHLIST, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktWatchListCheckerSchedular, \
@ -809,6 +810,7 @@ def initialize(consoleLogging=True):
TORRENT_PAUSED = bool(check_setting_int(CFG, 'TORRENT', 'torrent_paused', 0)) TORRENT_PAUSED = bool(check_setting_int(CFG, 'TORRENT', 'torrent_paused', 0))
TORRENT_HIGH_BANDWIDTH = bool(check_setting_int(CFG, 'TORRENT', 'torrent_high_bandwidth', 0)) TORRENT_HIGH_BANDWIDTH = bool(check_setting_int(CFG, 'TORRENT', 'torrent_high_bandwidth', 0))
TORRENT_LABEL = check_setting_str(CFG, 'TORRENT', 'torrent_label', '') TORRENT_LABEL = check_setting_str(CFG, 'TORRENT', 'torrent_label', '')
TORRENT_VERIFY_CERT = bool(check_setting_int(CFG, 'TORRENT', 'torrent_verify_cert', 0))
USE_XBMC = bool(check_setting_int(CFG, 'XBMC', 'use_xbmc', 0)) USE_XBMC = bool(check_setting_int(CFG, 'XBMC', 'use_xbmc', 0))
XBMC_ALWAYS_ON = bool(check_setting_int(CFG, 'XBMC', 'xbmc_always_on', 1)) XBMC_ALWAYS_ON = bool(check_setting_int(CFG, 'XBMC', 'xbmc_always_on', 1))
@ -1568,6 +1570,7 @@ def save_config():
new_config['TORRENT']['torrent_paused'] = int(TORRENT_PAUSED) new_config['TORRENT']['torrent_paused'] = int(TORRENT_PAUSED)
new_config['TORRENT']['torrent_high_bandwidth'] = int(TORRENT_HIGH_BANDWIDTH) new_config['TORRENT']['torrent_high_bandwidth'] = int(TORRENT_HIGH_BANDWIDTH)
new_config['TORRENT']['torrent_label'] = TORRENT_LABEL new_config['TORRENT']['torrent_label'] = TORRENT_LABEL
new_config['TORRENT']['torrent_verify_cert'] = TORRENT_VERIFY_CERT
new_config['XBMC'] = {} new_config['XBMC'] = {}
new_config['XBMC']['use_xbmc'] = int(USE_XBMC) new_config['XBMC']['use_xbmc'] = int(USE_XBMC)

View File

@ -38,7 +38,7 @@ class DelugeAPI(GenericClient):
"id": 1 "id": 1
}) })
try: try:
self.response = self.session.post(self.url, data=post_data.encode('utf-8')) self.response = self.session.post(self.url, data=post_data.encode('utf-8'), verify=sickbeard.TORRENT_VERIFY_CERT)
except: except:
return None return None
@ -49,7 +49,7 @@ class DelugeAPI(GenericClient):
"id": 10 "id": 10
}) })
try: try:
self.response = self.session.post(self.url, data=post_data.encode('utf-8')) self.response = self.session.post(self.url, data=post_data.encode('utf-8'), verify=sickbeard.TORRENT_VERIFY_CERT)
except: except:
return None return None
@ -61,7 +61,7 @@ class DelugeAPI(GenericClient):
"id": 11 "id": 11
}) })
try: try:
self.response = self.session.post(self.url, data=post_data.encode('utf-8')) self.response = self.session.post(self.url, data=post_data.encode('utf-8'), verify=sickbeard.TORRENT_VERIFY_CERT)
except: except:
return None return None
hosts = self.response.json()['result'] hosts = self.response.json()['result']
@ -74,7 +74,7 @@ class DelugeAPI(GenericClient):
"id": 11 "id": 11
}) })
try: try:
self.response = self.session.post(self.url, data=post_data.encode('utf-8')) self.response = self.session.post(self.url, data=post_data.encode('utf-8'), verify=sickbeard.TORRENT_VERIFY_CERT)
except: except:
return None return None
@ -83,7 +83,7 @@ class DelugeAPI(GenericClient):
"id": 10 "id": 10
}) })
try: try:
self.response = self.session.post(self.url, data=post_data.encode('utf-8')) self.response = self.session.post(self.url, data=post_data.encode('utf-8'), verify=sickbeard.TORRENT_VERIFY_CERT)
except: except:
return None return None
@ -123,7 +123,7 @@ class DelugeAPI(GenericClient):
def _set_torrent_label(self, result): def _set_torrent_label(self, result):
label = sickbeard.TORRENT_LABEL.lower() label = sickbeard.TORRENT_LABEL
if ' ' in label: if ' ' in label:
logger.log(self.name + u': Invalid label. Label must not contain a space', logger.ERROR) logger.log(self.name + u': Invalid label. Label must not contain a space', logger.ERROR)
return False return False

View File

@ -1070,7 +1070,7 @@ class ConfigSearch:
nzb_method=None, torrent_method=None, usenet_retention=None, search_frequency=None, nzb_method=None, torrent_method=None, usenet_retention=None, search_frequency=None,
download_propers=None, prefer_episode_releases=None, allow_high_priority=None, backlog_startup=None, download_propers=None, prefer_episode_releases=None, allow_high_priority=None, backlog_startup=None,
torrent_dir=None, torrent_username=None, torrent_password=None, torrent_host=None, torrent_dir=None, torrent_username=None, torrent_password=None, torrent_host=None,
torrent_label=None, torrent_path=None, torrent_label=None, torrent_path=None, torrent_verify_cert=None,
torrent_ratio=None, torrent_seed_time=None, torrent_paused=None, torrent_high_bandwidth=None, ignore_words=None): torrent_ratio=None, torrent_seed_time=None, torrent_paused=None, torrent_high_bandwidth=None, ignore_words=None):
results = [] results = []
@ -1121,6 +1121,7 @@ class ConfigSearch:
sickbeard.TORRENT_USERNAME = torrent_username sickbeard.TORRENT_USERNAME = torrent_username
sickbeard.TORRENT_PASSWORD = torrent_password sickbeard.TORRENT_PASSWORD = torrent_password
sickbeard.TORRENT_LABEL = torrent_label sickbeard.TORRENT_LABEL = torrent_label
sickbeard.TORRENT_VERIFY_CERT = config.checkbox_to_value(torrent_verify_cert)
sickbeard.TORRENT_PATH = torrent_path sickbeard.TORRENT_PATH = torrent_path
sickbeard.TORRENT_RATIO = torrent_ratio sickbeard.TORRENT_RATIO = torrent_ratio
sickbeard.TORRENT_SEED_TIME = torrent_seed_time sickbeard.TORRENT_SEED_TIME = torrent_seed_time