mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-11 21:53:37 +00:00
Fix Scenetime torrent provider.
Change disable search torrents on first installation. Change some UI text.
This commit is contained in:
parent
c05e75a8ec
commit
5939dc2154
6 changed files with 28 additions and 27 deletions
|
@ -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
|
* Update UnRar for Windows 5.50 to 5.60
|
||||||
* Fix API save show paused state and API exception raised when no indexer results
|
* Fix API save show paused state and API exception raised when no indexer results
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
<div class="field-pair">
|
<div class="field-pair">
|
||||||
<label for="tv_download_dir">
|
<label for="tv_download_dir">
|
||||||
<span class="component-title">Completed TV downloads
|
<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>
|
||||||
<span class="component-desc">
|
<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">
|
<input type="text" name="tv_download_dir" id="tv_download_dir" value="$sickbeard.TV_DOWNLOAD_DIR" class="form-control input-sm input350">
|
||||||
|
|
|
@ -127,7 +127,8 @@
|
||||||
#end for
|
#end for
|
||||||
</ul>
|
</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">
|
<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>
|
<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
|
## #if $sickbeard.USE_TORRENTS
|
||||||
|
@ -136,12 +137,12 @@
|
||||||
##<h4 class="note">!</h4><p class="note">Provider is <b>NOT WORKING</b></p>
|
##<h4 class="note">!</h4><p class="note">Provider is <b>NOT WORKING</b></p>
|
||||||
</div>
|
</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="width: 300px; float: right">
|
||||||
<div style="margin: 0px auto; width: 101px">
|
<div style="margin: 0px auto; width: 101px">
|
||||||
<input type="submit" class="btn config_submitter" value="Save Changes" />
|
<input type="submit" class="btn config_submitter" value="Save Changes" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
#end if
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
</div><!-- /component-group1 //-->
|
</div><!-- /component-group1 //-->
|
||||||
|
|
|
@ -450,6 +450,7 @@
|
||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="options-torrent-blackhole">
|
<div id="options-torrent-blackhole">
|
||||||
<div class="field-pair">
|
<div class="field-pair">
|
||||||
|
|
|
@ -849,7 +849,7 @@ def initialize(console_logging=True):
|
||||||
NAMING_STRIP_YEAR = bool(check_setting_int(CFG, 'General', 'naming_strip_year', 0))
|
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_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')
|
NZB_METHOD = check_setting_str(CFG, 'General', 'nzb_method', 'blackhole')
|
||||||
if NZB_METHOD not in ('blackhole', 'sabnzbd', 'nzbget'):
|
if NZB_METHOD not in ('blackhole', 'sabnzbd', 'nzbget'):
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
|
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import ast
|
|
||||||
import re
|
import re
|
||||||
import traceback
|
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_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',
|
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]
|
self.digest, self.freeleech, self.minseed, self.minleech = 4 * [None]
|
||||||
|
|
||||||
|
@ -61,25 +62,18 @@ class SceneTimeProvider(generic.TorrentProvider):
|
||||||
|
|
||||||
items = {'Cache': [], 'Season': [], 'Episode': [], 'Propers': []}
|
items = {'Cache': [], 'Season': [], 'Episode': [], 'Propers': []}
|
||||||
|
|
||||||
|
for mode in search_params.keys():
|
||||||
rc = dict((k, re.compile('(?i)' + v)) for (k, v) in {
|
rc = dict((k, re.compile('(?i)' + v)) for (k, v) in {
|
||||||
'info': 'detail', 'get': '.*id=(\d+).*', 'fl': '\[freeleech\]',
|
'info': 'detail', 'get': '.*id=(\d+).*', 'fl': '\[freeleech\]',
|
||||||
'cats': 'cat=(?:%s)' % self._categories_string(template='', delimiter='|')}.items())
|
'cats': 'cat=(?:%s)' % self._categories_string(mode=mode, template='', delimiter='|')}.items())
|
||||||
for mode in search_params.keys():
|
|
||||||
for search_string in search_params[mode]:
|
for search_string in search_params[mode]:
|
||||||
search_string = isinstance(search_string, unicode) and unidecode(search_string) or search_string
|
search_string = isinstance(search_string, unicode) and unidecode(search_string) or search_string
|
||||||
|
|
||||||
post_data = {'sec': 'jax', 'cata': 'yes'}
|
search_url = self.urls['search'] % (self._categories_string(),
|
||||||
post_data.update(ast.literal_eval(
|
'+'.join(search_string.replace('.', ' ').split()),
|
||||||
'{%s}' % self._categories_string(template='"c%s": "1"', delimiter=',')))
|
('', '&freeleech=on')[self.freeleech])
|
||||||
if 'Cache' != mode:
|
html = self.get_url(search_url)
|
||||||
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)
|
|
||||||
if self.should_skip():
|
if self.should_skip():
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
@ -124,8 +118,7 @@ class SceneTimeProvider(generic.TorrentProvider):
|
||||||
except (StandardError, Exception):
|
except (StandardError, Exception):
|
||||||
logger.log(u'Failed to parse. Traceback: %s' % traceback.format_exc(), logger.ERROR)
|
logger.log(u'Failed to parse. Traceback: %s' % traceback.format_exc(), logger.ERROR)
|
||||||
|
|
||||||
self._log_search(mode, len(items[mode]) - cnt,
|
self._log_search(mode, len(items[mode]) - cnt, search_url)
|
||||||
('search string: ' + search_string, self.name)['Cache' == mode])
|
|
||||||
|
|
||||||
results = self._sort_seeding(mode, results + items[mode])
|
results = self._sort_seeding(mode, results + items[mode])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue