Private GIT

Skip to content
Snippets Groups Projects
Commit 207bd7ac authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Merge branch 'develop'

parents 2d515e9a de2c451e
Branches
Tags
No related merge requests found
......@@ -7,12 +7,7 @@ branches:
only:
- develop
install:
- pip install cheetah pyopenssl==0.13.1
cache:
directories:
- $HOME/.cache/pip
cache: pip
before_script:
- chmod +x ./tests/all_tests.py
......
cheetah
pyopenssl==0.13.1
......@@ -49,7 +49,7 @@ import subprocess
from sickbeard.exceptions import MultipleShowObjectsException, ex
from sickbeard import logger, classes
from sickbeard.common import USER_AGENT, mediaExtensions, subtitleExtensions
from sickbeard.common import USER_AGENT, cpu_presets, mediaExtensions, subtitleExtensions
from sickbeard import db
from sickbeard import encodingKludge as ek
from sickbeard import notifiers
......@@ -708,7 +708,7 @@ def sanitizeSceneName(name, anime=False):
"""
if not name:
return u''
return ''
bad_chars = u',:()!?\u2019'
if not anime:
......@@ -716,7 +716,7 @@ def sanitizeSceneName(name, anime=False):
# strip out any bad chars
for x in bad_chars:
name = u'' + name.replace(x, "")
name = name.replace(x, "")
# tidy up stuff that doesn't belong in scene names
name = name.replace("- ", ".").replace(" ", ".").replace("&", "and").replace('/', '.')
......
......@@ -201,7 +201,11 @@ def makeTorrentRssProvider(configString):
def getDefaultNewznabProviders():
return 'Sick Beard Index|http://lolo.sickbeard.com/|0|5030,5040|0|eponly|0|0|0!!!NZBs.org|https://nzbs.org/||5030,5040|0|eponly|0|0|0!!!Usenet-Crawler|https://www.usenet-crawler.com/||5030,5040|0|eponly|0|0|0'
#name|url|key|catIDs|enabled|search_mode|search_fallback|enable_daily|enable_backlog
return 'NZB.Cat|https://nzb.cat/||5030,5040,5010,5060|0|eponly|1|1|1!!!' + \
'Sick Beard Index|http://lolo.sickbeard.com/|0|5030,5040|0|eponly|0|0|0!!!' + \
'NZBs.org|https://nzbs.org/||5030,5040|0|eponly|0|0|0!!!' + \
'Usenet-Crawler|https://www.usenet-crawler.com/||5030,5040|0|eponly|0|0|0'
def getProviderModule(name):
......
......@@ -65,7 +65,7 @@ class RarbgProvider(generic.TorrentProvider):
self.tokenExpireDate = None
self.urls = {'url': u'https://rarbg.com',
'token': u'https://torrentapi.org/pubapi_v2.php?get_token=get_token&format=json&app_id=sickrage',
'token': u'http://torrentapi.org/pubapi_v2.php?get_token=get_token&format=json&app_id=sickrage',
'listing': u'https://torrentapi.org/pubapi_v2.php?mode=list&app_id=sickrage',
'search': u'https://torrentapi.org/pubapi_v2.php?mode=search&app_id=sickrage&search_string={search_string}',
'search_tvdb': u'https://torrentapi.org/pubapi_v2.php?mode=search&app_id=sickrage&search_tvdb={tvdb}&search_string={search_string}',
......
......@@ -20,6 +20,8 @@
import re
import traceback
import datetime
import time
import urlparse
import sickbeard
import generic
......@@ -147,7 +149,10 @@ class SCCProvider(generic.TorrentProvider):
for show_name in set(show_name_helpers.allPossibleShowNames(self.show)):
ep_string = show_name_helpers.sanitizeSceneName(show_name) + ' ' + \
sickbeard.config.naming_ep_type[2] % {'seasonnumber': ep_obj.scene_season,
'episodenumber': ep_obj.scene_episode} + ' %s' % add_string
'episodenumber': ep_obj.scene_episode}
if len(add_string):
ep_string += ' %s' % add_string
search_string['Episode'].append(re.sub('\s+', ' ', ep_string))
......@@ -188,6 +193,7 @@ class SCCProvider(generic.TorrentProvider):
logger.log(u"Search string: " + searchURL, logger.DEBUG)
try:
data += [x for x in [self.getURL(searchURL)] if x]
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
except Exception as e:
logger.log(u"Unable to fetch data reason: {0}".format(str(e)), logger.WARNING)
......
......@@ -199,10 +199,6 @@ def pickBestResult(results, show):
if show and cur_result.show is not show:
continue
if not cur_result.url.startswith('magnet'):
cur_result.content = cur_result.provider.getURL(cur_result.url)
if not cur_result.content:
continue
# build the black And white list
if show.is_anime:
......@@ -238,6 +234,14 @@ def pickBestResult(results, show):
logger.log(cur_result.name + u" has previously failed, rejecting it")
continue
# Download the torrent file contents only if it has passed all other checks!
# Must be done before setting bestResult
if cur_result.resultType == "torrent" and sickbeard.TORRENT_METHOD != "blackhole":
if len(cur_result.url) and not cur_result.url.startswith('magnet'):
cur_result.content = cur_result.provider.getURL(cur_result.url)
if not cur_result.content:
continue
if cur_result.quality in bestQualities and (not bestResult or bestResult.quality < cur_result.quality or bestResult not in bestQualities):
bestResult = cur_result
elif cur_result.quality in anyQualities and (not bestResult or bestResult not in bestQualities) and (not bestResult or bestResult.quality < cur_result.quality):
......@@ -652,6 +656,7 @@ def searchProviders(show, episodes, manualSearch=False, downCurQuality=False):
for epObj in multiResult.episodes:
if not multiResult.url.startswith('magnet'):
multiResult.content = multiResult.provider.getURL(cur_result.url)
multiResults[epObj.episode] = multiResult
# don't bother with the single result if we're going to get it with a multi result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment