mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-05 02:43:37 +00:00
0d50a4b345
Change improve probability selecting most seeded release. Change add the TorrentDay x265 category to search. Change torrent provider code PEP8 and refactoring. Add BTScene torrent provider. Add Extratorrent provider. Add Limetorrents provider. Add nCore torrent provider. Remove Usenet Crawler provider.
57 lines
1.8 KiB
Python
57 lines
1.8 KiB
Python
# Author: Nic Wolfe <nic@wolfeden.ca>
|
|
# URL: http://code.google.com/p/sickbeard/
|
|
#
|
|
# This file is part of SickGear.
|
|
#
|
|
# SickGear is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# SickGear is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
from . import generic
|
|
from sickbeard import tvcache
|
|
import time
|
|
|
|
|
|
class WombleProvider(generic.NZBProvider):
|
|
|
|
def __init__(self):
|
|
generic.NZBProvider.__init__(self, 'Womble\'s Index', supports_backlog=False)
|
|
|
|
self.url = 'https://newshost.co.za/'
|
|
self.cache = WombleCache(self)
|
|
|
|
|
|
class WombleCache(tvcache.TVCache):
|
|
|
|
def __init__(self, this_provider):
|
|
tvcache.TVCache.__init__(self, this_provider)
|
|
|
|
self.update_freq = 6
|
|
|
|
def _cache_data(self):
|
|
|
|
result = []
|
|
for section in ['sd', 'hd', 'x264', 'dvd']:
|
|
url = '%srss/?sec=tv-%s&fr=false' % (self.provider.url, section)
|
|
xml_data = self.getRSSFeed(url)
|
|
time.sleep(1.1)
|
|
cnt = len(result)
|
|
for entry in (xml_data and xml_data.get('entries', []) or []):
|
|
if entry.get('title') and entry.get('link', '').startswith('http'):
|
|
result.append((entry.get('title'), entry.get('link'), None, None))
|
|
|
|
self.provider.log_result(count=len(result) - cnt, url=url)
|
|
|
|
return result
|
|
|
|
|
|
provider = WombleProvider()
|