mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Merge pull request #327 from adam111316/feature/TidyProvidersCode2
Change to consolidate and tidy some provider code [part 2]
This commit is contained in:
commit
64c2be6509
25 changed files with 91 additions and 388 deletions
|
@ -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():
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -13,23 +13,14 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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'
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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/'
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -17,26 +17,15 @@
|
|||
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -17,16 +17,13 @@
|
|||
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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):
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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<id>\d+)/(?P<title>.*?)//1".+?(?P<url>magnet.*?)//1".+?(?P<seeders>\d+)</td>.+?(?P<leechers>\d+)</td>'
|
||||
|
||||
def getQuality(self, item, anime=False):
|
||||
|
|
|
@ -17,32 +17,19 @@
|
|||
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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}}
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
||||
|
|
|
@ -17,26 +17,20 @@
|
|||
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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()
|
||||
|
|
|
@ -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/'
|
||||
|
||||
|
|
Loading…
Reference in a new issue