diff --git a/gui/slick/interfaces/default/config_providers.tmpl b/gui/slick/interfaces/default/config_providers.tmpl index 3a7d65df..d4508ce5 100644 --- a/gui/slick/interfaces/default/config_providers.tmpl +++ b/gui/slick/interfaces/default/config_providers.tmpl @@ -292,28 +292,28 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#; #if $hasattr($curTorrentProvider, 'proxy'):
- +
- #end if - #if $hasattr($curTorrentProvider, 'proxy_url'): + #if $hasattr($curTorrentProvider.proxy, 'url'):
#end if + #end if #if $hasattr($curTorrentProvider, 'confirmed'):
diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index 9a8e2932..8c0adde4 100644 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -425,10 +425,10 @@ def initialize(consoleLogging=True): 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_PLEX, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, PLEX_UPDATE_LIBRARY, \ - PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, \ + PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, BACKLOG_STARTUP, \ showUpdateScheduler, __INITIALIZED__, LAUNCH_BROWSER, UPDATE_SHOWS_ON_START, SORT_ARTICLE, showList, loadingShowList, \ - NEWZNAB_DATA, NZBS, NZBS_UID, NZBS_HASH,\ - QUALITY_DEFAULT, FLATTEN_FOLDERS_DEFAULT, SUBTITLES_DEFAULT, STATUS_DEFAULT, \ + NEWZNAB_DATA, NZBS, NZBS_UID, NZBS_HASH, INDEXER_DEFAULT, USENET_RETENTION, TORRENT_DIR, RSSUPDATE_FREQUENCY, \ + QUALITY_DEFAULT, FLATTEN_FOLDERS_DEFAULT, SUBTITLES_DEFAULT, STATUS_DEFAULT, RSSUPDATE_STARTUP, \ GROWL_NOTIFY_ONSNATCH, GROWL_NOTIFY_ONDOWNLOAD, GROWL_NOTIFY_ONSUBTITLEDOWNLOAD, TWITTER_NOTIFY_ONSNATCH, TWITTER_NOTIFY_ONDOWNLOAD, TWITTER_NOTIFY_ONSUBTITLEDOWNLOAD, \ USE_GROWL, GROWL_HOST, GROWL_PASSWORD, USE_PROWL, PROWL_NOTIFY_ONSNATCH, PROWL_NOTIFY_ONDOWNLOAD, PROWL_NOTIFY_ONSUBTITLEDOWNLOAD, PROWL_API, PROWL_PRIORITY, PROG_DIR, \ USE_PYTIVO, PYTIVO_NOTIFY_ONSNATCH, PYTIVO_NOTIFY_ONDOWNLOAD, PYTIVO_NOTIFY_ONSUBTITLEDOWNLOAD, PYTIVO_UPDATE_LIBRARY, PYTIVO_HOST, PYTIVO_SHARE_NAME, PYTIVO_TIVO_NAME, \ @@ -1011,12 +1011,11 @@ def initialize(consoleLogging=True): curTorrentProvider.getID() + '_passkey', '') if hasattr(curTorrentProvider, 'proxy'): - curTorrentProvider.proxy = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(), - curTorrentProvider.getID() + '_proxy', 0)) - - if hasattr(curTorrentProvider, 'proxy_url'): - curTorrentProvider.proxy_url = check_setting_str(CFG, curTorrentProvider.getID().upper(), - curTorrentProvider.getID() + '_proxy_url', '') + curTorrentProvider.proxy.enabled = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(), + curTorrentProvider.getID() + '_proxy', 0)) + if hasattr(curTorrentProvider.proxy, 'url'): + curTorrentProvider.proxy.url = check_setting_str(CFG, curTorrentProvider.getID().upper(), + curTorrentProvider.getID() + '_proxy_url', '') if hasattr(curTorrentProvider, 'confirmed'): curTorrentProvider.confirmed = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(), @@ -1420,9 +1419,9 @@ def save_config(): if hasattr(curTorrentProvider, 'options'): new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_options'] = curTorrentProvider.options if hasattr(curTorrentProvider, 'proxy'): - new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_proxy'] = curTorrentProvider.proxy - if hasattr(curTorrentProvider, 'proxy_url'): - new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_proxy_url'] = curTorrentProvider.proxy_url + new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_proxy'] = curTorrentProvider.proxy.enabled + if hasattr(curTorrentProvider.proxy, 'url'): + new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_proxy_url'] = curTorrentProvider.proxy.url if hasattr(curTorrentProvider, 'freeleech'): new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_freeleech'] = int(curTorrentProvider.freeleech) if hasattr(curTorrentProvider, 'search_mode'): diff --git a/sickbeard/providers/thepiratebay.py b/sickbeard/providers/thepiratebay.py index a04cbd01..b551fe63 100644 --- a/sickbeard/providers/thepiratebay.py +++ b/sickbeard/providers/thepiratebay.py @@ -43,18 +43,6 @@ from lib import requests from lib.requests import exceptions from lib.unidecode import unidecode -proxy_dict = { - 'Getprivate.eu (NL)': 'http://getprivate.eu/', - '15bb51.info (US)': 'http://15bb51.info/', - 'Hideme.nl (NL)': 'http://hideme.nl/', - 'Proxite.eu (DE)': 'http://proxite.eu/', - 'Webproxy.cz (CZ)': 'http://webproxy.cz/', - '2me2u (CZ)': 'http://2me2u.me/', - 'Interproxy.net (EU)': 'http://interproxy.net/', - 'Unblockersurf.info (DK)': 'http://unblockersurf.info', - 'Hiload.org (NL)': 'http://hiload.org', -} - class ThePirateBayProvider(generic.TorrentProvider): def __init__(self): @@ -449,16 +437,28 @@ class ThePirateBayWebproxy: self.Type = 'GlypeProxy' self.param = 'browse.php?u=' self.option = '&b=32' - self.proxy = False - self.proxy_url = None + self.enabled = False + self.url = None + + self.urls = { + 'Getprivate.eu (NL)': 'http://getprivate.eu/', + '15bb51.info (US)': 'http://15bb51.info/', + 'Hideme.nl (NL)': 'http://hideme.nl/', + 'Proxite.eu (DE)': 'http://proxite.eu/', + 'Webproxy.cz (CZ)': 'http://webproxy.cz/', + '2me2u (CZ)': 'http://2me2u.me/', + 'Interproxy.net (EU)': 'http://interproxy.net/', + 'Unblockersurf.info (DK)': 'http://unblockersurf.info', + 'Hiload.org (NL)': 'http://hiload.org', + } def isEnabled(self): """ Return True if we Choose to call TPB via Proxy """ - return self.proxy + return self.enabled def getProxyURL(self): """ Return the Proxy URL Choosen via Provider Setting """ - return str(self.proxy_url) + return str(self.url) def _buildURL(self, url): """ Return the Proxyfied URL of the page """ diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 8f89e770..57f6ca70 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -1614,15 +1614,15 @@ class ConfigProviders: if hasattr(curTorrentProvider, 'proxy'): try: - curTorrentProvider.proxy = config.checkbox_to_value(kwargs[curTorrentProvider.getID() + '_proxy']) + curTorrentProvider.proxy.enabled = config.checkbox_to_value(kwargs[curTorrentProvider.getID() + '_proxy']) except: - curTorrentProvider.proxy = 0 + curTorrentProvider.proxy.enabled = 0 - if hasattr(curTorrentProvider, 'proxy_url'): - try: - curTorrentProvider.proxy_url = kwargs[curTorrentProvider.getID() + '_proxy_url'].strip() - except: - curTorrentProvider.proxy_url = None + if hasattr(curTorrentProvider.proxy, 'url'): + try: + curTorrentProvider.proxy.url = kwargs[curTorrentProvider.getID() + '_proxy_url'].strip() + except: + curTorrentProvider.proxy.url = None if hasattr(curTorrentProvider, 'freeleech'): try: