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
- * 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
- * 6a14546 - 2017-11-12: Added code to connect app to SiCKRAGE API securely
- * 6c16a6e - 2017-11-12: Refactored LimeTorrents search provider
......
......@@ -161,6 +161,8 @@ class DailySearchQueueItem(srQueueItem):
# give the CPU a break
time.sleep(cpu_presets[sickrage.app.config.cpu_preset])
else:
sickrage.app.log.info("No needed episodes found")
except Exception:
sickrage.app.log.debug(traceback.format_exc())
finally:
......@@ -237,6 +239,9 @@ class BacklogQueueItem(srQueueItem):
# give the CPU a break
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:
sickrage.app.log.debug(traceback.format_exc())
finally:
......
......@@ -424,6 +424,10 @@ def wantedEpisodes(show, fromDate):
"""
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)
allQualities = list(set(anyQualities + bestQualities))
......
......@@ -52,7 +52,7 @@ class DailySearcher(object):
if sickrage.app.config.use_failed_downloads:
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.timedelta(days=2)
......@@ -68,6 +68,7 @@ class DailySearcher(object):
and x['doc']['season'] > 0
and curDate.toordinal() >= x['doc']['airdate'] > 1]
new_episodes = False
for episode in episodes:
if not show or int(episode["showid"]) != show.indexerid:
show = findCertainShow(sickrage.app.showlist, int(episode["showid"]))
......@@ -97,8 +98,10 @@ class DailySearcher(object):
))
ep_obj.saveToDB()
else:
sickrage.app.log.info("{}: No new released episodes found".format(self.name))
new_episodes = True
if not new_episodes:
sickrage.app.log.info("No new released episodes found")
# queue episode for daily search
sickrage.app.search_queue.put(DailySearchQueueItem())
......
......@@ -240,6 +240,9 @@ class LoginHandler(BaseHandler):
self.finish(self.auth())
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))
username = self.get_argument('username', '')
......
......@@ -411,6 +411,16 @@
% endif
</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:
<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">
......
......@@ -27,7 +27,6 @@ import jsonrpclib
import sickrage
from sickrage.core.caches.tv_cache import TVCache
from sickrage.core.common import cpu_presets
from sickrage.core.helpers import sanitizeSceneName
from sickrage.core.scene_exceptions import get_scene_exceptions
from sickrage.providers import TorrentProvider
......@@ -120,7 +119,7 @@ class BTNProvider(TorrentProvider):
try:
api = jsonrpclib.Server('http://' + self.urls['base_url'])
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:
if e.message[1] == 'Call Limit Exceeded':
sickrage.app.log.warning("You have exceeded the limit of 150 calls per hour.")
......
......@@ -30,7 +30,7 @@ from sickrage.providers import TorrentProvider
class EliteTorrentProvider(TorrentProvider):
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({
'search': '{base_url}/torrents.php'.format(**self.urls)
......@@ -100,6 +100,8 @@ class EliteTorrentProvider(TorrentProvider):
results = []
def _process_title(title):
title = title.encode('latin-1').decode('utf8')
# Quality, if no literal is defined it's HDTV
if 'calidad' not in title:
title += ' HDTV x264'
......
......@@ -170,8 +170,11 @@ class NewpctProvider(TorrentProvider):
return results
def _process_title(self, title, url):
# Strip unwanted characters
title = title.strip()
# Convert to unicode and strip unwanted characters
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
title = re.sub(r'\[HDTV.1080[p][^\[]*]', '1080p HDTV x264', title, flags=re.IGNORECASE)
......@@ -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)
# Group
if re.search(r'\[V.O.[^\[]*]', title, flags=re.I):
if subtitles:
title += '-NEWPCTVO'
else:
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