Fix Scenetime torrent provider.

Change disable search torrents on first installation.
Change some UI text.
This commit is contained in:
JackDandy 2018-07-05 14:42:40 +01:00
parent c05e75a8ec
commit 5939dc2154
6 changed files with 28 additions and 27 deletions

View file

@ -1,4 +1,10 @@
### 0.16.17 (2018-07-01 01:00:00 UTC)
### 0.16.18 (2018-07-05 14:45:00 UTC)
* Fix Scenetime torrent provider
* Change disable search torrents on first installation
### 0.16.17 (2018-07-01 01:00:00 UTC)
* Update UnRar for Windows 5.50 to 5.60
* Fix API save show paused state and API exception raised when no indexer results

View file

@ -51,7 +51,7 @@
<div class="field-pair">
<label for="tv_download_dir">
<span class="component-title">Completed TV downloads
<p class="red-text" style="line-height:20px;margin:0"><em class="boldest">must not</em> be the folder where downloading files are created</p>
<p class="red-text" style="line-height:20px;margin:0"><em class="boldest">must not</em> be where files are downloading in progress</p>
</span>
<span class="component-desc">
<input type="text" name="tv_download_dir" id="tv_download_dir" value="$sickbeard.TV_DOWNLOAD_DIR" class="form-control input-sm input350">

View file

@ -127,7 +127,8 @@
#end for
</ul>
<input type="hidden" name="provider_order" id="provider_order" value="<%=' '.join([x.get_id()+':'+str(int(x.is_enabled())) for x in sickbeard.providers.sortedProviderList()])%>"/>
#if $sickbeard.USE_NZBS or $sickbeard.USE_TORRENTS
<div id="provider_key">
<span style="float:left;font-size:10px;vertical-align:top;font-weight:normal">(PA)</span><p class="note">Public access, no account required</p>
## #if $sickbeard.USE_TORRENTS
@ -136,12 +137,12 @@
##<h4 class="note">!</h4><p class="note">Provider is <b>NOT WORKING</b></p>
</div>
<input type="hidden" name="provider_order" id="provider_order" value="<%=' '.join([x.get_id()+':'+str(int(x.is_enabled())) for x in sickbeard.providers.sortedProviderList()])%>"/>
<div style="width: 300px; float: right">
<div style="margin: 0px auto; width: 101px">
<input type="submit" class="btn config_submitter" value="Save Changes" />
</div>
</div>
#end if
</fieldset>
</div><!-- /component-group1 //-->

View file

@ -450,6 +450,7 @@
</select>
</span>
</label>
</div>
<div id="options-torrent-blackhole">
<div class="field-pair">
@ -572,7 +573,7 @@
<div class="test-notification" id="test-torrent-result">Click below to test</div>
<input type="button" value="Test Connection" id="test_torrent" class="btn test-button">
<input type="submit" class="btn config_submitter" value="Save Changes"><br />
</div>
</div>
</div><!-- /content_use_torrents //-->
</fieldset>
</div><!-- /component-group3 //-->

View file

@ -849,7 +849,7 @@ def initialize(console_logging=True):
NAMING_STRIP_YEAR = bool(check_setting_int(CFG, 'General', 'naming_strip_year', 0))
USE_NZBS = bool(check_setting_int(CFG, 'General', 'use_nzbs', 0))
USE_TORRENTS = bool(check_setting_int(CFG, 'General', 'use_torrents', 1))
USE_TORRENTS = bool(check_setting_int(CFG, 'General', 'use_torrents', 0))
NZB_METHOD = check_setting_str(CFG, 'General', 'nzb_method', 'blackhole')
if NZB_METHOD not in ('blackhole', 'sabnzbd', 'nzbget'):

View file

@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
import ast
import re
import traceback
@ -33,11 +32,13 @@ class SceneTimeProvider(generic.TorrentProvider):
self.url_home = ['https://%s.scenetime.com/' % u for u in 'www', 'uk']
self.url_vars = {'login': 'support.php', 'browse': 'browse_API.php', 'get': 'download.php/%s.torrent'}
self.url_vars = {'login': 'support.php', 'search': 'browse.php?cata=yes&%s&search=%s%s',
'get': 'download.php/%s.torrent'}
self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login': '%(home)s%(vars)s',
'browse': '%(home)s%(vars)s', 'get': '%(home)s%(vars)s'}
'search': '%(home)s%(vars)s', 'get': '%(home)s%(vars)s'}
self.categories = {'shows': [2, 43, 9, 63, 77, 79, 83]}
self.categories = {'Season': [43], 'Episode': [2, 9, 63, 77, 79, 100, 83, 19], 'anime': [18]}
self.categories['Cache'] = self.categories['Season'] + self.categories['Episode']
self.digest, self.freeleech, self.minseed, self.minleech = 4 * [None]
@ -61,25 +62,18 @@ class SceneTimeProvider(generic.TorrentProvider):
items = {'Cache': [], 'Season': [], 'Episode': [], 'Propers': []}
rc = dict((k, re.compile('(?i)' + v)) for (k, v) in {
'info': 'detail', 'get': '.*id=(\d+).*', 'fl': '\[freeleech\]',
'cats': 'cat=(?:%s)' % self._categories_string(template='', delimiter='|')}.items())
for mode in search_params.keys():
rc = dict((k, re.compile('(?i)' + v)) for (k, v) in {
'info': 'detail', 'get': '.*id=(\d+).*', 'fl': '\[freeleech\]',
'cats': 'cat=(?:%s)' % self._categories_string(mode=mode, template='', delimiter='|')}.items())
for search_string in search_params[mode]:
search_string = isinstance(search_string, unicode) and unidecode(search_string) or search_string
post_data = {'sec': 'jax', 'cata': 'yes'}
post_data.update(ast.literal_eval(
'{%s}' % self._categories_string(template='"c%s": "1"', delimiter=',')))
if 'Cache' != mode:
search_string = '+'.join(search_string.split())
post_data['search'] = search_string
if self.freeleech:
post_data.update({'freeleech': 'on'})
self.session.headers.update({'Referer': self.url + 'browse.php', 'X-Requested-With': 'XMLHttpRequest'})
html = self.get_url(self.urls['browse'], post_data=post_data)
search_url = self.urls['search'] % (self._categories_string(),
'+'.join(search_string.replace('.', ' ').split()),
('', '&freeleech=on')[self.freeleech])
html = self.get_url(search_url)
if self.should_skip():
return results
@ -124,8 +118,7 @@ class SceneTimeProvider(generic.TorrentProvider):
except (StandardError, Exception):
logger.log(u'Failed to parse. Traceback: %s' % traceback.format_exc(), logger.ERROR)
self._log_search(mode, len(items[mode]) - cnt,
('search string: ' + search_string, self.name)['Cache' == mode])
self._log_search(mode, len(items[mode]) - cnt, search_url)
results = self._sort_seeding(mode, results + items[mode])