Commit 2163b570 authored by echel0n's avatar echel0n
Browse files

Fixed subtitle tagging for Newpct provider

Fixed unicode title issues for Newpct provider
Fixed unicode title issues for EliteTorrent provider
Set EliteTorrent provider to public
Added alert box to top of page notifying when developer mode is enabled
parent 1f0c9815
# Changelog # Changelog
- * d64f4e2 - 2017-11-14: Release v9.1.76 - * 0f56be1 - 2017-11-14: Fixed subtitle tagging for Newpct provider Fixed unicode title issues for Newpct provider Fixed unicode title issues for EliteTorrent provider Set EliteTorrent provider to public Added alert box to top of page notifying when developer mode is enabled
- * 2425b4c - 2017-11-14: Release v9.1.76
- * f1a6e69 - 2017-11-13: Release v9.1.74 - * f1a6e69 - 2017-11-13: Release v9.1.74
- * 6a14546 - 2017-11-12: Added code to connect app to SiCKRAGE API securely - * 6a14546 - 2017-11-12: Added code to connect app to SiCKRAGE API securely
- * 6c16a6e - 2017-11-12: Refactored LimeTorrents search provider - * 6c16a6e - 2017-11-12: Refactored LimeTorrents search provider
......
...@@ -110,7 +110,7 @@ class SearchQueue(srQueue): ...@@ -110,7 +110,7 @@ class SearchQueue(srQueue):
def queue_length(self): def queue_length(self):
length = {'backlog': 0, 'daily': 0, 'manual': 0, 'failed': 0} length = {'backlog': 0, 'daily': 0, 'manual': 0, 'failed': 0}
for __, __, cur_item in self.queue + [(None, None, self.currentItem)]: for __, __, cur_item in self.queue + [(None, None, self.currentItem)]:
if isinstance(cur_item, DailySearchQueueItem): if isinstance(cur_item, DailySearchQueueItem):
length['daily'] += 1 length['daily'] += 1
elif isinstance(cur_item, BacklogQueueItem): elif isinstance(cur_item, BacklogQueueItem):
...@@ -161,6 +161,8 @@ class DailySearchQueueItem(srQueueItem): ...@@ -161,6 +161,8 @@ class DailySearchQueueItem(srQueueItem):
# give the CPU a break # give the CPU a break
time.sleep(cpu_presets[sickrage.app.config.cpu_preset]) time.sleep(cpu_presets[sickrage.app.config.cpu_preset])
else:
sickrage.app.log.info("No needed episodes found")
except Exception: except Exception:
sickrage.app.log.debug(traceback.format_exc()) sickrage.app.log.debug(traceback.format_exc())
finally: finally:
...@@ -237,6 +239,9 @@ class BacklogQueueItem(srQueueItem): ...@@ -237,6 +239,9 @@ class BacklogQueueItem(srQueueItem):
# give the CPU a break # give the CPU a break
time.sleep(cpu_presets[sickrage.app.config.cpu_preset]) time.sleep(cpu_presets[sickrage.app.config.cpu_preset])
else:
sickrage.app.log.info(
"No needed episodes found during backlog search for: [" + self.show.name + "]")
except Exception: except Exception:
sickrage.app.log.debug(traceback.format_exc()) sickrage.app.log.debug(traceback.format_exc())
finally: finally:
......
...@@ -424,6 +424,10 @@ def wantedEpisodes(show, fromDate): ...@@ -424,6 +424,10 @@ def wantedEpisodes(show, fromDate):
""" """
wanted = [] wanted = []
if show.paused:
sickrage.app.log.debug("Not checking for episodes of {} because the show is paused".format(show.name))
return wanted
anyQualities, bestQualities = Quality.splitQuality(show.quality) anyQualities, bestQualities = Quality.splitQuality(show.quality)
allQualities = list(set(anyQualities + bestQualities)) allQualities = list(set(anyQualities + bestQualities))
......
...@@ -52,7 +52,7 @@ class DailySearcher(object): ...@@ -52,7 +52,7 @@ class DailySearcher(object):
if sickrage.app.config.use_failed_downloads: if sickrage.app.config.use_failed_downloads:
FailedHistory.trimHistory() FailedHistory.trimHistory()
sickrage.app.log.info("{}: Searching for new released episodes".format(self.name)) sickrage.app.log.info("Searching for new released episodes")
curDate = datetime.date.today() curDate = datetime.date.today()
curDate += datetime.timedelta(days=2) curDate += datetime.timedelta(days=2)
...@@ -68,6 +68,7 @@ class DailySearcher(object): ...@@ -68,6 +68,7 @@ class DailySearcher(object):
and x['doc']['season'] > 0 and x['doc']['season'] > 0
and curDate.toordinal() >= x['doc']['airdate'] > 1] and curDate.toordinal() >= x['doc']['airdate'] > 1]
new_episodes = False
for episode in episodes: for episode in episodes:
if not show or int(episode["showid"]) != show.indexerid: if not show or int(episode["showid"]) != show.indexerid:
show = findCertainShow(sickrage.app.showlist, int(episode["showid"])) show = findCertainShow(sickrage.app.showlist, int(episode["showid"]))
...@@ -97,8 +98,10 @@ class DailySearcher(object): ...@@ -97,8 +98,10 @@ class DailySearcher(object):
)) ))
ep_obj.saveToDB() ep_obj.saveToDB()
else: new_episodes = True
sickrage.app.log.info("{}: No new released episodes found".format(self.name))
if not new_episodes:
sickrage.app.log.info("No new released episodes found")
# queue episode for daily search # queue episode for daily search
sickrage.app.search_queue.put(DailySearchQueueItem()) sickrage.app.search_queue.put(DailySearchQueueItem())
......
...@@ -240,6 +240,9 @@ class LoginHandler(BaseHandler): ...@@ -240,6 +240,9 @@ class LoginHandler(BaseHandler):
self.finish(self.auth()) self.finish(self.auth())
def auth(self): def auth(self):
if sickrage.app.config.developer:
self.set_secure_cookie('user', json_encode(sickrage.app.config.api_key))
if self.get_current_user(): return self.redirect("/{}/".format(sickrage.app.config.default_page)) if self.get_current_user(): return self.redirect("/{}/".format(sickrage.app.config.default_page))
username = self.get_argument('username', '') username = self.get_argument('username', '')
......
...@@ -411,6 +411,16 @@ ...@@ -411,6 +411,16 @@
% endif % endif
</div> </div>
% if current_user and sickrage.app.config.developer:
<div class="row">
<div class="col-lg-10 col-lg-offset-1 col-md-10 col-md-offset-1 col-sm-12 col-xs-12">
<div class="alert alert-danger upgrade-notification text-center">
<span>!!! SiCKRAGE is in <b>developer</b> mode !!!</span>
</div>
</div>
</div>
% endif
% if current_user and sickrage.app.newest_version_string: % if current_user and sickrage.app.newest_version_string:
<div class="row"> <div class="row">
<div class="col-lg-10 col-lg-offset-1 col-md-10 col-md-offset-1 col-sm-12 col-xs-12"> <div class="col-lg-10 col-lg-offset-1 col-md-10 col-md-offset-1 col-sm-12 col-xs-12">
......
...@@ -27,7 +27,6 @@ import jsonrpclib ...@@ -27,7 +27,6 @@ import jsonrpclib
import sickrage import sickrage
from sickrage.core.caches.tv_cache import TVCache from sickrage.core.caches.tv_cache import TVCache
from sickrage.core.common import cpu_presets
from sickrage.core.helpers import sanitizeSceneName from sickrage.core.helpers import sanitizeSceneName
from sickrage.core.scene_exceptions import get_scene_exceptions from sickrage.core.scene_exceptions import get_scene_exceptions
from sickrage.providers import TorrentProvider from sickrage.providers import TorrentProvider
...@@ -120,7 +119,7 @@ class BTNProvider(TorrentProvider): ...@@ -120,7 +119,7 @@ class BTNProvider(TorrentProvider):
try: try:
api = jsonrpclib.Server('http://' + self.urls['base_url']) api = jsonrpclib.Server('http://' + self.urls['base_url'])
parsedJSON = api.getTorrents(apikey, params or {}, int(results_per_page), int(offset)) parsedJSON = api.getTorrents(apikey, params or {}, int(results_per_page), int(offset))
time.sleep(cpu_presets[sickrage.app.config.cpu_preset]) time.sleep(5)
except jsonrpclib.jsonrpc.ProtocolError as e: except jsonrpclib.jsonrpc.ProtocolError as e:
if e.message[1] == 'Call Limit Exceeded': if e.message[1] == 'Call Limit Exceeded':
sickrage.app.log.warning("You have exceeded the limit of 150 calls per hour.") sickrage.app.log.warning("You have exceeded the limit of 150 calls per hour.")
......
...@@ -30,7 +30,7 @@ from sickrage.providers import TorrentProvider ...@@ -30,7 +30,7 @@ from sickrage.providers import TorrentProvider
class EliteTorrentProvider(TorrentProvider): class EliteTorrentProvider(TorrentProvider):
def __init__(self): def __init__(self):
super(EliteTorrentProvider, self).__init__('EliteTorrent', 'http://www.elitetorrent.eu', True) super(EliteTorrentProvider, self).__init__('EliteTorrent', 'https://www.elitetorrent.eu', False)
self.urls.update({ self.urls.update({
'search': '{base_url}/torrents.php'.format(**self.urls) 'search': '{base_url}/torrents.php'.format(**self.urls)
...@@ -100,6 +100,8 @@ class EliteTorrentProvider(TorrentProvider): ...@@ -100,6 +100,8 @@ class EliteTorrentProvider(TorrentProvider):
results = [] results = []
def _process_title(title): def _process_title(title):
title = title.encode('latin-1').decode('utf8')
# Quality, if no literal is defined it's HDTV # Quality, if no literal is defined it's HDTV
if 'calidad' not in title: if 'calidad' not in title:
title += ' HDTV x264' title += ' HDTV x264'
......
...@@ -170,8 +170,11 @@ class NewpctProvider(TorrentProvider): ...@@ -170,8 +170,11 @@ class NewpctProvider(TorrentProvider):
return results return results
def _process_title(self, title, url): def _process_title(self, title, url):
# Strip unwanted characters # Convert to unicode and strip unwanted characters
title = title.strip() title = title.encode('latin-1').decode('utf8').strip()
# Check if subtitled
subtitles = re.search(r'\[V.O.[^\[]*]', title, flags=re.I)
# Quality - Use re module to avoid case sensitive problems with replace # Quality - Use re module to avoid case sensitive problems with replace
title = re.sub(r'\[HDTV.1080[p][^\[]*]', '1080p HDTV x264', title, flags=re.IGNORECASE) title = re.sub(r'\[HDTV.1080[p][^\[]*]', '1080p HDTV x264', title, flags=re.IGNORECASE)
...@@ -217,7 +220,7 @@ class NewpctProvider(TorrentProvider): ...@@ -217,7 +220,7 @@ class NewpctProvider(TorrentProvider):
title = re.sub(r'(\[Cap.(\d{1,2})(\d{2})[^\[]*]).*', r'\1 SPANISH AUDIO', title, flags=re.IGNORECASE) title = re.sub(r'(\[Cap.(\d{1,2})(\d{2})[^\[]*]).*', r'\1 SPANISH AUDIO', title, flags=re.IGNORECASE)
# Group # Group
if re.search(r'\[V.O.[^\[]*]', title, flags=re.I): if subtitles:
title += '-NEWPCTVO' title += '-NEWPCTVO'
else: else:
title += '-NEWPCT' title += '-NEWPCT'
......
Supports Markdown
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