Merge branch 'refs/heads/develop'
This commit is contained in:
@@ -107,7 +107,7 @@ Block.Search.MovieItem = new Class({
|
|||||||
self.options_el.empty();
|
self.options_el.empty();
|
||||||
self.options_el.adopt(
|
self.options_el.adopt(
|
||||||
new Element('div.message', {
|
new Element('div.message', {
|
||||||
'text': json.added ? 'Movie successfully added.' : 'Movie didn\'t add properly. Check logs'
|
'text': json.success ? 'Movie successfully added.' : 'Movie didn\'t add properly. Check logs'
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
self.mask.fade('out');
|
self.mask.fade('out');
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
from .main import SceneHD
|
|
||||||
|
|
||||||
def start():
|
|
||||||
return SceneHD()
|
|
||||||
|
|
||||||
config = [{
|
|
||||||
'name': 'scenehd',
|
|
||||||
'groups': [
|
|
||||||
{
|
|
||||||
'tab': 'searcher',
|
|
||||||
'list': 'torrent_providers',
|
|
||||||
'name': 'SceneHD',
|
|
||||||
'description': 'See <a href="https://scenehd.org">SceneHD</a>',
|
|
||||||
'wizard': True,
|
|
||||||
'options': [
|
|
||||||
{
|
|
||||||
'name': 'enabled',
|
|
||||||
'type': 'enabler',
|
|
||||||
'default': False,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name': 'username',
|
|
||||||
'default': '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name': 'password',
|
|
||||||
'default': '',
|
|
||||||
'type': 'password',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name': 'seed_ratio',
|
|
||||||
'label': 'Seed ratio',
|
|
||||||
'type': 'float',
|
|
||||||
'default': 1,
|
|
||||||
'description': 'Will not be (re)moved until this seed ratio is met.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name': 'seed_time',
|
|
||||||
'label': 'Seed time',
|
|
||||||
'type': 'int',
|
|
||||||
'default': 40,
|
|
||||||
'description': 'Will not be (re)moved until this seed time (in hours) is met.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name': 'extra_score',
|
|
||||||
'advanced': True,
|
|
||||||
'label': 'Extra Score',
|
|
||||||
'type': 'int',
|
|
||||||
'default': 0,
|
|
||||||
'description': 'Starting score for each release found via this provider.',
|
|
||||||
}
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}]
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
from bs4 import BeautifulSoup
|
|
||||||
from couchpotato.core.helpers.encoding import simplifyString, tryUrlencode
|
|
||||||
from couchpotato.core.helpers.variable import tryInt
|
|
||||||
from couchpotato.core.logger import CPLog
|
|
||||||
from couchpotato.core.providers.torrent.base import TorrentProvider
|
|
||||||
import traceback
|
|
||||||
|
|
||||||
log = CPLog(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class SceneHD(TorrentProvider):
|
|
||||||
|
|
||||||
urls = {
|
|
||||||
'test': 'https://scenehd.org/',
|
|
||||||
'login' : 'https://scenehd.org/takelogin.php',
|
|
||||||
'login_check': 'https://scenehd.org/my.php',
|
|
||||||
'detail': 'https://scenehd.org/details.php?id=%s',
|
|
||||||
'search': 'https://scenehd.org/browse.php?ajax',
|
|
||||||
'download': 'https://scenehd.org/download.php?id=%s',
|
|
||||||
}
|
|
||||||
|
|
||||||
http_time_between_calls = 1 #seconds
|
|
||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
|
||||||
|
|
||||||
q = '"%s %s"' % (simplifyString(title), movie['library']['year'])
|
|
||||||
arguments = tryUrlencode({
|
|
||||||
'search': q,
|
|
||||||
})
|
|
||||||
url = "%s&%s" % (self.urls['search'], arguments)
|
|
||||||
|
|
||||||
data = self.getHTMLData(url, opener = self.login_opener)
|
|
||||||
|
|
||||||
if data:
|
|
||||||
html = BeautifulSoup(data)
|
|
||||||
|
|
||||||
try:
|
|
||||||
resultsTable = html.find_all('table')[6]
|
|
||||||
entries = resultsTable.find_all('tr')
|
|
||||||
for result in entries[1:]:
|
|
||||||
|
|
||||||
all_cells = result.find_all('td')
|
|
||||||
|
|
||||||
detail_link = all_cells[2].find('a')
|
|
||||||
details = detail_link['href']
|
|
||||||
torrent_id = details.replace('details.php?id=', '')
|
|
||||||
|
|
||||||
leechers = all_cells[11].find('a')
|
|
||||||
if leechers:
|
|
||||||
leechers = leechers.string
|
|
||||||
else:
|
|
||||||
leechers = all_cells[11].string
|
|
||||||
|
|
||||||
results.append({
|
|
||||||
'id': torrent_id,
|
|
||||||
'name': detail_link['title'],
|
|
||||||
'size': self.parseSize(all_cells[7].string),
|
|
||||||
'seeders': tryInt(all_cells[10].find('a').string),
|
|
||||||
'leechers': tryInt(leechers),
|
|
||||||
'url': self.urls['download'] % torrent_id,
|
|
||||||
'description': all_cells[1].find('a')['href'],
|
|
||||||
})
|
|
||||||
|
|
||||||
except:
|
|
||||||
log.error('Failed getting results from %s: %s', (self.getName(), traceback.format_exc()))
|
|
||||||
|
|
||||||
|
|
||||||
def getLoginParams(self):
|
|
||||||
return tryUrlencode({
|
|
||||||
'username': self.conf('username'),
|
|
||||||
'password': self.conf('password'),
|
|
||||||
'ssl': 'yes',
|
|
||||||
})
|
|
||||||
|
|
||||||
def loginSuccess(self, output):
|
|
||||||
return 'logout.php' in output.lower()
|
|
||||||
|
|
||||||
loginCheckSuccess = loginSuccess
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user