mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Merge pull request #151 from adam111316/feature/RemoveTvtorrentsProvider
Remove obsolete tvtorrents search provider
This commit is contained in:
commit
ce93c4216a
6 changed files with 2 additions and 140 deletions
|
@ -7,6 +7,7 @@
|
|||
* Change recent search to occur 5 minutes after start up
|
||||
* Change backlog search to occur 10 minutes after start up
|
||||
* Change UI footer to display time left until a backlog search
|
||||
* Remove obsolete tvtorrents search provider
|
||||
|
||||
[develop changelog]
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 703 B |
|
@ -571,39 +571,6 @@
|
|||
</div>
|
||||
#end if
|
||||
|
||||
#if $hasattr($curTorrentProvider, 'options'):
|
||||
<br>
|
||||
<input type="hidden" id="tvtorrents_option_string" />
|
||||
<fieldset>
|
||||
<legend id="seed_options">Advanced options</legend>
|
||||
<div class="field-pair">
|
||||
<label >
|
||||
<span class="component-title">Seeding ratio(%) goal:</span>
|
||||
<input type="text" id="tvtorrents_seed_ratio" class="seed_option form-control input-sm input75" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label>
|
||||
<span class="component-title">Seeding time(h) goal:</span>
|
||||
<input type="text" id="tvtorrents_seed_time" class="seed_option form-control input-sm input75" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="field-pair">
|
||||
<label>
|
||||
<span class="component-title">Process method:</span>
|
||||
<select id="tvtorrents_process_method" class="seed_option form-control input-sm" >
|
||||
#set $process_method_text = {'': "", 'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"}
|
||||
#for $curAction in ('', 'copy', 'move', 'hardlink', 'symlink'):
|
||||
#set $process_method = ''
|
||||
<option class="seed_option" value="$curAction" $process_method>$process_method_text[$curAction]</option>
|
||||
#end for
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
<br>
|
||||
#end if
|
||||
|
||||
</div>
|
||||
#end for
|
||||
<!-- end div for editing providers -->
|
||||
|
|
|
@ -32,7 +32,7 @@ import os.path
|
|||
sys.path.append(os.path.abspath('../lib'))
|
||||
from sickbeard import providers, metadata, config, webserveInit
|
||||
from sickbeard.providers.generic import GenericProvider
|
||||
from providers import ezrss, tvtorrents, btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, \
|
||||
from providers import ezrss, btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, \
|
||||
omgwtfnzbs, scc, hdtorrents, torrentday, hdbits, nextgen, speedcd, nyaatorrents, fanzub, torrentbytes, \
|
||||
freshontv, bitsoup, tokyotoshokan
|
||||
from sickbeard.config import CheckSection, check_setting_int, check_setting_str, check_setting_float, ConfigMigrator, \
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
__all__ = ['ezrss',
|
||||
'tvtorrents',
|
||||
'womble',
|
||||
'btn',
|
||||
'thepiratebay',
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
# Author: Nic Wolfe <nic@wolfeden.ca>
|
||||
# URL: http://code.google.com/p/sickbeard/
|
||||
#
|
||||
# This file is part of SickGear.
|
||||
#
|
||||
# SickGear is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# SickGear is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
try:
|
||||
import xml.etree.cElementTree as etree
|
||||
except ImportError:
|
||||
import elementtree.ElementTree as etree
|
||||
|
||||
import sickbeard
|
||||
import generic
|
||||
|
||||
from sickbeard.exceptions import ex, AuthException
|
||||
from sickbeard import helpers
|
||||
from sickbeard import logger
|
||||
from sickbeard import tvcache
|
||||
|
||||
|
||||
class TvTorrentsProvider(generic.TorrentProvider):
|
||||
def __init__(self):
|
||||
|
||||
generic.TorrentProvider.__init__(self, "TvTorrents")
|
||||
|
||||
self.supportsBacklog = False
|
||||
|
||||
self.enabled = False
|
||||
self.hash = None
|
||||
self.digest = None
|
||||
self.ratio = None
|
||||
self.options = None
|
||||
|
||||
self.cache = TvTorrentsCache(self)
|
||||
|
||||
self.url = 'https://www.tvtorrents.com/'
|
||||
|
||||
def isEnabled(self):
|
||||
return self.enabled
|
||||
|
||||
def imageName(self):
|
||||
return 'tvtorrents.png'
|
||||
|
||||
def _checkAuth(self):
|
||||
|
||||
if not self.digest or not self.hash:
|
||||
raise AuthException("Your authentication credentials for " + self.name + " are missing, check your config.")
|
||||
|
||||
return True
|
||||
|
||||
def _checkAuthFromData(self, data):
|
||||
if data.feed.title:
|
||||
description_text = data.feed.title
|
||||
|
||||
if "User can't be found" in description_text or "Invalid Hash" in description_text:
|
||||
logger.log(u"Incorrect authentication credentials for " + self.name + " : " + str(description_text),
|
||||
logger.DEBUG)
|
||||
raise AuthException(
|
||||
u"Your authentication credentials for " + self.name + " are incorrect, check your config")
|
||||
|
||||
return True
|
||||
|
||||
def seedRatio(self):
|
||||
return self.ratio
|
||||
|
||||
|
||||
class TvTorrentsCache(tvcache.TVCache):
|
||||
def __init__(self, provider):
|
||||
tvcache.TVCache.__init__(self, provider)
|
||||
|
||||
# only poll TvTorrents every 15 minutes max
|
||||
self.minTime = 15
|
||||
|
||||
def _getRSSData(self):
|
||||
# These will be ignored on the serverside.
|
||||
ignore_regex = "all.month|month.of|season[\s\d]*complete"
|
||||
|
||||
rss_url = self.provider.url + 'RssServlet?digest=' + provider.digest + '&hash=' + provider.hash + '&fname=true&exclude=(' + ignore_regex + ')'
|
||||
logger.log(self.provider.name + u" cache update URL: " + rss_url, logger.DEBUG)
|
||||
|
||||
data = self.getRSSFeed(rss_url)
|
||||
|
||||
if not self.provider._checkAuthFromData(data):
|
||||
return []
|
||||
|
||||
if data and 'entries' in data:
|
||||
return data['entries']
|
||||
else:
|
||||
return []
|
||||
|
||||
|
||||
|
||||
provider = TvTorrentsProvider()
|
Loading…
Reference in a new issue