Browse Source

Remove Nzb.org and Milkie providers and add NinjaCentral usenet provider.

tags/release_0.18.20^2
JackDandy 6 years ago
parent
commit
ee12086c45
  1. 9
      CHANGES.md
  2. BIN
      gui/slick/images/providers/ninjacentral.png
  3. 7
      sickbeard/config.py
  4. 4
      sickbeard/providers/__init__.py
  5. 25
      sickbeard/providers/generic.py
  6. 85
      sickbeard/providers/milkie.py
  7. 34
      sickbeard/providers/newznab.py
  8. 2
      tests/test_lib.py

9
CHANGES.md

@ -1,4 +1,11 @@
### 0.18.19 (2019-04-19 02:00:00 UTC)
### 0.18.20 (2019-04-23 12:20:00 UTC)
* Add NinjaCentral usenet provider
* Remove Nzb.org usenet provider (r.i.p)
* Remove Milkie torrent provider (last activity > 3 months)
### 0.18.19 (2019-04-19 02:00:00 UTC)
* Fix season search at provider ETTV
* Change improve IMDb id parsing

BIN
gui/slick/images/providers/ninjacentral.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

7
sickbeard/config.py

@ -647,10 +647,9 @@ class ConfigMigrator:
if name == 'Sick Beard Index':
key = '0'
if name == 'NZBs.org':
cat_ids = '5030,5040,5060,5070,5090'
else:
cat_ids = '5030,5040,5060'
cat_ids = '5030,5040,5060'
# if name == 'NZBs.org':
# cat_ids = '5030,5040,5060,5070,5090'
cur_provider_data_list = [name, url, key, cat_ids, enabled]
new_newznab_data.append('|'.join(cur_provider_data_list))

4
sickbeard/providers/__init__.py

@ -33,7 +33,7 @@ __all__ = [
'alpharatio', 'bb', 'beyondhd', 'bithdtv', 'blutopia', 'btn',
'custom01', 'custom11', 'dh', 'ettv', 'eztv', 'fano', 'filelist', 'funfile', 'grabtheinfo',
'hdbits', 'hdme', 'hdspace', 'hdtorrents', 'horriblesubs',
'immortalseed', 'iptorrents', 'limetorrents', 'magnetdl', 'milkie', 'morethan', 'nebulance', 'ncore', 'nyaa',
'immortalseed', 'iptorrents', 'limetorrents', 'magnetdl', 'morethan', 'nebulance', 'ncore', 'nyaa',
'pisexy', 'potuk', 'pretome', 'privatehd', 'ptf',
'rarbg', 'revtt', 'scenehd', 'scenetime', 'shazbat', 'showrss', 'skytorrents', 'snowfl', 'speedcd',
'thepiratebay', 'torlock', 'torrentday', 'torrenting', 'torrentleech', 'tvchaosuk',
@ -203,8 +203,8 @@ def makeTorrentRssProvider(configString):
def getDefaultNewznabProviders():
return '!!!'.join(['Sick Beard Index|https://lolo.sickbeard.com/|0|5030,5040|0|eponly|0|0|0',
'NZBgeek|https://api.nzbgeek.info/||5030,5040|0|eponly|0|0|0',
'NZBs.org|https://nzbs.org/||5030,5040|0|eponly|0|0|0',
'DrunkenSlug|https://api.drunkenslug.com/||5030,5040|0|eponly|0|0|0',
'NinjaCentral|https://ninjacentral.co.za/||5030,5040|0|eponly|0|0|0',
])

25
sickbeard/providers/generic.py

@ -1261,8 +1261,8 @@ class NZBProvider(GenericProvider):
return results
index = 0
alt_search = ('nzbs_org' == self.get_id())
do_search_alt = False
# alt_search = ('nzbs_org' == self.get_id())
# do_search_alt = False
search_terms = []
regex = []
@ -1282,16 +1282,17 @@ class NZBProvider(GenericProvider):
break
search_params = {'q': search_terms[index], 'maxage': sickbeard.BACKLOG_DAYS + 2}
if alt_search:
if do_search_alt:
search_params['t'] = 'search'
index += 1
do_search_alt = not do_search_alt
else:
index += 1
# if alt_search:
#
# if do_search_alt:
# search_params['t'] = 'search'
# index += 1
#
# do_search_alt = not do_search_alt
#
# else:
# index += 1
index += 1
for item in self._search_provider({'Propers': [search_params]}):

85
sickbeard/providers/milkie.py

@ -1,85 +0,0 @@
# coding=utf-8
#
# Author: SickGear
#
# 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.helpers import tryInt
from lib.unidecode import unidecode
class MilkieProvider(generic.TorrentProvider):
def __init__(self):
generic.TorrentProvider.__init__(self, 'Milkie')
self.url_base = 'https://milkie.cc/'
self.api = self.url_base + 'api/v1/'
self.urls = {'config_provider_home_uri': self.url_base,
'login': self.api + 'auth/sessions', 'get': self.api + 'torrents/%s',
'search': self.api + 'torrents?pi=0&ps=100&query=%s&categories=2&mode=release'}
self.username, self.password, self.minseed, self.minleech, self._token = 5 * [None]
def _authorised(self, **kwargs):
return super(MilkieProvider, self)._authorised(
post_params=dict(login=False), post_json=dict(email=self.username, password=self.password),
json=True, logged_in=self.logged_in)
def logged_in(self, resp=None):
self._token = resp and resp.get('token')
return bool(self._token)
def _search_provider(self, search_params, **kwargs):
results = []
if not self._authorised():
return results
items = {'Cache': [], 'Season': [], 'Episode': [], 'Propers': []}
for mode in search_params.keys():
for search_string in search_params[mode]:
search_string = isinstance(search_string, unicode) and unidecode(search_string) or search_string
search_url = self.urls['search'] % search_string
data_json = self.get_url(search_url, headers=dict(Authorization='Bearer %s' % self._token), json=True)
if self.should_skip():
return results
cnt = len(items[mode])
if data_json:
for tr in data_json.get('releases'):
seeders, leechers, size = (tryInt(n, n) for n in [
tr.get(x) for x in ('seeders', 'leechers', 'size')])
if not self._reject_item(seeders, leechers):
title, download_url = tr.get('releaseName'), self._link(tr.get('shortId'))
if title and download_url:
items[mode].append((title, download_url, seeders, self._bytesizer(size)))
self._log_search(mode, len(items[mode]) - cnt, search_url)
results = self._sort_seeding(mode, results + items[mode])
return results
provider = MilkieProvider()

34
sickbeard/providers/newznab.py

@ -317,11 +317,11 @@ class NewznabProvider(generic.NZBProvider):
caps[NewznabConstants.SEARCH_TEXT] = 'q'
if NewznabConstants.CAT_HD not in cats or not cats.get(NewznabConstants.CAT_HD):
cats[NewznabConstants.CAT_HD] = (['5040'], ['5040', '5090'])['nzbs_org' == self.get_id()]
cats[NewznabConstants.CAT_HD] = ['5040'] # (['5040'], ['5040', '5090'])['nzbs_org' == self.get_id()]
if NewznabConstants.CAT_SD not in cats or not cats.get(NewznabConstants.CAT_SD):
cats[NewznabConstants.CAT_SD] = (['5030'], ['5030', '5070'])['nzbs_org' == self.get_id()]
cats[NewznabConstants.CAT_SD] = ['5030'] # (['5030'], ['5030', '5070'])['nzbs_org' == self.get_id()]
if NewznabConstants.CAT_ANIME not in cats or not cats.get(NewznabConstants.CAT_ANIME):
cats[NewznabConstants.CAT_ANIME] = (['5070'], ['6070', '7040'])['nzbs_org' == self.get_id()]
cats[NewznabConstants.CAT_ANIME] = ['5070'] # (['5070'], ['6070', '7040'])['nzbs_org' == self.get_id()]
if NewznabConstants.CAT_SPORT not in cats or not cats.get(NewznabConstants.CAT_SPORT):
cats[NewznabConstants.CAT_SPORT] = ['5060']
@ -763,7 +763,8 @@ class NewznabProvider(generic.NZBProvider):
base_params_uc['t'] = base_params['cat']
request_params = base_params.copy()
if ('Propers' == mode or 'nzbs_org' == self.get_id()) \
# if ('Propers' == mode or 'nzbs_org' == self.get_id()) \
if 'Propers' == mode \
and 'q' in params and not (any(x in params for x in ['season', 'ep'])):
request_params['t'] = 'search'
request_params.update(params)
@ -892,8 +893,8 @@ class NewznabProvider(generic.NZBProvider):
return results
index = 0
alt_search = ('nzbs_org' == self.get_id())
do_search_alt = False
# alt_search = ('nzbs_org' == self.get_id())
# do_search_alt = False
search_terms = []
regex = []
@ -913,16 +914,17 @@ class NewznabProvider(generic.NZBProvider):
break
search_params = {'q': search_terms[index], 'maxage': sickbeard.BACKLOG_DAYS + 2}
if alt_search:
if do_search_alt:
search_params['t'] = 'search'
index += 1
do_search_alt = not do_search_alt
else:
index += 1
# if alt_search:
#
# if do_search_alt:
# search_params['t'] = 'search'
# index += 1
#
# do_search_alt = not do_search_alt
#
# else:
# index += 1
index += 1
items, n_space = self._search_provider({'Propers': [search_params]})

2
tests/test_lib.py

@ -86,7 +86,7 @@ sickbeard.NAMING_MULTI_EP = 1
sickbeard.PROVIDER_ORDER = ['sick_beard_index']
sickbeard.newznabProviderList = providers.getNewznabProviderList("'Sick Beard Index|http://lolo.sickbeard.com/|0|5030,5040,5060|0|eponly|0!!!NZBs.org|https://nzbs.org/||5030,5040,5060,5070,5090|0|eponly|0!!!Usenet-Crawler|https://www.usenet-crawler.com/||5030,5040,5060|0|eponly|0'")
sickbeard.newznabProviderList = providers.getNewznabProviderList("'Sick Beard Index|http://lolo.sickbeard.com/|0|5030,5040,5060|0|eponly|0'")
sickbeard.providerList = providers.makeProviderList()
sickbeard.PROG_DIR = os.path.abspath('..')

Loading…
Cancel
Save