Commit 01747c1d authored by echel0n's avatar echel0n

Merge branch 'release/9.4.20'

parents 19163a56 6b3ab522
# Changelog
- * ba3c129 - 2018-11-06: Release v9.4.19
- * 4edab50 - 2018-11-07: Release v9.4.20
- * d5adb49 - 2018-11-07: Fixed Torrent9 provider search issues.
- * dfa2238 - 2018-11-07: Removed backlog cycle time
- * e7526ee - 2018-11-06: Release v9.4.19
- * d394cb1 - 2018-11-06: Fixed issues with saving provider settings. Added property "in_library" to parsed results to identify search results to library shows.
- * 6d5e91c - 2018-11-06: Release v9.4.18
- * aba32ea - 2018-11-06: Fixed issues with searching TorrentDay provider
......
......@@ -58,7 +58,6 @@ from sickrage.core.processors.auto_postprocessor import AutoPostProcessor
from sickrage.core.queues.postprocessor import PostProcessorQueue
from sickrage.core.queues.search import SearchQueue
from sickrage.core.queues.show import ShowQueue
from sickrage.core.searchers import get_backlog_cycle_time
from sickrage.core.searchers.backlog_searcher import BacklogSearcher
from sickrage.core.searchers.daily_searcher import DailySearcher
from sickrage.core.searchers.failed_snatch_searcher import FailedSnatchSearcher
......@@ -325,7 +324,6 @@ class Core(object):
self.config.autopostprocessor_freq = self.config.min_autopostprocessor_freq
if self.config.daily_searcher_freq < self.config.min_daily_searcher_freq:
self.config.daily_searcher_freq = self.config.min_daily_searcher_freq
self.config.min_backlog_searcher_freq = get_backlog_cycle_time()
if self.config.backlog_searcher_freq < self.config.min_backlog_searcher_freq:
self.config.backlog_searcher_freq = self.config.min_backlog_searcher_freq
if self.config.version_updater_freq < self.config.min_version_updater_freq:
......
......@@ -39,7 +39,6 @@ import sickrage
from sickrage.core.common import SD, WANTED, SKIPPED, Quality
from sickrage.core.helpers import makeDir, generate_secret, auto_type, get_lan_ip, \
extract_zipfile, try_int, checkbox_to_value, generateApiKey, backupVersionedFile
from sickrage.core.searchers import get_backlog_cycle_time
from sickrage.core.websession import WebSession
......@@ -1182,7 +1181,6 @@ class Config(object):
:param freq: New frequency
"""
self.backlog_searcher_freq = try_int(freq, self.defaults['General']['backlog_frequency'])
self.min_backlog_searcher_freq = get_backlog_cycle_time()
if self.backlog_searcher_freq < self.min_backlog_searcher_freq:
self.backlog_searcher_freq = self.min_backlog_searcher_freq
......
......@@ -72,7 +72,4 @@ def new_episode_finder():
special='(specials are not supported)' if not ep_obj.season else '',
))
ep_obj.saveToDB()
def get_backlog_cycle_time():
return max([sickrage.app.config.daily_searcher_freq * 4, 30])
\ No newline at end of file
ep_obj.saveToDB()
\ No newline at end of file
......@@ -31,11 +31,12 @@ from sickrage.providers import TorrentProvider
class Torrent9Provider(TorrentProvider):
def __init__(self):
super(Torrent9Provider, self).__init__('Torrent9', 'https://ww2.torrent9.blue', False)
super(Torrent9Provider, self).__init__('Torrent9', 'ww1.torrent9.ph', False)
self.urls.update({
'search': '{base_url}/search_torrent/'.format(**self.urls),
'rss': '{base_url}/torrents_series.html,trie-date-d'.format(**self.urls)
'rss': '{base_url}/torrents_series.html,trie-date-d'.format(**self.urls),
'download': '{base_url}get_torrent/%s.torrent'.format(**self.urls)
})
self.minseed = None
......@@ -45,7 +46,7 @@ class Torrent9Provider(TorrentProvider):
self.proper_strings = ['PROPER', 'REPACK']
self.cache = TVCache(self)
self.cache = TVCache(self, min_time=20)
def search(self, search_strings, age=0, ep_obj=None, **kwargs): # pylint: disable=too-many-locals
results = []
......@@ -57,19 +58,15 @@ class Torrent9Provider(TorrentProvider):
search_string = re.sub(r'(.*)S0?', r'\1Saison ', search_string)
if mode != 'RSS':
sickrage.app.log.debug("Search string: {0}".format
(search_string))
search_string = search_string.replace('.', '-').replace(' ', '-')
search_url = urljoin(self.urls['search'],
"{search_string}.html".format(search_string=search_string))
sickrage.app.log.debug("Search string: {}".format(search_string))
search_query = re.sub(r'\W', '-', search_string)
search_url = urljoin(self.urls['search'], "{search_query}.html".format(search_query=search_query))
else:
search_url = self.urls['rss']
if self.custom_url:
if not validate_url(self.custom_url):
sickrage.app.log.warning("Invalid custom url: {0}".format(self.custom_url))
sickrage.app.log.warning("Invalid custom url: {}".format(self.custom_url))
return results
search_url = urljoin(self.custom_url, search_url.split(self.urls['base_url'])[1])
......@@ -92,20 +89,20 @@ class Torrent9Provider(TorrentProvider):
results = []
with bs4_parser(data) as html:
table_header = html.find('thead')
if not table_header:
table_body = html.find('tbody')
# Continue only if at least one release is found
if not table_body:
sickrage.app.log.debug('Data returned from provider does not contain any torrents')
return results
# Nom du torrent, Taille, Seed, Leech
labels = [label.get_text() for label in table_header('th')]
table_body = html.find('tbody')
for row in table_body('tr'):
cells = row('td')
if len(cells) < 4:
continue
try:
info_cell = cells[labels.index('Nom du torrent')].a
info_cell = cells[0].a
title = info_cell.get_text()
download_url = info_cell.get('href')
if not all([title, download_url]):
......@@ -113,20 +110,27 @@ class Torrent9Provider(TorrentProvider):
title = '{name} {codec}'.format(name=title, codec='x264')
download_link = download_url.replace('/torrent', 'get_torrent')
download_url = self.urls['download'].format(link=download_link)
download_name = download_url.rsplit('/', 1)[1]
download_url = self.urls['download'] % download_name
if self.custom_url:
if not validate_url(self.custom_url):
sickrage.app.log.warning("Invalid custom url: {}".format(self.custom_url))
return results
download_url = urljoin(self.custom_url, download_url.split(self.urls['base_url'])[1])
seeders = try_int(cells[labels.index('Seed')].get_text(strip=True))
leechers = try_int(cells[labels.index('Leech')].get_text(strip=True))
seeders = try_int(cells[2].get_text(strip=True))
leechers = try_int(cells[3].get_text(strip=True))
torrent_size = cells[labels.index('Taille')].get_text()
size = convert_size(torrent_size, -1, ['o', 'Ko', 'Mo', 'Go', 'To', 'Po'])
torrent_size = cells[1].get_text()
size = convert_size(torrent_size, -1, ['O', 'KO', 'MO', 'GO', 'TO', 'PO'])
results += [
{'title': title, 'link': download_url, 'size': size, 'seeders': seeders, 'leechers': leechers}
]
results += [{
'title': title,
'link': download_url,
'size': size,
'seeders': seeders,
'leechers': leechers
}]
if mode != 'RSS':
sickrage.app.log.debug("Found result: {}".format(title))
......
9.4.19
\ No newline at end of file
9.4.20
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment