mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Add provider Anizb.
This commit is contained in:
parent
2f442c6bda
commit
06fec4db07
4 changed files with 75 additions and 1 deletions
|
@ -75,6 +75,7 @@
|
|||
* Change remove some logging cruft
|
||||
* Fix post processing "Force already processed" processing only the first of multiple files
|
||||
* Add FileList torrent provider
|
||||
* Add provider Anizb
|
||||
|
||||
|
||||
### 0.11.11 (2016-04-05 19:20:00 UTC)
|
||||
|
|
BIN
gui/slick/images/providers/anizb.png
Normal file
BIN
gui/slick/images/providers/anizb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 404 B |
|
@ -26,7 +26,7 @@ from sickbeard import logger, encodingKludge as ek
|
|||
# usenet
|
||||
from . import newznab, omgwtfnzbs, womble
|
||||
# torrent
|
||||
from . import alpharatio, beyondhd, bitmetv, btn, filelist, freshontv, funfile, gftracker, grabtheinfo, \
|
||||
from . import alpharatio, anizb, beyondhd, bitmetv, btn, filelist, freshontv, funfile, gftracker, grabtheinfo, \
|
||||
hd4free, hdbits, hdspace, iptorrents, kat, morethan, pisexy, pretome, rarbg, scc, scenetime, shazbat, speedcd, \
|
||||
thepiratebay, torrentbytes, torrentday, torrenting, torrentleech, torrentshack, transmithe_net, tvchaosuk
|
||||
# anime
|
||||
|
@ -40,6 +40,7 @@ except:
|
|||
__all__ = ['omgwtfnzbs',
|
||||
'womble',
|
||||
'alpharatio',
|
||||
'anizb',
|
||||
'beyondhd',
|
||||
'bitmetv',
|
||||
'btn',
|
||||
|
|
72
sickbeard/providers/anizb.py
Normal file
72
sickbeard/providers/anizb.py
Normal file
|
@ -0,0 +1,72 @@
|
|||
# coding=utf-8
|
||||
#
|
||||
# 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 show_name_helpers, tvcache
|
||||
import time
|
||||
|
||||
|
||||
class AnizbProvider(generic.NZBProvider):
|
||||
|
||||
def __init__(self):
|
||||
generic.NZBProvider.__init__(self, 'Anizb', anime_only=True)
|
||||
|
||||
self.url = 'https://anizb.org/'
|
||||
self.cache = AnizbCache(self)
|
||||
|
||||
def _search_provider(self, search_params, **kwargs):
|
||||
|
||||
results = []
|
||||
if self.show and not self.show.is_anime:
|
||||
return results
|
||||
|
||||
for mode in search_params.keys():
|
||||
for params in search_params[mode]:
|
||||
|
||||
search_url = '%sapi/%s' % (self.url, params and ('?q=%s' % params) or '')
|
||||
data = self.cache.getRSSFeed(search_url)
|
||||
time.sleep(1.1)
|
||||
|
||||
cnt = len(results)
|
||||
for entry in (data and data.get('entries', []) or []):
|
||||
if entry.get('title') and entry.get('link', '').startswith('http'):
|
||||
results.append((entry['title'], entry['link'], None, None))
|
||||
|
||||
self.log_result(mode=mode, count=len(results) - cnt, url=search_url)
|
||||
|
||||
return list(set(results))
|
||||
|
||||
def _season_strings(self, ep_obj, **kwargs):
|
||||
return [{'Season': [
|
||||
x.replace('.', ' ') for x in show_name_helpers.makeSceneSeasonSearchString(self.show, ep_obj)]}]
|
||||
|
||||
def _episode_strings(self, ep_obj, **kwargs):
|
||||
return [{'Episode': [
|
||||
x.replace('.', ' ') for x in show_name_helpers.makeSceneSearchString(self.show, ep_obj)]}]
|
||||
|
||||
|
||||
class AnizbCache(tvcache.TVCache):
|
||||
|
||||
def __init__(self, this_provider):
|
||||
tvcache.TVCache.__init__(self, this_provider)
|
||||
self.update_freq = 6
|
||||
|
||||
def _cache_data(self):
|
||||
return self.provider.cache_data()
|
||||
|
||||
|
||||
provider = AnizbProvider()
|
Loading…
Reference in a new issue