diff --git a/sickbeard/providers/__init__.py b/sickbeard/providers/__init__.py
index f03d453d..18ead3be 100755
--- a/sickbeard/providers/__init__.py
+++ b/sickbeard/providers/__init__.py
@@ -39,10 +39,11 @@ __all__ = ['ezrss',
'totv',
]
+from os import sys
+
import sickbeard
import generic
from sickbeard import logger
-from os import sys
def sortedProviderList():
diff --git a/sickbeard/providers/animenzb.py b/sickbeard/providers/animenzb.py
index 37923547..897d3f90 100644
--- a/sickbeard/providers/animenzb.py
+++ b/sickbeard/providers/animenzb.py
@@ -19,29 +19,15 @@
import urllib
import datetime
-import sickbeard
import generic
+from sickbeard import classes, show_name_helpers, logger, tvcache
-from sickbeard import classes, show_name_helpers, helpers
-
-from sickbeard import exceptions, logger
-from sickbeard.common import *
-from sickbeard import tvcache
-from lib.dateutil.parser import parse as parseDate
class animenzb(generic.NZBProvider):
def __init__(self):
-
- generic.NZBProvider.__init__(self, 'animenzb')
-
- self.supportsBacklog = False
- self.anime_only = True
-
- self.enabled = False
-
+ generic.NZBProvider.__init__(self, 'animenzb', True, True)
self.cache = animenzbCache(self)
-
self.url = 'http://animenzb.com/'
def _get_season_search_strings(self, ep_obj):
diff --git a/sickbeard/providers/bitsoup.py b/sickbeard/providers/bitsoup.py
index 2f5ff05b..7bfa865f 100644
--- a/sickbeard/providers/bitsoup.py
+++ b/sickbeard/providers/bitsoup.py
@@ -19,18 +19,13 @@
import re
import traceback
import datetime
+
import sickbeard
import generic
import requests
import requests.exceptions
-
from sickbeard.common import Quality
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import db
-from sickbeard import classes
-from sickbeard import helpers
-from sickbeard import show_name_helpers
+from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
from sickbeard.exceptions import ex, AuthException
from sickbeard.helpers import sanitizeSceneName
from sickbeard.bs4_parser import BS4Parser
@@ -46,23 +41,15 @@ class BitSoupProvider(generic.TorrentProvider):
}
def __init__(self):
-
- generic.TorrentProvider.__init__(self, "BitSoup")
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'BitSoup', True, False)
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
-
self.cache = BitSoupCache(self)
-
self.url = self.urls['base_url']
-
- self.categories = "&c42=1&c45=1&c49=1&c7=1"
+ self.categories = '&c42=1&c45=1&c49=1&c7=1'
def getQuality(self, item, anime=False):
diff --git a/sickbeard/providers/btn.py b/sickbeard/providers/btn.py
index 6d563400..03a0e52d 100644
--- a/sickbeard/providers/btn.py
+++ b/sickbeard/providers/btn.py
@@ -20,32 +20,22 @@
import time
import socket
import math
-import sickbeard
-import generic
+from datetime import datetime
-from sickbeard import classes
-from sickbeard import scene_exceptions
-from sickbeard import logger
-from sickbeard import tvcache
+import generic
+from sickbeard import classes, scene_exceptions, logger, tvcache
from sickbeard.helpers import sanitizeSceneName
from sickbeard.exceptions import ex, AuthException
-
from lib import jsonrpclib
-from datetime import datetime
class BTNProvider(generic.TorrentProvider):
def __init__(self):
- generic.TorrentProvider.__init__(self, "BTN")
-
- self.supportsBacklog = True
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'BTN', True, False)
self.api_key = None
self.ratio = None
-
self.cache = BTNCache(self)
-
- self.url = "http://api.btnapps.net"
+ self.url = 'http://api.btnapps.net'
def _checkAuth(self):
if not self.api_key:
diff --git a/sickbeard/providers/ezrss.py b/sickbeard/providers/ezrss.py
index 70cc299b..3de4ed4b 100644
--- a/sickbeard/providers/ezrss.py
+++ b/sickbeard/providers/ezrss.py
@@ -24,27 +24,16 @@ try:
except ImportError:
import elementtree.ElementTree as etree
-import sickbeard
import generic
-
from sickbeard.common import Quality
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import helpers
+from sickbeard import logger, tvcache, helpers
class EZRSSProvider(generic.TorrentProvider):
def __init__(self):
-
- generic.TorrentProvider.__init__(self, "EZRSS")
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'EZRSS', True, False)
self.ratio = None
-
self.cache = EZRSSCache(self)
-
self.url = 'https://www.ezrss.it/'
def getQuality(self, item, anime=False):
diff --git a/sickbeard/providers/freshontv.py b/sickbeard/providers/freshontv.py
index 2ebae8fd..505b2ea9 100755
--- a/sickbeard/providers/freshontv.py
+++ b/sickbeard/providers/freshontv.py
@@ -19,15 +19,11 @@
import re
import traceback
import datetime
+
import sickbeard
import generic
from sickbeard.common import Quality
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import db
-from sickbeard import classes
-from sickbeard import helpers
-from sickbeard import show_name_helpers
+from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
from sickbeard.exceptions import ex, AuthException
from lib import requests
from lib.requests import exceptions
@@ -44,12 +40,7 @@ class FreshOnTVProvider(generic.TorrentProvider):
'download': 'https://freshon.tv/download.php?id=%s&type=torrent'}
def __init__(self):
-
- generic.TorrentProvider.__init__(self, 'FreshOnTV')
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'FreshOnTV', True, False)
self._uid = None
self._hash = None
self.username = None
@@ -58,9 +49,7 @@ class FreshOnTVProvider(generic.TorrentProvider):
self.minseed = None
self.minleech = None
self.freeleech = False
-
self.cache = FreshOnTVCache(self)
-
self.url = self.urls['base_url']
self.cookies = None
diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py
index abb82002..5a81c430 100644
--- a/sickbeard/providers/generic.py
+++ b/sickbeard/providers/generic.py
@@ -23,36 +23,33 @@ import datetime
import os
import re
import itertools
+from base64 import b16encode, b32decode
+
import sickbeard
import requests
-
-from sickbeard import helpers, classes, logger, db
+from sickbeard import helpers, classes, logger, db, tvcache
from sickbeard.common import MULTI_EP_RESULT, SEASON_RESULT, USER_AGENT
-from sickbeard import tvcache
from sickbeard import encodingKludge as ek
from sickbeard.exceptions import ex
from sickbeard.name_parser.parser import NameParser, InvalidNameException, InvalidShowException
from sickbeard.common import Quality
-from sickbeard import clients
-
from hachoir_parser import createParser
-from base64 import b16encode, b32decode
+
class GenericProvider:
NZB = "nzb"
TORRENT = "torrent"
- def __init__(self, name):
+ def __init__(self, name, supportsBacklog, anime_only):
# these need to be set in the subclass
self.providerType = None
self.name = name
+ self.supportsBacklog = supportsBacklog
+ self.anime_only = anime_only
self.url = ''
self.show = None
- self.supportsBacklog = False
- self.anime_only = False
-
self.search_mode = None
self.search_fallback = False
self.enabled = False
@@ -467,14 +464,12 @@ class GenericProvider:
class NZBProvider(GenericProvider):
- def __init__(self, name):
- GenericProvider.__init__(self, name)
-
+ def __init__(self, name, supportsBacklog, anime_only):
+ GenericProvider.__init__(self, name, supportsBacklog, anime_only)
self.providerType = GenericProvider.NZB
class TorrentProvider(GenericProvider):
- def __init__(self, name):
- GenericProvider.__init__(self, name)
-
+ def __init__(self, name, supportsBacklog, anime_only):
+ GenericProvider.__init__(self, name, supportsBacklog, anime_only)
self.providerType = GenericProvider.TORRENT
diff --git a/sickbeard/providers/hdbits.py b/sickbeard/providers/hdbits.py
index aa397d88..5d1182d7 100644
--- a/sickbeard/providers/hdbits.py
+++ b/sickbeard/providers/hdbits.py
@@ -13,23 +13,14 @@
# You should have received a copy of the GNU General Public License
# along with SickGear. If not, see .
-import re
-import time
import datetime
import urllib
-import urlparse
-import sys
-import generic
-import sickbeard
-from lib import requests
-from lib.requests import exceptions
-from sickbeard import classes
-from sickbeard import logger, tvcache, exceptions
-from sickbeard import helpers
-from sickbeard import clients
-from sickbeard.common import cpu_presets
-from sickbeard.exceptions import ex, AuthException
+import generic
+from sickbeard import classes, logger, tvcache
+from sickbeard.exceptions import AuthException
+
+
try:
import json
except ImportError:
@@ -38,18 +29,11 @@ except ImportError:
class HDBitsProvider(generic.TorrentProvider):
def __init__(self):
-
- generic.TorrentProvider.__init__(self, "HDBits")
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'HDBits', True, False)
self.username = None
self.passkey = None
self.ratio = None
-
self.cache = HDBitsCache(self)
-
self.url = 'https://hdbits.org'
self.search_url = 'https://hdbits.org/api/torrents'
self.rss_url = 'https://hdbits.org/api/torrents'
diff --git a/sickbeard/providers/hdtorrents.py b/sickbeard/providers/hdtorrents.py
index a18e86e3..eeb699f4 100644
--- a/sickbeard/providers/hdtorrents.py
+++ b/sickbeard/providers/hdtorrents.py
@@ -20,18 +20,12 @@
import re
import traceback
import datetime
-import urlparse
+
import sickbeard
import generic
-from sickbeard.common import Quality, cpu_presets
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import db
-from sickbeard import classes
-from sickbeard import helpers
-from sickbeard import show_name_helpers
+from sickbeard.common import Quality
+from sickbeard import logger,tvcache,db,classes,helpers,show_name_helpers
from sickbeard.exceptions import ex, AuthException
-from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from sickbeard.bs4_parser import BS4Parser
@@ -49,12 +43,7 @@ class HDTorrentsProvider(generic.TorrentProvider):
}
def __init__(self):
-
- generic.TorrentProvider.__init__(self, "HDTorrents")
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'HDTorrents', True, False)
self._uid = None
self._hash = None
self.username = None
@@ -62,13 +51,9 @@ class HDTorrentsProvider(generic.TorrentProvider):
self.ratio = None
self.minseed = None
self.minleech = None
-
self.cache = HDTorrentsCache(self)
-
self.url = self.urls['base_url']
-
self.categories = "&category[]=59&category[]=60&category[]=30&category[]=38"
-
self.cookies = None
def getQuality(self, item, anime=False):
diff --git a/sickbeard/providers/iptorrents.py b/sickbeard/providers/iptorrents.py
index fdceba10..c09b1135 100644
--- a/sickbeard/providers/iptorrents.py
+++ b/sickbeard/providers/iptorrents.py
@@ -19,18 +19,12 @@
import re
import traceback
import datetime
-import urlparse
+
import sickbeard
import generic
from sickbeard.common import Quality
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import db
-from sickbeard import classes
-from sickbeard import helpers
-from sickbeard import show_name_helpers
+from sickbeard import logger,tvcache,db,classes,helpers,show_name_helpers
from sickbeard.exceptions import ex, AuthException
-from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from sickbeard.bs4_parser import BS4Parser
@@ -46,21 +40,13 @@ class IPTorrentsProvider(generic.TorrentProvider):
}
def __init__(self):
-
- generic.TorrentProvider.__init__(self, "IPTorrents")
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'IPTorrents', True, False)
self.username = None
self.password = None
self.ratio = None
self.freeleech = False
-
self.cache = IPTorrentsCache(self)
-
self.url = self.urls['base_url']
-
self.categorie = 'l73=1&l78=1&l66=1&l65=1&l79=1&l5=1&l4=1'
def getQuality(self, item, anime=False):
diff --git a/sickbeard/providers/kat.py b/sickbeard/providers/kat.py
index 4a9d6c1a..2bf50127 100644
--- a/sickbeard/providers/kat.py
+++ b/sickbeard/providers/kat.py
@@ -19,7 +19,6 @@
from __future__ import with_statement
-import sys
import os
import traceback
import urllib
@@ -31,36 +30,20 @@ import sickbeard
import generic
from sickbeard.common import Quality
from sickbeard.name_parser.parser import NameParser, InvalidNameException, InvalidShowException
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import helpers
-from sickbeard import db
-from sickbeard import classes
+from sickbeard import logger,tvcache,helpers,db,classes
from sickbeard.show_name_helpers import allPossibleShowNames, sanitizeSceneName
-from sickbeard.exceptions import ex
-from sickbeard import encodingKludge as ek
-from sickbeard import clients
from sickbeard.bs4_parser import BS4Parser
-from lib import requests
-from lib.requests import exceptions
from lib.unidecode import unidecode
class KATProvider(generic.TorrentProvider):
def __init__(self):
-
- generic.TorrentProvider.__init__(self, "KickAssTorrents")
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'KickAssTorrents', True, False)
self.confirmed = False
self.ratio = None
self.minseed = None
self.minleech = None
-
self.cache = KATCache(self)
-
self.urls = ['https://kat.ph/', 'http://katproxy.com/', 'http://www.kickmirror.com/']
self.url = 'https://kat.ph/'
diff --git a/sickbeard/providers/newznab.py b/sickbeard/providers/newznab.py
index b93b2bc2..d50efba7 100755
--- a/sickbeard/providers/newznab.py
+++ b/sickbeard/providers/newznab.py
@@ -29,30 +29,17 @@ except ImportError:
import sickbeard
import generic
-from sickbeard import classes
-from sickbeard import helpers
-from sickbeard import scene_exceptions
+from sickbeard import classes,helpers,scene_exceptions,logger,tvcache
from sickbeard import encodingKludge as ek
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard.exceptions import ex, AuthException
-
-from lib import requests
-from lib.requests import exceptions
-from lib.bencode import bdecode
+from sickbeard.exceptions import AuthException
class NewznabProvider(generic.NZBProvider):
def __init__(self, name, url, key='', catIDs='5030,5040', search_mode='eponly', search_fallback=False,
enable_recentsearch=False, enable_backlog=False):
-
- generic.NZBProvider.__init__(self, name)
-
+ generic.NZBProvider.__init__(self, name, True, False)
self.cache = NewznabCache(self)
-
self.url = url
-
self.key = key
-
self.search_mode = search_mode
self.search_fallback = search_fallback
self.enable_recentsearch = enable_recentsearch
@@ -69,9 +56,6 @@ class NewznabProvider(generic.NZBProvider):
else:
self.catIDs = '5030,5040'
- self.enabled = True
- self.supportsBacklog = True
-
self.default = False
def configStr(self):
@@ -215,7 +199,7 @@ class NewznabProvider(generic.NZBProvider):
params['q'] = helpers.sanitizeSceneName(cur_exception)
paramsNoEp = params.copy()
- paramsNoEp['q'] = '%s.%02d' % (paramsNoEp['q'], paramsNoEp['ep'])
+ paramsNoEp['q'] = '%s.%02d' % (paramsNoEp['q'], int(paramsNoEp['ep']))
if "ep" in paramsNoEp:
paramsNoEp.pop("ep")
to_return.append(paramsNoEp)
diff --git a/sickbeard/providers/nextgen.py b/sickbeard/providers/nextgen.py
index 6596a470..1cdc125c 100644
--- a/sickbeard/providers/nextgen.py
+++ b/sickbeard/providers/nextgen.py
@@ -17,26 +17,15 @@
# along with SickGear. If not, see .
import traceback
-import urllib2
-import urllib
import time
import re
import datetime
-import urlparse
+
import sickbeard
import generic
-from sickbeard.common import Quality, cpu_presets
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import db
-from sickbeard import classes
-from sickbeard import helpers
-from sickbeard import show_name_helpers
-from sickbeard.common import Overview
-from sickbeard.exceptions import ex
-from sickbeard import clients
+from sickbeard.common import Quality
+from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
from lib import requests
-from lib.requests import exceptions
from sickbeard.bs4_parser import BS4Parser
from sickbeard.helpers import sanitizeSceneName
@@ -51,24 +40,14 @@ class NextGenProvider(generic.TorrentProvider):
}
def __init__(self):
-
- generic.TorrentProvider.__init__(self, "NextGen")
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'NextGen', True, False)
self.username = None
self.password = None
self.ratio = None
-
self.cache = NextGenCache(self)
-
self.url = self.urls['base_url']
-
self.categories = '&c7=1&c24=1&c17=1&c22=1&c42=1&c46=1&c26=1&c28=1&c43=1&c4=1&c31=1&c45=1&c33=1'
-
self.last_login_check = None
-
self.login_opener = None
def getQuality(self, item, anime=False):
diff --git a/sickbeard/providers/nyaatorrents.py b/sickbeard/providers/nyaatorrents.py
index 123b06c3..22e5621a 100644
--- a/sickbeard/providers/nyaatorrents.py
+++ b/sickbeard/providers/nyaatorrents.py
@@ -19,28 +19,16 @@
import urllib
import re
-import sickbeard
import generic
-
-from sickbeard import show_name_helpers
-from sickbeard import logger
+from sickbeard import logger, tvcache, show_name_helpers
from sickbeard.common import Quality
-from sickbeard import tvcache
-from sickbeard import show_name_helpers
class NyaaProvider(generic.TorrentProvider):
def __init__(self):
-
- generic.TorrentProvider.__init__(self, "NyaaTorrents")
-
- self.supportsBacklog = True
- self.anime_only = True
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'NyaaTorrents', True, True)
self.ratio = None
-
self.cache = NyaaCache(self)
-
self.url = 'http://www.nyaa.se/'
def getQuality(self, item, anime=False):
diff --git a/sickbeard/providers/omgwtfnzbs.py b/sickbeard/providers/omgwtfnzbs.py
index 2d4d0dd3..86d77c9d 100644
--- a/sickbeard/providers/omgwtfnzbs.py
+++ b/sickbeard/providers/omgwtfnzbs.py
@@ -17,16 +17,13 @@
# along with SickGear. If not, see .
import urllib
+from datetime import datetime
+
import generic
import sickbeard
+from sickbeard import tvcache, classes, logger, show_name_helpers
+from sickbeard.exceptions import AuthException
-from sickbeard import tvcache
-from sickbeard import helpers
-from sickbeard import classes
-from sickbeard import logger
-from sickbeard.exceptions import ex, AuthException
-from sickbeard import show_name_helpers
-from datetime import datetime
try:
import xml.etree.cElementTree as etree
@@ -41,13 +38,11 @@ except ImportError:
class OmgwtfnzbsProvider(generic.NZBProvider):
def __init__(self):
- generic.NZBProvider.__init__(self, "omgwtfnzbs")
- self.enabled = False
+ generic.NZBProvider.__init__(self, 'omgwtfnzbs', True, False)
self.username = None
self.api_key = None
self.cache = OmgwtfnzbsCache(self)
self.url = 'https://omgwtfnzbs.org/'
- self.supportsBacklog = True
def _checkAuth(self):
diff --git a/sickbeard/providers/rsstorrent.py b/sickbeard/providers/rsstorrent.py
index 08f83449..73afb1ff 100644
--- a/sickbeard/providers/rsstorrent.py
+++ b/sickbeard/providers/rsstorrent.py
@@ -18,34 +18,24 @@
import os
import re
-import urlparse
import sickbeard
import generic
-
-from sickbeard import helpers
+from sickbeard import helpers, logger, tvcache
from sickbeard import encodingKludge as ek
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import clients
from sickbeard.exceptions import ex
-
from lib import requests
-from lib.requests import exceptions
from lib.bencode import bdecode
class TorrentRssProvider(generic.TorrentProvider):
def __init__(self, name, url, cookies='', search_mode='eponly', search_fallback=False, enable_recentsearch=False,
enable_backlog=False):
- generic.TorrentProvider.__init__(self, name)
+ generic.TorrentProvider.__init__(self, name, False, False)
self.cache = TorrentRssCache(self)
self.url = re.sub('\/$', '', url)
self.url = url
- self.enabled = True
self.ratio = None
- self.supportsBacklog = False
-
self.search_mode = search_mode
self.search_fallback = search_fallback
self.enable_recentsearch = enable_recentsearch
diff --git a/sickbeard/providers/scc.py b/sickbeard/providers/scc.py
index 534e6a2d..0986c351 100644
--- a/sickbeard/providers/scc.py
+++ b/sickbeard/providers/scc.py
@@ -20,21 +20,17 @@
import re
import traceback
import datetime
+
import sickbeard
import generic
+from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
from sickbeard.common import Quality
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import db
-from sickbeard import classes
-from sickbeard import helpers
-from sickbeard import show_name_helpers
from sickbeard.exceptions import ex
+from sickbeard.bs4_parser import BS4Parser
+from sickbeard.helpers import sanitizeSceneName
from lib import requests
from lib.requests import exceptions
-from sickbeard.bs4_parser import BS4Parser
from lib.unidecode import unidecode
-from sickbeard.helpers import sanitizeSceneName
class SCCProvider(generic.TorrentProvider):
@@ -48,22 +44,14 @@ class SCCProvider(generic.TorrentProvider):
'download': 'https://sceneaccess.eu/%s'}
def __init__(self):
-
- generic.TorrentProvider.__init__(self, 'SceneAccess')
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'SceneAccess', True, False)
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
-
self.cache = SCCCache(self)
-
self.url = self.urls['base_url']
-
self.categories = 'c27=27&c17=17&c11=11'
def getQuality(self, item, anime=False):
diff --git a/sickbeard/providers/speedcd.py b/sickbeard/providers/speedcd.py
index 571eba1a..5db305e9 100644
--- a/sickbeard/providers/speedcd.py
+++ b/sickbeard/providers/speedcd.py
@@ -18,24 +18,15 @@
import re
import datetime
-import urlparse
-import time
+
import sickbeard
import generic
-
-from sickbeard.common import Quality, cpu_presets
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import db
-from sickbeard import classes
-from sickbeard import helpers
-from sickbeard import show_name_helpers
-from sickbeard.common import Overview
+from sickbeard.common import Quality
+from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
from sickbeard.exceptions import ex
-from sickbeard import clients
+from sickbeard.helpers import sanitizeSceneName
from lib import requests
from lib.requests import exceptions
-from sickbeard.helpers import sanitizeSceneName
class SpeedCDProvider(generic.TorrentProvider):
@@ -47,23 +38,15 @@ class SpeedCDProvider(generic.TorrentProvider):
}
def __init__(self):
-
- generic.TorrentProvider.__init__(self, "Speedcd")
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'Speedcd', True, False)
self.username = None
self.password = None
self.ratio = None
self.freeleech = False
self.minseed = None
self.minleech = None
-
self.cache = SpeedCDCache(self)
-
self.url = self.urls['base_url']
-
self.categories = {'Season': {'c14': 1}, 'Episode': {'c2': 1, 'c49': 1}, 'RSS': {'c14': 1, 'c2': 1, 'c49': 1}}
def getQuality(self, item, anime=False):
diff --git a/sickbeard/providers/thepiratebay.py b/sickbeard/providers/thepiratebay.py
index 6bdc5f18..f4835487 100644
--- a/sickbeard/providers/thepiratebay.py
+++ b/sickbeard/providers/thepiratebay.py
@@ -27,36 +27,22 @@ import sickbeard
import generic
from sickbeard.common import Quality
from sickbeard.name_parser.parser import NameParser, InvalidNameException, InvalidShowException
-from sickbeard import db
-from sickbeard import classes
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import helpers
+from sickbeard import db, classes, logger, tvcache, helpers
from sickbeard.show_name_helpers import allPossibleShowNames, sanitizeSceneName
from lib.unidecode import unidecode
class ThePirateBayProvider(generic.TorrentProvider):
def __init__(self):
-
- generic.TorrentProvider.__init__(self, 'The Pirate Bay')
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'The Pirate Bay', True, False)
self.ratio = None
self.confirmed = False
self.minseed = None
self.minleech = None
-
self.cache = ThePirateBayCache(self)
-
self.proxy = ThePirateBayWebproxy()
-
self.url = 'https://thepiratebay.se/'
-
self.searchurl = self.url + 'search/%s/0/7/200' # order by seed
-
self.re_title_url = '/torrent/(?P\d+)/(?P.*?)//1".+?(?Pmagnet.*?)//1".+?(?P\d+).+?(?P\d+)'
def getQuality(self, item, anime=False):
diff --git a/sickbeard/providers/tokyotoshokan.py b/sickbeard/providers/tokyotoshokan.py
index 70b3f600..8324be5b 100644
--- a/sickbeard/providers/tokyotoshokan.py
+++ b/sickbeard/providers/tokyotoshokan.py
@@ -17,32 +17,19 @@
# along with SickGear. If not, see .
import urllib
-import re
import traceback
-import sickbeard
import generic
-
-from sickbeard import show_name_helpers
-from sickbeard import logger
+from sickbeard import logger, tvcache, show_name_helpers
from sickbeard.common import Quality
-from sickbeard import tvcache
-from sickbeard import show_name_helpers, helpers
from sickbeard.bs4_parser import BS4Parser
class TokyoToshokanProvider(generic.TorrentProvider):
def __init__(self):
-
- generic.TorrentProvider.__init__(self, "TokyoToshokan")
-
- self.supportsBacklog = True
- self.anime_only = True
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'TokyoToshokan', True, True)
self.ratio = None
-
self.cache = TokyoToshokanCache(self)
-
self.url = 'http://tokyotosho.info/'
def _get_title_and_url(self, item):
diff --git a/sickbeard/providers/torrentbytes.py b/sickbeard/providers/torrentbytes.py
index 7ecde633..0c246388 100644
--- a/sickbeard/providers/torrentbytes.py
+++ b/sickbeard/providers/torrentbytes.py
@@ -19,18 +19,12 @@
import re
import traceback
import datetime
-import urlparse
+
import sickbeard
import generic
from sickbeard.common import Quality
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import db
-from sickbeard import classes
-from sickbeard import helpers
-from sickbeard import show_name_helpers
+from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
from sickbeard.exceptions import ex
-from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from sickbeard.bs4_parser import BS4Parser
@@ -46,22 +40,14 @@ class TorrentBytesProvider(generic.TorrentProvider):
'download': 'https://www.torrentbytes.net/download.php?id=%s&SSL=1&name=%s'}
def __init__(self):
-
- generic.TorrentProvider.__init__(self, 'TorrentBytes')
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'TorrentBytes', True, False)
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
-
self.cache = TorrentBytesCache(self)
-
self.url = self.urls['base_url']
-
self.categories = '&c41=1&c33=1&c38=1&c32=1&c37=1'
def getQuality(self, item, anime=False):
diff --git a/sickbeard/providers/torrentday.py b/sickbeard/providers/torrentday.py
index a8a7e435..5e992e3e 100644
--- a/sickbeard/providers/torrentday.py
+++ b/sickbeard/providers/torrentday.py
@@ -17,18 +17,12 @@
import re
import datetime
-import urlparse
+
import sickbeard
import generic
from sickbeard.common import Quality
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import db
-from sickbeard import classes
-from sickbeard import helpers
-from sickbeard import show_name_helpers
+from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
from sickbeard.exceptions import ex
-from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from sickbeard.helpers import sanitizeSceneName
@@ -43,11 +37,7 @@ class TorrentDayProvider(generic.TorrentProvider):
def __init__(self):
- generic.TorrentProvider.__init__(self, "TorrentDay")
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'TorrentDay', True, False)
self._uid = None
self._hash = None
self.username = None
@@ -56,13 +46,9 @@ class TorrentDayProvider(generic.TorrentProvider):
self.freeleech = False
self.minseed = None
self.minleech = None
-
self.cache = TorrentDayCache(self)
-
self.url = self.urls['base_url']
-
self.cookies = None
-
self.categories = {'Season': {'c14': 1}, 'Episode': {'c2': 1, 'c26': 1, 'c7': 1, 'c24': 1},
'RSS': {'c2': 1, 'c26': 1, 'c7': 1, 'c24': 1, 'c14': 1}}
diff --git a/sickbeard/providers/torrentleech.py b/sickbeard/providers/torrentleech.py
index 9295d3d7..bbc2a73f 100644
--- a/sickbeard/providers/torrentleech.py
+++ b/sickbeard/providers/torrentleech.py
@@ -19,19 +19,12 @@
import re
import traceback
import datetime
-import urlparse
+
import sickbeard
import generic
-from sickbeard.common import Quality, cpu_presets
-from sickbeard import logger
-from sickbeard import tvcache
-from sickbeard import db
-from sickbeard import classes
-from sickbeard import helpers
-from sickbeard import show_name_helpers
-from sickbeard.common import Overview
+from sickbeard.common import Quality
+from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
from sickbeard.exceptions import ex
-from sickbeard import clients
from lib import requests
from lib.requests import exceptions
from sickbeard.bs4_parser import BS4Parser
@@ -49,23 +42,15 @@ class TorrentLeechProvider(generic.TorrentProvider):
}
def __init__(self):
-
- generic.TorrentProvider.__init__(self, "TorrentLeech")
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'TorrentLeech', True, False)
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
-
self.cache = TorrentLeechCache(self)
-
self.url = self.urls['base_url']
-
- self.categories = "2,26,27,32"
+ self.categories = '2,26,27,32'
def getQuality(self, item, anime=False):
diff --git a/sickbeard/providers/totv.py b/sickbeard/providers/totv.py
index 457cde1e..dde980c9 100644
--- a/sickbeard/providers/totv.py
+++ b/sickbeard/providers/totv.py
@@ -17,26 +17,20 @@
# along with SickGear. If not, see .
import urllib
+
import requests
import generic
-from sickbeard import logger
-from sickbeard import tvcache
+from sickbeard import logger, tvcache
from sickbeard.helpers import mapIndexersToShow
from sickbeard.exceptions import AuthException
class ToTVProvider(generic.TorrentProvider):
def __init__(self):
- generic.TorrentProvider.__init__(self, 'ToTV')
-
- self.supportsBacklog = True
-
- self.enabled = False
+ generic.TorrentProvider.__init__(self, 'ToTV', True, False)
self.api_key = None
self.ratio = None
-
self.cache = ToTVCache(self)
-
self.url = 'https://titansof.tv/api/torrents'
self.download_url = 'http://titansof.tv/api/torrents/%s/download?apikey=%s'
self.session = requests.Session()
diff --git a/sickbeard/providers/womble.py b/sickbeard/providers/womble.py
index e6be030c..90f5865d 100644
--- a/sickbeard/providers/womble.py
+++ b/sickbeard/providers/womble.py
@@ -18,14 +18,11 @@
import generic
-from sickbeard import logger
-from sickbeard import tvcache
-
+from sickbeard import logger, tvcache
class WombleProvider(generic.NZBProvider):
def __init__(self):
- generic.NZBProvider.__init__(self, "Womble's Index")
- self.enabled = False
+ generic.NZBProvider.__init__(self, "Womble's Index", False, False)
self.cache = WombleCache(self)
self.url = 'http://newshost.co.za/'