Merge pull request #327 from adam111316/feature/TidyProvidersCode2

Change to consolidate and tidy some provider code [part 2]
This commit is contained in:
adam111316 2015-04-18 14:21:44 +08:00
commit 64c2be6509
25 changed files with 91 additions and 388 deletions

View file

@ -39,10 +39,11 @@ __all__ = ['ezrss',
'totv', 'totv',
] ]
from os import sys
import sickbeard import sickbeard
import generic import generic
from sickbeard import logger from sickbeard import logger
from os import sys
def sortedProviderList(): def sortedProviderList():

View file

@ -19,29 +19,15 @@
import urllib import urllib
import datetime import datetime
import sickbeard
import generic 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): class animenzb(generic.NZBProvider):
def __init__(self): def __init__(self):
generic.NZBProvider.__init__(self, 'animenzb', True, True)
generic.NZBProvider.__init__(self, 'animenzb')
self.supportsBacklog = False
self.anime_only = True
self.enabled = False
self.cache = animenzbCache(self) self.cache = animenzbCache(self)
self.url = 'http://animenzb.com/' self.url = 'http://animenzb.com/'
def _get_season_search_strings(self, ep_obj): def _get_season_search_strings(self, ep_obj):

View file

@ -19,18 +19,13 @@
import re import re
import traceback import traceback
import datetime import datetime
import sickbeard import sickbeard
import generic import generic
import requests import requests
import requests.exceptions import requests.exceptions
from sickbeard.common import Quality from sickbeard.common import Quality
from sickbeard import logger from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
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, AuthException from sickbeard.exceptions import ex, AuthException
from sickbeard.helpers import sanitizeSceneName from sickbeard.helpers import sanitizeSceneName
from sickbeard.bs4_parser import BS4Parser from sickbeard.bs4_parser import BS4Parser
@ -46,23 +41,15 @@ class BitSoupProvider(generic.TorrentProvider):
} }
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'BitSoup', True, False)
generic.TorrentProvider.__init__(self, "BitSoup")
self.supportsBacklog = True
self.enabled = False
self.username = None self.username = None
self.password = None self.password = None
self.ratio = None self.ratio = None
self.minseed = None self.minseed = None
self.minleech = None self.minleech = None
self.cache = BitSoupCache(self) self.cache = BitSoupCache(self)
self.url = self.urls['base_url'] 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): def getQuality(self, item, anime=False):

View file

@ -20,32 +20,22 @@
import time import time
import socket import socket
import math import math
import sickbeard from datetime import datetime
import generic
from sickbeard import classes import generic
from sickbeard import scene_exceptions from sickbeard import classes, scene_exceptions, logger, tvcache
from sickbeard import logger
from sickbeard import tvcache
from sickbeard.helpers import sanitizeSceneName from sickbeard.helpers import sanitizeSceneName
from sickbeard.exceptions import ex, AuthException from sickbeard.exceptions import ex, AuthException
from lib import jsonrpclib from lib import jsonrpclib
from datetime import datetime
class BTNProvider(generic.TorrentProvider): class BTNProvider(generic.TorrentProvider):
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, "BTN") generic.TorrentProvider.__init__(self, 'BTN', True, False)
self.supportsBacklog = True
self.enabled = False
self.api_key = None self.api_key = None
self.ratio = None self.ratio = None
self.cache = BTNCache(self) self.cache = BTNCache(self)
self.url = 'http://api.btnapps.net'
self.url = "http://api.btnapps.net"
def _checkAuth(self): def _checkAuth(self):
if not self.api_key: if not self.api_key:

View file

@ -24,27 +24,16 @@ try:
except ImportError: except ImportError:
import elementtree.ElementTree as etree import elementtree.ElementTree as etree
import sickbeard
import generic import generic
from sickbeard.common import Quality from sickbeard.common import Quality
from sickbeard import logger from sickbeard import logger, tvcache, helpers
from sickbeard import tvcache
from sickbeard import helpers
class EZRSSProvider(generic.TorrentProvider): class EZRSSProvider(generic.TorrentProvider):
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'EZRSS', True, False)
generic.TorrentProvider.__init__(self, "EZRSS")
self.supportsBacklog = True
self.enabled = False
self.ratio = None self.ratio = None
self.cache = EZRSSCache(self) self.cache = EZRSSCache(self)
self.url = 'https://www.ezrss.it/' self.url = 'https://www.ezrss.it/'
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):

View file

@ -19,15 +19,11 @@
import re import re
import traceback import traceback
import datetime import datetime
import sickbeard import sickbeard
import generic import generic
from sickbeard.common import Quality from sickbeard.common import Quality
from sickbeard import logger from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
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, AuthException from sickbeard.exceptions import ex, AuthException
from lib import requests from lib import requests
from lib.requests import exceptions from lib.requests import exceptions
@ -44,12 +40,7 @@ class FreshOnTVProvider(generic.TorrentProvider):
'download': 'https://freshon.tv/download.php?id=%s&type=torrent'} 'download': 'https://freshon.tv/download.php?id=%s&type=torrent'}
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'FreshOnTV', True, False)
generic.TorrentProvider.__init__(self, 'FreshOnTV')
self.supportsBacklog = True
self.enabled = False
self._uid = None self._uid = None
self._hash = None self._hash = None
self.username = None self.username = None
@ -58,9 +49,7 @@ class FreshOnTVProvider(generic.TorrentProvider):
self.minseed = None self.minseed = None
self.minleech = None self.minleech = None
self.freeleech = False self.freeleech = False
self.cache = FreshOnTVCache(self) self.cache = FreshOnTVCache(self)
self.url = self.urls['base_url'] self.url = self.urls['base_url']
self.cookies = None self.cookies = None

View file

@ -23,36 +23,33 @@ import datetime
import os import os
import re import re
import itertools import itertools
from base64 import b16encode, b32decode
import sickbeard import sickbeard
import requests import requests
from sickbeard import helpers, classes, logger, db, tvcache
from sickbeard import helpers, classes, logger, db
from sickbeard.common import MULTI_EP_RESULT, SEASON_RESULT, USER_AGENT from sickbeard.common import MULTI_EP_RESULT, SEASON_RESULT, USER_AGENT
from sickbeard import tvcache
from sickbeard import encodingKludge as ek from sickbeard import encodingKludge as ek
from sickbeard.exceptions import ex from sickbeard.exceptions import ex
from sickbeard.name_parser.parser import NameParser, InvalidNameException, InvalidShowException from sickbeard.name_parser.parser import NameParser, InvalidNameException, InvalidShowException
from sickbeard.common import Quality from sickbeard.common import Quality
from sickbeard import clients
from hachoir_parser import createParser from hachoir_parser import createParser
from base64 import b16encode, b32decode
class GenericProvider: class GenericProvider:
NZB = "nzb" NZB = "nzb"
TORRENT = "torrent" TORRENT = "torrent"
def __init__(self, name): def __init__(self, name, supportsBacklog, anime_only):
# these need to be set in the subclass # these need to be set in the subclass
self.providerType = None self.providerType = None
self.name = name self.name = name
self.supportsBacklog = supportsBacklog
self.anime_only = anime_only
self.url = '' self.url = ''
self.show = None self.show = None
self.supportsBacklog = False
self.anime_only = False
self.search_mode = None self.search_mode = None
self.search_fallback = False self.search_fallback = False
self.enabled = False self.enabled = False
@ -467,14 +464,12 @@ class GenericProvider:
class NZBProvider(GenericProvider): class NZBProvider(GenericProvider):
def __init__(self, name): def __init__(self, name, supportsBacklog, anime_only):
GenericProvider.__init__(self, name) GenericProvider.__init__(self, name, supportsBacklog, anime_only)
self.providerType = GenericProvider.NZB self.providerType = GenericProvider.NZB
class TorrentProvider(GenericProvider): class TorrentProvider(GenericProvider):
def __init__(self, name): def __init__(self, name, supportsBacklog, anime_only):
GenericProvider.__init__(self, name) GenericProvider.__init__(self, name, supportsBacklog, anime_only)
self.providerType = GenericProvider.TORRENT self.providerType = GenericProvider.TORRENT

View file

@ -13,23 +13,14 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with SickGear. If not, see <http://www.gnu.org/licenses/>. # along with SickGear. If not, see <http://www.gnu.org/licenses/>.
import re
import time
import datetime import datetime
import urllib import urllib
import urlparse
import sys
import generic
import sickbeard
from lib import requests import generic
from lib.requests import exceptions from sickbeard import classes, logger, tvcache
from sickbeard import classes from sickbeard.exceptions import AuthException
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
try: try:
import json import json
except ImportError: except ImportError:
@ -38,18 +29,11 @@ except ImportError:
class HDBitsProvider(generic.TorrentProvider): class HDBitsProvider(generic.TorrentProvider):
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'HDBits', True, False)
generic.TorrentProvider.__init__(self, "HDBits")
self.supportsBacklog = True
self.enabled = False
self.username = None self.username = None
self.passkey = None self.passkey = None
self.ratio = None self.ratio = None
self.cache = HDBitsCache(self) self.cache = HDBitsCache(self)
self.url = 'https://hdbits.org' self.url = 'https://hdbits.org'
self.search_url = 'https://hdbits.org/api/torrents' self.search_url = 'https://hdbits.org/api/torrents'
self.rss_url = 'https://hdbits.org/api/torrents' self.rss_url = 'https://hdbits.org/api/torrents'

View file

@ -20,18 +20,12 @@
import re import re
import traceback import traceback
import datetime import datetime
import urlparse
import sickbeard import sickbeard
import generic import generic
from sickbeard.common import Quality, cpu_presets from sickbeard.common import Quality
from sickbeard import logger from sickbeard import logger,tvcache,db,classes,helpers,show_name_helpers
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, AuthException from sickbeard.exceptions import ex, AuthException
from sickbeard import clients
from lib import requests from lib import requests
from lib.requests import exceptions from lib.requests import exceptions
from sickbeard.bs4_parser import BS4Parser from sickbeard.bs4_parser import BS4Parser
@ -49,12 +43,7 @@ class HDTorrentsProvider(generic.TorrentProvider):
} }
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'HDTorrents', True, False)
generic.TorrentProvider.__init__(self, "HDTorrents")
self.supportsBacklog = True
self.enabled = False
self._uid = None self._uid = None
self._hash = None self._hash = None
self.username = None self.username = None
@ -62,13 +51,9 @@ class HDTorrentsProvider(generic.TorrentProvider):
self.ratio = None self.ratio = None
self.minseed = None self.minseed = None
self.minleech = None self.minleech = None
self.cache = HDTorrentsCache(self) self.cache = HDTorrentsCache(self)
self.url = self.urls['base_url'] self.url = self.urls['base_url']
self.categories = "&category[]=59&category[]=60&category[]=30&category[]=38" self.categories = "&category[]=59&category[]=60&category[]=30&category[]=38"
self.cookies = None self.cookies = None
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):

View file

@ -19,18 +19,12 @@
import re import re
import traceback import traceback
import datetime import datetime
import urlparse
import sickbeard import sickbeard
import generic import generic
from sickbeard.common import Quality from sickbeard.common import Quality
from sickbeard import logger from sickbeard import logger,tvcache,db,classes,helpers,show_name_helpers
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, AuthException from sickbeard.exceptions import ex, AuthException
from sickbeard import clients
from lib import requests from lib import requests
from lib.requests import exceptions from lib.requests import exceptions
from sickbeard.bs4_parser import BS4Parser from sickbeard.bs4_parser import BS4Parser
@ -46,21 +40,13 @@ class IPTorrentsProvider(generic.TorrentProvider):
} }
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'IPTorrents', True, False)
generic.TorrentProvider.__init__(self, "IPTorrents")
self.supportsBacklog = True
self.enabled = False
self.username = None self.username = None
self.password = None self.password = None
self.ratio = None self.ratio = None
self.freeleech = False self.freeleech = False
self.cache = IPTorrentsCache(self) self.cache = IPTorrentsCache(self)
self.url = self.urls['base_url'] self.url = self.urls['base_url']
self.categorie = 'l73=1&l78=1&l66=1&l65=1&l79=1&l5=1&l4=1' self.categorie = 'l73=1&l78=1&l66=1&l65=1&l79=1&l5=1&l4=1'
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):

View file

@ -19,7 +19,6 @@
from __future__ import with_statement from __future__ import with_statement
import sys
import os import os
import traceback import traceback
import urllib import urllib
@ -31,36 +30,20 @@ import sickbeard
import generic import generic
from sickbeard.common import Quality from sickbeard.common import Quality
from sickbeard.name_parser.parser import NameParser, InvalidNameException, InvalidShowException from sickbeard.name_parser.parser import NameParser, InvalidNameException, InvalidShowException
from sickbeard import logger from sickbeard import logger,tvcache,helpers,db,classes
from sickbeard import tvcache
from sickbeard import helpers
from sickbeard import db
from sickbeard import classes
from sickbeard.show_name_helpers import allPossibleShowNames, sanitizeSceneName 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 sickbeard.bs4_parser import BS4Parser
from lib import requests
from lib.requests import exceptions
from lib.unidecode import unidecode from lib.unidecode import unidecode
class KATProvider(generic.TorrentProvider): class KATProvider(generic.TorrentProvider):
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'KickAssTorrents', True, False)
generic.TorrentProvider.__init__(self, "KickAssTorrents")
self.supportsBacklog = True
self.enabled = False
self.confirmed = False self.confirmed = False
self.ratio = None self.ratio = None
self.minseed = None self.minseed = None
self.minleech = None self.minleech = None
self.cache = KATCache(self) self.cache = KATCache(self)
self.urls = ['https://kat.ph/', 'http://katproxy.com/', 'http://www.kickmirror.com/'] self.urls = ['https://kat.ph/', 'http://katproxy.com/', 'http://www.kickmirror.com/']
self.url = 'https://kat.ph/' self.url = 'https://kat.ph/'

View file

@ -29,30 +29,17 @@ except ImportError:
import sickbeard import sickbeard
import generic import generic
from sickbeard import classes from sickbeard import classes,helpers,scene_exceptions,logger,tvcache
from sickbeard import helpers
from sickbeard import scene_exceptions
from sickbeard import encodingKludge as ek from sickbeard import encodingKludge as ek
from sickbeard import logger from sickbeard.exceptions import AuthException
from sickbeard import tvcache
from sickbeard.exceptions import ex, AuthException
from lib import requests
from lib.requests import exceptions
from lib.bencode import bdecode
class NewznabProvider(generic.NZBProvider): class NewznabProvider(generic.NZBProvider):
def __init__(self, name, url, key='', catIDs='5030,5040', search_mode='eponly', search_fallback=False, def __init__(self, name, url, key='', catIDs='5030,5040', search_mode='eponly', search_fallback=False,
enable_recentsearch=False, enable_backlog=False): enable_recentsearch=False, enable_backlog=False):
generic.NZBProvider.__init__(self, name, True, False)
generic.NZBProvider.__init__(self, name)
self.cache = NewznabCache(self) self.cache = NewznabCache(self)
self.url = url self.url = url
self.key = key self.key = key
self.search_mode = search_mode self.search_mode = search_mode
self.search_fallback = search_fallback self.search_fallback = search_fallback
self.enable_recentsearch = enable_recentsearch self.enable_recentsearch = enable_recentsearch
@ -69,9 +56,6 @@ class NewznabProvider(generic.NZBProvider):
else: else:
self.catIDs = '5030,5040' self.catIDs = '5030,5040'
self.enabled = True
self.supportsBacklog = True
self.default = False self.default = False
def configStr(self): def configStr(self):
@ -215,7 +199,7 @@ class NewznabProvider(generic.NZBProvider):
params['q'] = helpers.sanitizeSceneName(cur_exception) params['q'] = helpers.sanitizeSceneName(cur_exception)
paramsNoEp = params.copy() paramsNoEp = params.copy()
paramsNoEp['q'] = '%s.%02d' % (paramsNoEp['q'], paramsNoEp['ep']) paramsNoEp['q'] = '%s.%02d' % (paramsNoEp['q'], int(paramsNoEp['ep']))
if "ep" in paramsNoEp: if "ep" in paramsNoEp:
paramsNoEp.pop("ep") paramsNoEp.pop("ep")
to_return.append(paramsNoEp) to_return.append(paramsNoEp)

View file

@ -17,26 +17,15 @@
# along with SickGear. If not, see <http://www.gnu.org/licenses/>. # along with SickGear. If not, see <http://www.gnu.org/licenses/>.
import traceback import traceback
import urllib2
import urllib
import time import time
import re import re
import datetime import datetime
import urlparse
import sickbeard import sickbeard
import generic import generic
from sickbeard.common import Quality, cpu_presets from sickbeard.common import Quality
from sickbeard import logger from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
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 lib import requests from lib import requests
from lib.requests import exceptions
from sickbeard.bs4_parser import BS4Parser from sickbeard.bs4_parser import BS4Parser
from sickbeard.helpers import sanitizeSceneName from sickbeard.helpers import sanitizeSceneName
@ -51,24 +40,14 @@ class NextGenProvider(generic.TorrentProvider):
} }
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'NextGen', True, False)
generic.TorrentProvider.__init__(self, "NextGen")
self.supportsBacklog = True
self.enabled = False
self.username = None self.username = None
self.password = None self.password = None
self.ratio = None self.ratio = None
self.cache = NextGenCache(self) self.cache = NextGenCache(self)
self.url = self.urls['base_url'] 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.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.last_login_check = None
self.login_opener = None self.login_opener = None
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):

View file

@ -19,28 +19,16 @@
import urllib import urllib
import re import re
import sickbeard
import generic import generic
from sickbeard import logger, tvcache, show_name_helpers
from sickbeard import show_name_helpers
from sickbeard import logger
from sickbeard.common import Quality from sickbeard.common import Quality
from sickbeard import tvcache
from sickbeard import show_name_helpers
class NyaaProvider(generic.TorrentProvider): class NyaaProvider(generic.TorrentProvider):
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'NyaaTorrents', True, True)
generic.TorrentProvider.__init__(self, "NyaaTorrents")
self.supportsBacklog = True
self.anime_only = True
self.enabled = False
self.ratio = None self.ratio = None
self.cache = NyaaCache(self) self.cache = NyaaCache(self)
self.url = 'http://www.nyaa.se/' self.url = 'http://www.nyaa.se/'
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):

View file

@ -17,16 +17,13 @@
# along with SickGear. If not, see <http://www.gnu.org/licenses/>. # along with SickGear. If not, see <http://www.gnu.org/licenses/>.
import urllib import urllib
from datetime import datetime
import generic import generic
import sickbeard 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: try:
import xml.etree.cElementTree as etree import xml.etree.cElementTree as etree
@ -41,13 +38,11 @@ except ImportError:
class OmgwtfnzbsProvider(generic.NZBProvider): class OmgwtfnzbsProvider(generic.NZBProvider):
def __init__(self): def __init__(self):
generic.NZBProvider.__init__(self, "omgwtfnzbs") generic.NZBProvider.__init__(self, 'omgwtfnzbs', True, False)
self.enabled = False
self.username = None self.username = None
self.api_key = None self.api_key = None
self.cache = OmgwtfnzbsCache(self) self.cache = OmgwtfnzbsCache(self)
self.url = 'https://omgwtfnzbs.org/' self.url = 'https://omgwtfnzbs.org/'
self.supportsBacklog = True
def _checkAuth(self): def _checkAuth(self):

View file

@ -18,34 +18,24 @@
import os import os
import re import re
import urlparse
import sickbeard import sickbeard
import generic import generic
from sickbeard import helpers, logger, tvcache
from sickbeard import helpers
from sickbeard import encodingKludge as ek from sickbeard import encodingKludge as ek
from sickbeard import logger
from sickbeard import tvcache
from sickbeard import clients
from sickbeard.exceptions import ex from sickbeard.exceptions import ex
from lib import requests from lib import requests
from lib.requests import exceptions
from lib.bencode import bdecode from lib.bencode import bdecode
class TorrentRssProvider(generic.TorrentProvider): class TorrentRssProvider(generic.TorrentProvider):
def __init__(self, name, url, cookies='', search_mode='eponly', search_fallback=False, enable_recentsearch=False, def __init__(self, name, url, cookies='', search_mode='eponly', search_fallback=False, enable_recentsearch=False,
enable_backlog=False): enable_backlog=False):
generic.TorrentProvider.__init__(self, name) generic.TorrentProvider.__init__(self, name, False, False)
self.cache = TorrentRssCache(self) self.cache = TorrentRssCache(self)
self.url = re.sub('\/$', '', url) self.url = re.sub('\/$', '', url)
self.url = url self.url = url
self.enabled = True
self.ratio = None self.ratio = None
self.supportsBacklog = False
self.search_mode = search_mode self.search_mode = search_mode
self.search_fallback = search_fallback self.search_fallback = search_fallback
self.enable_recentsearch = enable_recentsearch self.enable_recentsearch = enable_recentsearch

View file

@ -20,21 +20,17 @@
import re import re
import traceback import traceback
import datetime import datetime
import sickbeard import sickbeard
import generic import generic
from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
from sickbeard.common import Quality 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.exceptions import ex
from sickbeard.bs4_parser import BS4Parser
from sickbeard.helpers import sanitizeSceneName
from lib import requests from lib import requests
from lib.requests import exceptions from lib.requests import exceptions
from sickbeard.bs4_parser import BS4Parser
from lib.unidecode import unidecode from lib.unidecode import unidecode
from sickbeard.helpers import sanitizeSceneName
class SCCProvider(generic.TorrentProvider): class SCCProvider(generic.TorrentProvider):
@ -48,22 +44,14 @@ class SCCProvider(generic.TorrentProvider):
'download': 'https://sceneaccess.eu/%s'} 'download': 'https://sceneaccess.eu/%s'}
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'SceneAccess', True, False)
generic.TorrentProvider.__init__(self, 'SceneAccess')
self.supportsBacklog = True
self.enabled = False
self.username = None self.username = None
self.password = None self.password = None
self.ratio = None self.ratio = None
self.minseed = None self.minseed = None
self.minleech = None self.minleech = None
self.cache = SCCCache(self) self.cache = SCCCache(self)
self.url = self.urls['base_url'] self.url = self.urls['base_url']
self.categories = 'c27=27&c17=17&c11=11' self.categories = 'c27=27&c17=17&c11=11'
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):

View file

@ -18,24 +18,15 @@
import re import re
import datetime import datetime
import urlparse
import time
import sickbeard import sickbeard
import generic import generic
from sickbeard.common import Quality
from sickbeard.common import Quality, cpu_presets from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
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.exceptions import ex
from sickbeard import clients from sickbeard.helpers import sanitizeSceneName
from lib import requests from lib import requests
from lib.requests import exceptions from lib.requests import exceptions
from sickbeard.helpers import sanitizeSceneName
class SpeedCDProvider(generic.TorrentProvider): class SpeedCDProvider(generic.TorrentProvider):
@ -47,23 +38,15 @@ class SpeedCDProvider(generic.TorrentProvider):
} }
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'Speedcd', True, False)
generic.TorrentProvider.__init__(self, "Speedcd")
self.supportsBacklog = True
self.enabled = False
self.username = None self.username = None
self.password = None self.password = None
self.ratio = None self.ratio = None
self.freeleech = False self.freeleech = False
self.minseed = None self.minseed = None
self.minleech = None self.minleech = None
self.cache = SpeedCDCache(self) self.cache = SpeedCDCache(self)
self.url = self.urls['base_url'] self.url = self.urls['base_url']
self.categories = {'Season': {'c14': 1}, 'Episode': {'c2': 1, 'c49': 1}, 'RSS': {'c14': 1, 'c2': 1, 'c49': 1}} self.categories = {'Season': {'c14': 1}, 'Episode': {'c2': 1, 'c49': 1}, 'RSS': {'c14': 1, 'c2': 1, 'c49': 1}}
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):

View file

@ -27,36 +27,22 @@ import sickbeard
import generic import generic
from sickbeard.common import Quality from sickbeard.common import Quality
from sickbeard.name_parser.parser import NameParser, InvalidNameException, InvalidShowException from sickbeard.name_parser.parser import NameParser, InvalidNameException, InvalidShowException
from sickbeard import db from sickbeard import db, classes, logger, tvcache, helpers
from sickbeard import classes
from sickbeard import logger
from sickbeard import tvcache
from sickbeard import helpers
from sickbeard.show_name_helpers import allPossibleShowNames, sanitizeSceneName from sickbeard.show_name_helpers import allPossibleShowNames, sanitizeSceneName
from lib.unidecode import unidecode from lib.unidecode import unidecode
class ThePirateBayProvider(generic.TorrentProvider): class ThePirateBayProvider(generic.TorrentProvider):
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'The Pirate Bay', True, False)
generic.TorrentProvider.__init__(self, 'The Pirate Bay')
self.supportsBacklog = True
self.enabled = False
self.ratio = None self.ratio = None
self.confirmed = False self.confirmed = False
self.minseed = None self.minseed = None
self.minleech = None self.minleech = None
self.cache = ThePirateBayCache(self) self.cache = ThePirateBayCache(self)
self.proxy = ThePirateBayWebproxy() self.proxy = ThePirateBayWebproxy()
self.url = 'https://thepiratebay.se/' self.url = 'https://thepiratebay.se/'
self.searchurl = self.url + 'search/%s/0/7/200' # order by seed self.searchurl = self.url + 'search/%s/0/7/200' # order by seed
self.re_title_url = '/torrent/(?P<id>\d+)/(?P<title>.*?)//1".+?(?P<url>magnet.*?)//1".+?(?P<seeders>\d+)</td>.+?(?P<leechers>\d+)</td>' self.re_title_url = '/torrent/(?P<id>\d+)/(?P<title>.*?)//1".+?(?P<url>magnet.*?)//1".+?(?P<seeders>\d+)</td>.+?(?P<leechers>\d+)</td>'
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):

View file

@ -17,32 +17,19 @@
# along with SickGear. If not, see <http://www.gnu.org/licenses/>. # along with SickGear. If not, see <http://www.gnu.org/licenses/>.
import urllib import urllib
import re
import traceback import traceback
import sickbeard
import generic import generic
from sickbeard import logger, tvcache, show_name_helpers
from sickbeard import show_name_helpers
from sickbeard import logger
from sickbeard.common import Quality from sickbeard.common import Quality
from sickbeard import tvcache
from sickbeard import show_name_helpers, helpers
from sickbeard.bs4_parser import BS4Parser from sickbeard.bs4_parser import BS4Parser
class TokyoToshokanProvider(generic.TorrentProvider): class TokyoToshokanProvider(generic.TorrentProvider):
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'TokyoToshokan', True, True)
generic.TorrentProvider.__init__(self, "TokyoToshokan")
self.supportsBacklog = True
self.anime_only = True
self.enabled = False
self.ratio = None self.ratio = None
self.cache = TokyoToshokanCache(self) self.cache = TokyoToshokanCache(self)
self.url = 'http://tokyotosho.info/' self.url = 'http://tokyotosho.info/'
def _get_title_and_url(self, item): def _get_title_and_url(self, item):

View file

@ -19,18 +19,12 @@
import re import re
import traceback import traceback
import datetime import datetime
import urlparse
import sickbeard import sickbeard
import generic import generic
from sickbeard.common import Quality from sickbeard.common import Quality
from sickbeard import logger from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
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.exceptions import ex
from sickbeard import clients
from lib import requests from lib import requests
from lib.requests import exceptions from lib.requests import exceptions
from sickbeard.bs4_parser import BS4Parser 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'} 'download': 'https://www.torrentbytes.net/download.php?id=%s&SSL=1&name=%s'}
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'TorrentBytes', True, False)
generic.TorrentProvider.__init__(self, 'TorrentBytes')
self.supportsBacklog = True
self.enabled = False
self.username = None self.username = None
self.password = None self.password = None
self.ratio = None self.ratio = None
self.minseed = None self.minseed = None
self.minleech = None self.minleech = None
self.cache = TorrentBytesCache(self) self.cache = TorrentBytesCache(self)
self.url = self.urls['base_url'] self.url = self.urls['base_url']
self.categories = '&c41=1&c33=1&c38=1&c32=1&c37=1' self.categories = '&c41=1&c33=1&c38=1&c32=1&c37=1'
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):

View file

@ -17,18 +17,12 @@
import re import re
import datetime import datetime
import urlparse
import sickbeard import sickbeard
import generic import generic
from sickbeard.common import Quality from sickbeard.common import Quality
from sickbeard import logger from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
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.exceptions import ex
from sickbeard import clients
from lib import requests from lib import requests
from lib.requests import exceptions from lib.requests import exceptions
from sickbeard.helpers import sanitizeSceneName from sickbeard.helpers import sanitizeSceneName
@ -43,11 +37,7 @@ class TorrentDayProvider(generic.TorrentProvider):
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, "TorrentDay") generic.TorrentProvider.__init__(self, 'TorrentDay', True, False)
self.supportsBacklog = True
self.enabled = False
self._uid = None self._uid = None
self._hash = None self._hash = None
self.username = None self.username = None
@ -56,13 +46,9 @@ class TorrentDayProvider(generic.TorrentProvider):
self.freeleech = False self.freeleech = False
self.minseed = None self.minseed = None
self.minleech = None self.minleech = None
self.cache = TorrentDayCache(self) self.cache = TorrentDayCache(self)
self.url = self.urls['base_url'] self.url = self.urls['base_url']
self.cookies = None self.cookies = None
self.categories = {'Season': {'c14': 1}, 'Episode': {'c2': 1, 'c26': 1, 'c7': 1, 'c24': 1}, 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}} 'RSS': {'c2': 1, 'c26': 1, 'c7': 1, 'c24': 1, 'c14': 1}}

View file

@ -19,19 +19,12 @@
import re import re
import traceback import traceback
import datetime import datetime
import urlparse
import sickbeard import sickbeard
import generic import generic
from sickbeard.common import Quality, cpu_presets from sickbeard.common import Quality
from sickbeard import logger from sickbeard import logger, tvcache, db, classes, helpers, show_name_helpers
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.exceptions import ex
from sickbeard import clients
from lib import requests from lib import requests
from lib.requests import exceptions from lib.requests import exceptions
from sickbeard.bs4_parser import BS4Parser from sickbeard.bs4_parser import BS4Parser
@ -49,23 +42,15 @@ class TorrentLeechProvider(generic.TorrentProvider):
} }
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'TorrentLeech', True, False)
generic.TorrentProvider.__init__(self, "TorrentLeech")
self.supportsBacklog = True
self.enabled = False
self.username = None self.username = None
self.password = None self.password = None
self.ratio = None self.ratio = None
self.minseed = None self.minseed = None
self.minleech = None self.minleech = None
self.cache = TorrentLeechCache(self) self.cache = TorrentLeechCache(self)
self.url = self.urls['base_url'] self.url = self.urls['base_url']
self.categories = '2,26,27,32'
self.categories = "2,26,27,32"
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):

View file

@ -17,26 +17,20 @@
# along with SickGear. If not, see <http://www.gnu.org/licenses/>. # along with SickGear. If not, see <http://www.gnu.org/licenses/>.
import urllib import urllib
import requests import requests
import generic import generic
from sickbeard import logger from sickbeard import logger, tvcache
from sickbeard import tvcache
from sickbeard.helpers import mapIndexersToShow from sickbeard.helpers import mapIndexersToShow
from sickbeard.exceptions import AuthException from sickbeard.exceptions import AuthException
class ToTVProvider(generic.TorrentProvider): class ToTVProvider(generic.TorrentProvider):
def __init__(self): def __init__(self):
generic.TorrentProvider.__init__(self, 'ToTV') generic.TorrentProvider.__init__(self, 'ToTV', True, False)
self.supportsBacklog = True
self.enabled = False
self.api_key = None self.api_key = None
self.ratio = None self.ratio = None
self.cache = ToTVCache(self) self.cache = ToTVCache(self)
self.url = 'https://titansof.tv/api/torrents' self.url = 'https://titansof.tv/api/torrents'
self.download_url = 'http://titansof.tv/api/torrents/%s/download?apikey=%s' self.download_url = 'http://titansof.tv/api/torrents/%s/download?apikey=%s'
self.session = requests.Session() self.session = requests.Session()

View file

@ -18,14 +18,11 @@
import generic import generic
from sickbeard import logger from sickbeard import logger, tvcache
from sickbeard import tvcache
class WombleProvider(generic.NZBProvider): class WombleProvider(generic.NZBProvider):
def __init__(self): def __init__(self):
generic.NZBProvider.__init__(self, "Womble's Index") generic.NZBProvider.__init__(self, "Womble's Index", False, False)
self.enabled = False
self.cache = WombleCache(self) self.cache = WombleCache(self)
self.url = 'http://newshost.co.za/' self.url = 'http://newshost.co.za/'