Merge branch 'refs/heads/develop' into desktop
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
config = {
|
||||||
|
'name': 'download_providers',
|
||||||
|
'groups': [
|
||||||
|
{
|
||||||
|
'label': 'Downloaders',
|
||||||
|
'description': 'You can select different downloaders for each type (usenet / torrent)',
|
||||||
|
'type': 'list',
|
||||||
|
'name': 'download_providers',
|
||||||
|
'tab': 'downloaders',
|
||||||
|
'options': [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|||||||
@@ -58,12 +58,16 @@ class Downloader(Provider):
|
|||||||
return self.getAllDownloadStatus()
|
return self.getAllDownloadStatus()
|
||||||
|
|
||||||
def _removeFailed(self, item):
|
def _removeFailed(self, item):
|
||||||
|
if self.isDisabled(manual = True, data = {}):
|
||||||
|
return
|
||||||
|
|
||||||
if self.conf('delete_failed', default = True):
|
if self.conf('delete_failed', default = True):
|
||||||
return self.removeFailed(self, item)
|
return self.removeFailed(item)
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def removeFailed(self, item):
|
def removeFailed(self, item):
|
||||||
return False
|
return
|
||||||
|
|
||||||
def isCorrectType(self, item_type):
|
def isCorrectType(self, item_type):
|
||||||
is_correct = item_type in self.type
|
is_correct = item_type in self.type
|
||||||
@@ -106,4 +110,6 @@ class Downloader(Provider):
|
|||||||
|
|
||||||
def isEnabled(self, manual, data = {}):
|
def isEnabled(self, manual, data = {}):
|
||||||
d_manual = self.conf('manual', default = False)
|
d_manual = self.conf('manual', default = False)
|
||||||
return super(Downloader, self).isEnabled() and ((d_manual and manual) or (d_manual is False)) and self.isCorrectType(data.get('type'))
|
return super(Downloader, self).isEnabled() and \
|
||||||
|
((d_manual and manual) or (d_manual is False)) and \
|
||||||
|
(not data or self.isCorrectType(data.get('type')))
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'downloaders',
|
'tab': 'downloaders',
|
||||||
|
'list': 'download_providers',
|
||||||
'name': 'blackhole',
|
'name': 'blackhole',
|
||||||
'label': 'Black hole',
|
'label': 'Black hole',
|
||||||
'description': 'Download the NZB/Torrent to a specific folder.',
|
'description': 'Download the NZB/Torrent to a specific folder.',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'downloaders',
|
'tab': 'downloaders',
|
||||||
|
'list': 'download_providers',
|
||||||
'name': 'nzbget',
|
'name': 'nzbget',
|
||||||
'label': 'NZBGet',
|
'label': 'NZBGet',
|
||||||
'description': 'Use <a href="http://nzbget.sourceforge.net/Main_Page" target="_blank">NZBGet</a> to download NZBs.',
|
'description': 'Use <a href="http://nzbget.sourceforge.net/Main_Page" target="_blank">NZBGet</a> to download NZBs.',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'downloaders',
|
'tab': 'downloaders',
|
||||||
|
'list': 'download_providers',
|
||||||
'name': 'nzbvortex',
|
'name': 'nzbvortex',
|
||||||
'label': 'NZBVortex',
|
'label': 'NZBVortex',
|
||||||
'description': 'Use <a href="http://www.nzbvortex.com/landing/" target="_blank">NZBVortex</a> to download NZBs.',
|
'description': 'Use <a href="http://www.nzbvortex.com/landing/" target="_blank">NZBVortex</a> to download NZBs.',
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'downloaders',
|
'tab': 'downloaders',
|
||||||
|
'list': 'download_providers',
|
||||||
'name': 'pneumatic',
|
'name': 'pneumatic',
|
||||||
'label': 'Pneumatic',
|
'label': 'Pneumatic',
|
||||||
'description': 'Use <a href="http://forum.xbmc.org/showthread.php?tid=97657" target="_blank">Pneumatic</a> to download .strm files.',
|
'description': 'Use <a href="http://forum.xbmc.org/showthread.php?tid=97657" target="_blank">Pneumatic</a> to download .strm files.',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'downloaders',
|
'tab': 'downloaders',
|
||||||
|
'list': 'download_providers',
|
||||||
'name': 'sabnzbd',
|
'name': 'sabnzbd',
|
||||||
'label': 'Sabnzbd',
|
'label': 'Sabnzbd',
|
||||||
'description': 'Use <a href="http://sabnzbd.org/" target="_blank">SABnzbd</a> to download NZBs.',
|
'description': 'Use <a href="http://sabnzbd.org/" target="_blank">SABnzbd</a> to download NZBs.',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'downloaders',
|
'tab': 'downloaders',
|
||||||
|
'list': 'download_providers',
|
||||||
'name': 'synology',
|
'name': 'synology',
|
||||||
'label': 'Synology',
|
'label': 'Synology',
|
||||||
'description': 'Use <a href="http://www.synology.com/dsm/home_home_applications_download_station.php" target="_blank">Synology Download Station</a> to download.',
|
'description': 'Use <a href="http://www.synology.com/dsm/home_home_applications_download_station.php" target="_blank">Synology Download Station</a> to download.',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'downloaders',
|
'tab': 'downloaders',
|
||||||
|
'list': 'download_providers',
|
||||||
'name': 'transmission',
|
'name': 'transmission',
|
||||||
'label': 'Transmission',
|
'label': 'Transmission',
|
||||||
'description': 'Use <a href="http://www.transmissionbt.com/" target="_blank">Transmission</a> to download torrents.',
|
'description': 'Use <a href="http://www.transmissionbt.com/" target="_blank">Transmission</a> to download torrents.',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'downloaders',
|
'tab': 'downloaders',
|
||||||
|
'list': 'download_providers',
|
||||||
'name': 'utorrent',
|
'name': 'utorrent',
|
||||||
'label': 'uTorrent',
|
'label': 'uTorrent',
|
||||||
'description': 'Use <a href="http://www.utorrent.com/" target="_blank">uTorrent</a> to download torrents.',
|
'description': 'Use <a href="http://www.utorrent.com/" target="_blank">uTorrent</a> to download torrents.',
|
||||||
|
|||||||
@@ -67,6 +67,18 @@ class Loader(object):
|
|||||||
|
|
||||||
def addFromDir(self, plugin_type, priority, module, dir_name):
|
def addFromDir(self, plugin_type, priority, module, dir_name):
|
||||||
|
|
||||||
|
# Load dir module
|
||||||
|
try:
|
||||||
|
m = __import__(module)
|
||||||
|
splitted = module.split('.')
|
||||||
|
for sub in splitted[1:]:
|
||||||
|
m = getattr(m, sub)
|
||||||
|
|
||||||
|
if hasattr(m, 'config'):
|
||||||
|
fireEvent('settings.options', splitted[-1] + '_config', getattr(m, 'config'))
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
|
||||||
for cur_file in glob.glob(os.path.join(dir_name, '*')):
|
for cur_file in glob.glob(os.path.join(dir_name, '*')):
|
||||||
name = os.path.basename(cur_file)
|
name = os.path.basename(cur_file)
|
||||||
if os.path.isdir(os.path.join(dir_name, name)):
|
if os.path.isdir(os.path.join(dir_name, name)):
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
config = {
|
||||||
|
'name': 'notification_providers',
|
||||||
|
'groups': [
|
||||||
|
{
|
||||||
|
'label': 'Notifications',
|
||||||
|
'description': 'Notify when movies are done or snatched',
|
||||||
|
'type': 'list',
|
||||||
|
'name': 'notification_providers',
|
||||||
|
'tab': 'notifications',
|
||||||
|
'options': [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'boxcar',
|
'name': 'boxcar',
|
||||||
'options': [
|
'options': [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
from .main import Email
|
||||||
|
|
||||||
|
def start():
|
||||||
|
return Email()
|
||||||
|
|
||||||
|
config = [{
|
||||||
|
'name': 'email',
|
||||||
|
'groups': [
|
||||||
|
{
|
||||||
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
|
'name': 'email',
|
||||||
|
'options': [
|
||||||
|
{
|
||||||
|
'name': 'enabled',
|
||||||
|
'default': 0,
|
||||||
|
'type': 'enabler',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'from',
|
||||||
|
'label': 'Send e-mail from',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'to',
|
||||||
|
'label': 'Send e-mail to',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'smtp_server',
|
||||||
|
'label': 'SMTP server',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'ssl',
|
||||||
|
'label': 'Enable SSL',
|
||||||
|
'default': 0,
|
||||||
|
'type': 'bool',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'smtp_user',
|
||||||
|
'label': 'SMTP user',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'smtp_pass',
|
||||||
|
'label': 'SMTP password',
|
||||||
|
'type': 'password',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'on_snatch',
|
||||||
|
'default': 0,
|
||||||
|
'type': 'bool',
|
||||||
|
'advanced': True,
|
||||||
|
'description': 'Also send message when movie is snatched.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}]
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
from couchpotato.core.helpers.encoding import toUnicode
|
||||||
|
from couchpotato.core.logger import CPLog
|
||||||
|
from couchpotato.core.notifications.base import Notification
|
||||||
|
from email.mime.text import MIMEText
|
||||||
|
import smtplib
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
log = CPLog(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class Email(Notification):
|
||||||
|
|
||||||
|
def notify(self, message = '', data = {}, listener = None):
|
||||||
|
if self.isDisabled(): return
|
||||||
|
|
||||||
|
# Extract all the settings from settings
|
||||||
|
from_address = self.conf('from')
|
||||||
|
to = self.conf('to')
|
||||||
|
smtp_server = self.conf('smtp_server')
|
||||||
|
ssl = self.conf('ssl')
|
||||||
|
smtp_user = self.conf('smtp_user')
|
||||||
|
smtp_pass = self.conf('smtp_pass')
|
||||||
|
|
||||||
|
# Make the basic message
|
||||||
|
message = MIMEText(toUnicode(message))
|
||||||
|
message['Subject'] = self.default_title
|
||||||
|
message['From'] = from_address
|
||||||
|
message['To'] = to
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Open the SMTP connection, via SSL if requested
|
||||||
|
mailserver = smtplib.SMTP_SSL(smtp_server) if ssl == 1 else smtplib.SMTP(smtp_server)
|
||||||
|
|
||||||
|
# Check too see if an login attempt should be attempted
|
||||||
|
if len(smtp_user) > 0:
|
||||||
|
mailserver.login(smtp_user, smtp_pass)
|
||||||
|
|
||||||
|
# Send the e-mail
|
||||||
|
mailserver.sendmail(from_address, to, message.as_string())
|
||||||
|
|
||||||
|
# Close the SMTP connection
|
||||||
|
mailserver.quit()
|
||||||
|
log.info('Email notifications sent.')
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
log.error('E-mail failed: %s', traceback.format_exc())
|
||||||
|
return False
|
||||||
|
|
||||||
|
return False
|
||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'growl',
|
'name': 'growl',
|
||||||
'description': 'Version 1.4+',
|
'description': 'Version 1.4+',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'nmj',
|
'name': 'nmj',
|
||||||
'label': 'NMJ',
|
'label': 'NMJ',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'notifo',
|
'name': 'notifo',
|
||||||
'description': 'Keep in mind that Notifo service will end soon.',
|
'description': 'Keep in mind that Notifo service will end soon.',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'notifymyandroid',
|
'name': 'notifymyandroid',
|
||||||
'label': 'Notify My Android',
|
'label': 'Notify My Android',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'notifymywp',
|
'name': 'notifymywp',
|
||||||
'label': 'Notify My Windows Phone',
|
'label': 'Notify My Windows Phone',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'plex',
|
'name': 'plex',
|
||||||
'options': [
|
'options': [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'prowl',
|
'name': 'prowl',
|
||||||
'options': [
|
'options': [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'pushover',
|
'name': 'pushover',
|
||||||
'options': [
|
'options': [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'synoindex',
|
'name': 'synoindex',
|
||||||
'description': 'Automaticly adds index to Synology Media Server.',
|
'description': 'Automaticly adds index to Synology Media Server.',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'toasty',
|
'name': 'toasty',
|
||||||
'options': [
|
'options': [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'twitter',
|
'name': 'twitter',
|
||||||
'options': [
|
'options': [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'notifications',
|
'tab': 'notifications',
|
||||||
|
'list': 'notification_providers',
|
||||||
'name': 'xbmc',
|
'name': 'xbmc',
|
||||||
'label': 'XBMC',
|
'label': 'XBMC',
|
||||||
'description': 'v11 (Eden) and v12 (Frodo)',
|
'description': 'v11 (Eden) and v12 (Frodo)',
|
||||||
|
|||||||
@@ -198,9 +198,12 @@ class Manage(Plugin):
|
|||||||
|
|
||||||
def directories(self):
|
def directories(self):
|
||||||
try:
|
try:
|
||||||
return splitString(self.conf('library', default = ''), '::')
|
if self.conf('library', '').strip():
|
||||||
|
return splitString(self.conf('library', default = ''), '::')
|
||||||
except:
|
except:
|
||||||
return []
|
pass
|
||||||
|
|
||||||
|
return []
|
||||||
|
|
||||||
def scanFilesToLibrary(self, folder = None, files = None):
|
def scanFilesToLibrary(self, folder = None, files = None):
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
config = {
|
||||||
|
'name': 'automation_providers',
|
||||||
|
'groups': [
|
||||||
|
{
|
||||||
|
'label': 'Watchlists',
|
||||||
|
'description': 'Check watchlists for new movies',
|
||||||
|
'type': 'list',
|
||||||
|
'name': 'watchlist_providers',
|
||||||
|
'tab': 'automation',
|
||||||
|
'options': [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': 'Automated',
|
||||||
|
'description': 'Uses minimal requirements',
|
||||||
|
'type': 'list',
|
||||||
|
'name': 'automation_providers',
|
||||||
|
'tab': 'automation',
|
||||||
|
'options': [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'automation',
|
'tab': 'automation',
|
||||||
|
'list': 'automation_providers',
|
||||||
'name': 'bluray_automation',
|
'name': 'bluray_automation',
|
||||||
'label': 'Blu-ray.com',
|
'label': 'Blu-ray.com',
|
||||||
'description': 'Imports movies from blu-ray.com. (uses minimal requirements)',
|
'description': 'Imports movies from blu-ray.com. (uses minimal requirements)',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'automation',
|
'tab': 'automation',
|
||||||
|
'list': 'watchlist_providers',
|
||||||
'name': 'imdb_automation',
|
'name': 'imdb_automation',
|
||||||
'label': 'IMDB',
|
'label': 'IMDB',
|
||||||
'description': 'From any <strong>public</strong> IMDB watchlists. Url should be the RSS link.',
|
'description': 'From any <strong>public</strong> IMDB watchlists. Url should be the RSS link.',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'automation',
|
'tab': 'automation',
|
||||||
|
'list': 'automation_providers',
|
||||||
'name': 'itunes_automation',
|
'name': 'itunes_automation',
|
||||||
'label': 'iTunes',
|
'label': 'iTunes',
|
||||||
'description': 'From any <a href="http://itunes.apple.com/rss">iTunes</a> Store feed. Url should be the RSS link. (uses minimal requirements)',
|
'description': 'From any <a href="http://itunes.apple.com/rss">iTunes</a> Store feed. Url should be the RSS link. (uses minimal requirements)',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'automation',
|
'tab': 'automation',
|
||||||
|
'list': 'automation_providers',
|
||||||
'name': 'kinepolis_automation',
|
'name': 'kinepolis_automation',
|
||||||
'label': 'Kinepolis',
|
'label': 'Kinepolis',
|
||||||
'description': 'Imports movies from the current top 10 of kinepolis. (uses minimal requirements)',
|
'description': 'Imports movies from the current top 10 of kinepolis. (uses minimal requirements)',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'automation',
|
'tab': 'automation',
|
||||||
|
'list': 'automation_providers',
|
||||||
'name': 'moviemeter_automation',
|
'name': 'moviemeter_automation',
|
||||||
'label': 'Moviemeter',
|
'label': 'Moviemeter',
|
||||||
'description': 'Imports movies from the current top 10 of moviemeter.nl. (uses minimal requirements)',
|
'description': 'Imports movies from the current top 10 of moviemeter.nl. (uses minimal requirements)',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'automation',
|
'tab': 'automation',
|
||||||
|
'list': 'watchlist_providers',
|
||||||
'name': 'moviesio',
|
'name': 'moviesio',
|
||||||
'label': 'Movies.IO',
|
'label': 'Movies.IO',
|
||||||
'description': 'Imports movies from <a href="http://movies.io">Movies.io</a> RSS watchlists',
|
'description': 'Imports movies from <a href="http://movies.io">Movies.io</a> RSS watchlists',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'automation',
|
'tab': 'automation',
|
||||||
|
'list': 'automation_providers',
|
||||||
'name': 'rottentomatoes_automation',
|
'name': 'rottentomatoes_automation',
|
||||||
'label': 'Rottentomatoes',
|
'label': 'Rottentomatoes',
|
||||||
'description': 'Imports movies from the rottentomatoes "in theaters"-feed.',
|
'description': 'Imports movies from the rottentomatoes "in theaters"-feed.',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'automation',
|
'tab': 'automation',
|
||||||
|
'list': 'watchlist_providers',
|
||||||
'name': 'trakt_automation',
|
'name': 'trakt_automation',
|
||||||
'label': 'Trakt',
|
'label': 'Trakt',
|
||||||
'description': 'import movies from your own watchlist',
|
'description': 'import movies from your own watchlist',
|
||||||
|
|||||||
@@ -56,14 +56,14 @@ class Provider(Plugin):
|
|||||||
|
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def getRSSData(self, url, **kwargs):
|
def getRSSData(self, url, item_path = 'channel/item', **kwargs):
|
||||||
|
|
||||||
data = self.getCache(md5(url), url, **kwargs)
|
data = self.getCache(md5(url), url, **kwargs)
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
try:
|
try:
|
||||||
data = XMLTree.fromstring(data)
|
data = XMLTree.fromstring(data)
|
||||||
return self.getElements(data, 'channel/item')
|
return self.getElements(data, item_path)
|
||||||
except:
|
except:
|
||||||
log.error('Failed to parsing %s: %s', (self.getName(), traceback.format_exc()))
|
log.error('Failed to parsing %s: %s', (self.getName(), traceback.format_exc()))
|
||||||
|
|
||||||
|
|||||||
@@ -30,11 +30,6 @@ class MovieResultModifier(Plugin):
|
|||||||
temp[imdb] = self.getLibraryTags(imdb)
|
temp[imdb] = self.getLibraryTags(imdb)
|
||||||
order.append(imdb)
|
order.append(imdb)
|
||||||
|
|
||||||
if item.get('via_imdb'):
|
|
||||||
if order.count(imdb):
|
|
||||||
order.remove(imdb)
|
|
||||||
order.insert(0, imdb)
|
|
||||||
|
|
||||||
# Merge dicts
|
# Merge dicts
|
||||||
temp[imdb] = mergeDicts(temp[imdb], item)
|
temp[imdb] = mergeDicts(temp[imdb], item)
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class CouchPotatoApi(MovieProvider):
|
|||||||
def search(self, q, limit = 12):
|
def search(self, q, limit = 12):
|
||||||
|
|
||||||
cache_key = 'cpapi.cache.%s' % q
|
cache_key = 'cpapi.cache.%s' % q
|
||||||
cached = self.getCache(cache_key, self.urls['search'] % tryUrlencode(q), timeout = 3, headers = self.getRequestHeaders())
|
cached = self.getCache(cache_key, self.urls['search'] % tryUrlencode(q), headers = self.getRequestHeaders())
|
||||||
|
|
||||||
if cached:
|
if cached:
|
||||||
try:
|
try:
|
||||||
@@ -50,7 +50,7 @@ class CouchPotatoApi(MovieProvider):
|
|||||||
return
|
return
|
||||||
|
|
||||||
cache_key = 'cpapi.cache.info.%s' % identifier
|
cache_key = 'cpapi.cache.info.%s' % identifier
|
||||||
cached = self.getCache(cache_key, self.urls['info'] % identifier, timeout = 3, headers = self.getRequestHeaders())
|
cached = self.getCache(cache_key, self.urls['info'] % identifier, headers = self.getRequestHeaders())
|
||||||
|
|
||||||
if cached:
|
if cached:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
config = {
|
||||||
|
'name': 'nzb_providers',
|
||||||
|
'groups': [
|
||||||
|
{
|
||||||
|
'label': 'Usenet',
|
||||||
|
'description': 'Providers searching usenet for new releases',
|
||||||
|
'type': 'list',
|
||||||
|
'name': 'nzb_providers',
|
||||||
|
'tab': 'searcher',
|
||||||
|
'subtab': 'providers',
|
||||||
|
'options': [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'nzb_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'nzb_providers',
|
||||||
'name': 'binsearch',
|
'name': 'binsearch',
|
||||||
'description': 'Free provider, less accurate. See <a href="https://www.binsearch.info/">BinSearch</a>',
|
'description': 'Free provider, less accurate. See <a href="https://www.binsearch.info/">BinSearch</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -22,11 +22,10 @@ class BinSearch(NZBProvider):
|
|||||||
|
|
||||||
def _search(self, movie, quality, results):
|
def _search(self, movie, quality, results):
|
||||||
|
|
||||||
q = '%s %s' % (movie['library']['identifier'], quality.get('identifier'))
|
|
||||||
arguments = tryUrlencode({
|
arguments = tryUrlencode({
|
||||||
'q': q,
|
'q': movie['library']['identifier'],
|
||||||
'm': 'n',
|
'm': 'n',
|
||||||
'max': 250,
|
'max': 400,
|
||||||
'adv_age': Env.setting('retention', 'nzb'),
|
'adv_age': Env.setting('retention', 'nzb'),
|
||||||
'adv_sort': 'date',
|
'adv_sort': 'date',
|
||||||
'adv_col': 'on',
|
'adv_col': 'on',
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'nzb_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'nzb_providers',
|
||||||
'name': 'FTDWorld',
|
'name': 'FTDWorld',
|
||||||
'description': 'Free provider, less accurate. See <a href="http://ftdworld.net">FTDWorld</a>',
|
'description': 'Free provider, less accurate. See <a href="http://ftdworld.net">FTDWorld</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'nzb_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'nzb_providers',
|
||||||
'name': 'newznab',
|
'name': 'newznab',
|
||||||
'order': 10,
|
'order': 10,
|
||||||
'description': 'Enable <a href="http://newznab.com/" target="_blank">NewzNab providers</a> such as <a href="https://nzb.su" target="_blank">NZB.su</a>, \
|
'description': 'Enable <a href="http://newznab.com/" target="_blank">NewzNab providers</a> such as <a href="https://nzb.su" target="_blank">NZB.su</a>, \
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'nzb_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'nzb_providers',
|
||||||
'name': 'NZBClub',
|
'name': 'NZBClub',
|
||||||
'description': 'Free provider, less accurate. See <a href="https://www.nzbclub.com/">NZBClub</a>',
|
'description': 'Free provider, less accurate. See <a href="https://www.nzbclub.com/">NZBClub</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ class NZBClub(NZBProvider, RSS):
|
|||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
def _searchOnTitle(self, title, movie, quality, results):
|
||||||
|
|
||||||
q = '"%s %s" %s' % (title, movie['library']['year'], quality.get('identifier'))
|
q = '"%s %s"' % (title, movie['library']['year'])
|
||||||
|
|
||||||
params = tryUrlencode({
|
params = tryUrlencode({
|
||||||
'q': q,
|
'q': q,
|
||||||
'ig': '1',
|
'ig': 1,
|
||||||
'rpp': 200,
|
'rpp': 200,
|
||||||
'st': 1,
|
'st': 5,
|
||||||
'sp': 1,
|
'sp': 1,
|
||||||
'ns': 1,
|
'ns': 1,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'nzb_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'nzb_providers',
|
||||||
'name': 'nzbindex',
|
'name': 'nzbindex',
|
||||||
'description': 'Free provider, less accurate. See <a href="https://www.nzbindex.com/">NZBIndex</a>',
|
'description': 'Free provider, less accurate. See <a href="https://www.nzbindex.com/">NZBIndex</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class NzbIndex(NZBProvider, RSS):
|
|||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
def _searchOnTitle(self, title, movie, quality, results):
|
||||||
|
|
||||||
q = '"%s" %s %s' % (title, movie['library']['year'], quality.get('identifier'))
|
q = '"%s %s"' % (title, movie['library']['year'])
|
||||||
arguments = tryUrlencode({
|
arguments = tryUrlencode({
|
||||||
'q': q,
|
'q': q,
|
||||||
'age': Env.setting('retention', 'nzb'),
|
'age': Env.setting('retention', 'nzb'),
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'nzb_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'nzb_providers',
|
||||||
'name': 'nzbsrus',
|
'name': 'nzbsrus',
|
||||||
'label': 'Nzbsrus',
|
'label': 'Nzbsrus',
|
||||||
'description': 'See <a href="https://www.nzbsrus.com/">NZBsRus</a>',
|
'description': 'See <a href="https://www.nzbsrus.com/">NZBsRus</a>',
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class Nzbsrus(NZBProvider, RSS):
|
|||||||
arguments += '&lang0=1&lang3=1&lang1=1'
|
arguments += '&lang0=1&lang3=1&lang1=1'
|
||||||
|
|
||||||
url = '%s&%s&%s' % (self.urls['search'], arguments , cat_id_string)
|
url = '%s&%s&%s' % (self.urls['search'], arguments , cat_id_string)
|
||||||
nzbs = self.getRSSData(url, cache_timeout = 1800, headers = {'User-Agent': Env.getIdentifier()})
|
nzbs = self.getRSSData(url, item_path = 'results/result', cache_timeout = 1800, headers = {'User-Agent': Env.getIdentifier()})
|
||||||
|
|
||||||
for nzb in nzbs:
|
for nzb in nzbs:
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'nzb_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'nzb_providers',
|
||||||
'name': 'nzbX',
|
'name': 'nzbX',
|
||||||
'description': 'Free provider. See <a href="https://www.nzbx.co/">nzbX</a>',
|
'description': 'Free provider. See <a href="https://www.nzbx.co/">nzbX</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'nzb_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'nzb_providers',
|
||||||
'name': 'OMGWTFNZBs',
|
'name': 'OMGWTFNZBs',
|
||||||
'description': 'See <a href="http://omgwtfnzbs.org/">OMGWTFNZBs</a>',
|
'description': 'See <a href="http://omgwtfnzbs.org/">OMGWTFNZBs</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
config = {
|
||||||
|
'name': 'torrent_providers',
|
||||||
|
'groups': [
|
||||||
|
{
|
||||||
|
'label': 'Torrent',
|
||||||
|
'description': 'Providers searching torrent sites for new releases',
|
||||||
|
'type': 'list',
|
||||||
|
'name': 'torrent_providers',
|
||||||
|
'tab': 'searcher',
|
||||||
|
'subtab': 'providers',
|
||||||
|
'options': [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'torrent_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'torrent_providers',
|
||||||
'name': 'KickAssTorrents',
|
'name': 'KickAssTorrents',
|
||||||
'description': 'See <a href="https://kat.ph/">KickAssTorrents</a>',
|
'description': 'See <a href="https://kat.ph/">KickAssTorrents</a>',
|
||||||
'wizard': True,
|
'wizard': True,
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'torrent_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'torrent_providers',
|
||||||
'name': 'PassThePopcorn',
|
'name': 'PassThePopcorn',
|
||||||
'description': 'See <a href="https://passthepopcorn.me">PassThePopcorn.me</a>',
|
'description': 'See <a href="https://passthepopcorn.me">PassThePopcorn.me</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'torrent_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'torrent_providers',
|
||||||
'name': 'PublicHD',
|
'name': 'PublicHD',
|
||||||
'description': 'Public Torrent site with only HD content. See <a href="https://publichd.se/">PublicHD</a>',
|
'description': 'Public Torrent site with only HD content. See <a href="https://publichd.se/">PublicHD</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'torrent_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'torrent_providers',
|
||||||
'name': 'SceneAccess',
|
'name': 'SceneAccess',
|
||||||
'description': 'See <a href="https://sceneaccess.eu/">SceneAccess</a>',
|
'description': 'See <a href="https://sceneaccess.eu/">SceneAccess</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'torrent_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'torrent_providers',
|
||||||
'name': 'SceneHD',
|
'name': 'SceneHD',
|
||||||
'description': 'See <a href="https://scenehd.org">SceneHD</a>',
|
'description': 'See <a href="https://scenehd.org">SceneHD</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class SceneHD(TorrentProvider):
|
|||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
def _searchOnTitle(self, title, movie, quality, results):
|
||||||
|
|
||||||
q = '"%s %s" %s' % (simplifyString(title), movie['library']['year'], quality.get('identifier'))
|
q = '"%s %s"' % (simplifyString(title), movie['library']['year'])
|
||||||
arguments = tryUrlencode({
|
arguments = tryUrlencode({
|
||||||
'search': q,
|
'search': q,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'torrent_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'torrent_providers',
|
||||||
'name': 'ThePirateBay',
|
'name': 'ThePirateBay',
|
||||||
'description': 'The world\'s largest bittorrent tracker. See <a href="http://fucktimkuik.org/">ThePirateBay</a>',
|
'description': 'The world\'s largest bittorrent tracker. See <a href="http://fucktimkuik.org/">ThePirateBay</a>',
|
||||||
'wizard': True,
|
'wizard': True,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ThePirateBay(TorrentMagnetProvider):
|
|||||||
|
|
||||||
urls = {
|
urls = {
|
||||||
'detail': '%s/torrent/%s',
|
'detail': '%s/torrent/%s',
|
||||||
'search': '%s/search/%s/0/7/%d'
|
'search': '%s/search/%s/%s/7/%d'
|
||||||
}
|
}
|
||||||
|
|
||||||
cat_ids = [
|
cat_ids = [
|
||||||
@@ -45,52 +45,66 @@ class ThePirateBay(TorrentMagnetProvider):
|
|||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
def _searchOnTitle(self, title, movie, quality, results):
|
||||||
|
|
||||||
search_url = self.urls['search'] % (self.getDomain(), tryUrlencode(title + ' ' + quality['identifier']), self.getCatId(quality['identifier'])[0])
|
page = 0
|
||||||
|
total_pages = 1
|
||||||
|
|
||||||
data = self.getHTMLData(search_url)
|
while page < total_pages:
|
||||||
|
|
||||||
if data:
|
search_url = self.urls['search'] % (self.getDomain(), tryUrlencode('"%s %s"' % (title, movie['library']['year'])), page, self.getCatId(quality['identifier'])[0])
|
||||||
try:
|
page += 1
|
||||||
soup = BeautifulSoup(data)
|
|
||||||
results_table = soup.find('table', attrs = {'id': 'searchResult'})
|
|
||||||
|
|
||||||
if not results_table:
|
data = self.getHTMLData(search_url)
|
||||||
return
|
|
||||||
|
|
||||||
entries = results_table.find_all('tr')
|
if data:
|
||||||
for result in entries[2:]:
|
try:
|
||||||
link = result.find(href = re.compile('torrent\/\d+\/'))
|
soup = BeautifulSoup(data)
|
||||||
download = result.find(href = re.compile('magnet:'))
|
results_table = soup.find('table', attrs = {'id': 'searchResult'})
|
||||||
|
|
||||||
|
if not results_table:
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
size = re.search('Size (?P<size>.+),', unicode(result.select('font.detDesc')[0])).group('size')
|
total_pages = len(soup.find('div', attrs = {'align': 'center'}).find_all('a'))
|
||||||
except:
|
except:
|
||||||
continue
|
pass
|
||||||
|
|
||||||
if link and download:
|
print total_pages, page
|
||||||
|
|
||||||
def extra_score(item):
|
entries = results_table.find_all('tr')
|
||||||
trusted = (0, 10)[result.find('img', alt = re.compile('Trusted')) != None]
|
for result in entries[2:]:
|
||||||
vip = (0, 20)[result.find('img', alt = re.compile('VIP')) != None]
|
link = result.find(href = re.compile('torrent\/\d+\/'))
|
||||||
confirmed = (0, 30)[result.find('img', alt = re.compile('Helpers')) != None]
|
download = result.find(href = re.compile('magnet:'))
|
||||||
moderated = (0, 50)[result.find('img', alt = re.compile('Moderator')) != None]
|
|
||||||
|
|
||||||
return confirmed + trusted + vip + moderated
|
try:
|
||||||
|
size = re.search('Size (?P<size>.+),', unicode(result.select('font.detDesc')[0])).group('size')
|
||||||
|
except:
|
||||||
|
continue
|
||||||
|
|
||||||
results.append({
|
if link and download:
|
||||||
'id': re.search('/(?P<id>\d+)/', link['href']).group('id'),
|
|
||||||
'name': link.string,
|
def extra_score(item):
|
||||||
'url': download['href'],
|
trusted = (0, 10)[result.find('img', alt = re.compile('Trusted')) != None]
|
||||||
'detail_url': self.getDomain(link['href']),
|
vip = (0, 20)[result.find('img', alt = re.compile('VIP')) != None]
|
||||||
'size': self.parseSize(size),
|
confirmed = (0, 30)[result.find('img', alt = re.compile('Helpers')) != None]
|
||||||
'seeders': tryInt(result.find_all('td')[2].string),
|
moderated = (0, 50)[result.find('img', alt = re.compile('Moderator')) != None]
|
||||||
'leechers': tryInt(result.find_all('td')[3].string),
|
|
||||||
'extra_score': extra_score,
|
return confirmed + trusted + vip + moderated
|
||||||
'get_more_info': self.getMoreInfo
|
|
||||||
})
|
results.append({
|
||||||
|
'id': re.search('/(?P<id>\d+)/', link['href']).group('id'),
|
||||||
|
'name': link.string,
|
||||||
|
'url': download['href'],
|
||||||
|
'detail_url': self.getDomain(link['href']),
|
||||||
|
'size': self.parseSize(size),
|
||||||
|
'seeders': tryInt(result.find_all('td')[2].string),
|
||||||
|
'leechers': tryInt(result.find_all('td')[3].string),
|
||||||
|
'extra_score': extra_score,
|
||||||
|
'get_more_info': self.getMoreInfo
|
||||||
|
})
|
||||||
|
|
||||||
|
except:
|
||||||
|
log.error('Failed getting results from %s: %s', (self.getName(), traceback.format_exc()))
|
||||||
|
|
||||||
except:
|
|
||||||
log.error('Failed getting results from %s: %s', (self.getName(), traceback.format_exc()))
|
|
||||||
|
|
||||||
def isEnabled(self):
|
def isEnabled(self):
|
||||||
return super(ThePirateBay, self).isEnabled() and self.getDomain()
|
return super(ThePirateBay, self).isEnabled() and self.getDomain()
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'torrent_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'torrent_providers',
|
||||||
'name': 'TorrentDay',
|
'name': 'TorrentDay',
|
||||||
'description': 'See <a href="http://www.td.af/">TorrentDay</a>',
|
'description': 'See <a href="http://www.td.af/">TorrentDay</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ config = [{
|
|||||||
'groups': [
|
'groups': [
|
||||||
{
|
{
|
||||||
'tab': 'searcher',
|
'tab': 'searcher',
|
||||||
'subtab': 'torrent_providers',
|
'subtab': 'providers',
|
||||||
|
'list': 'torrent_providers',
|
||||||
'name': 'TorrentLeech',
|
'name': 'TorrentLeech',
|
||||||
'description': 'See <a href="http://torrentleech.org">TorrentLeech</a>',
|
'description': 'See <a href="http://torrentleech.org">TorrentLeech</a>',
|
||||||
'options': [
|
'options': [
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class TorrentLeech(TorrentProvider):
|
|||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
def _searchOnTitle(self, title, movie, quality, results):
|
||||||
|
|
||||||
url = self.urls['search'] % (tryUrlencode(title.replace(':', '') + ' ' + quality['identifier']), self.getCatId(quality['identifier'])[0])
|
url = self.urls['search'] % (tryUrlencode('%s %s' % (title.replace(':', ''), movie['library']['year'])), self.getCatId(quality['identifier'])[0])
|
||||||
data = self.getHTMLData(url, opener = self.login_opener)
|
data = self.getHTMLData(url, opener = self.login_opener)
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ Page.Settings = new Class({
|
|||||||
wizard_only: false,
|
wizard_only: false,
|
||||||
|
|
||||||
tabs: {},
|
tabs: {},
|
||||||
|
lists: {},
|
||||||
current: 'about',
|
current: 'about',
|
||||||
has_tab: false,
|
has_tab: false,
|
||||||
|
|
||||||
@@ -178,12 +179,24 @@ Page.Settings = new Class({
|
|||||||
var content_container = self.tabs[group.tab].subtabs[group.subtab].content
|
var content_container = self.tabs[group.tab].subtabs[group.subtab].content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(group.list && !self.lists[group.list]){
|
||||||
|
self.lists[group.list] = self.createList(content_container);
|
||||||
|
}
|
||||||
|
|
||||||
// Create the group
|
// Create the group
|
||||||
if(!self.tabs[group.tab].groups[group.name]){
|
if(!self.tabs[group.tab].groups[group.name]){
|
||||||
var group_el = self.createGroup(group)
|
var group_el = self.createGroup(group)
|
||||||
.inject(content_container)
|
.inject(group.list ? self.lists[group.list] : content_container)
|
||||||
.addClass('section_'+section_name);
|
.addClass('section_'+section_name);
|
||||||
self.tabs[group.tab].groups[group.name] = group_el
|
self.tabs[group.tab].groups[group.name] = group_el;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create list if needed
|
||||||
|
if(group.type && group.type == 'list'){
|
||||||
|
if(!self.lists[group.name])
|
||||||
|
self.lists[group.name] = self.createList(content_container);
|
||||||
|
else
|
||||||
|
self.lists[group.name].inject(self.tabs[group.tab].groups[group.name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add options to group
|
// Add options to group
|
||||||
@@ -283,6 +296,14 @@ Page.Settings = new Class({
|
|||||||
)
|
)
|
||||||
|
|
||||||
return group_el
|
return group_el
|
||||||
|
},
|
||||||
|
|
||||||
|
createList: function(content_container){
|
||||||
|
return new Element('div.option_list').grab(
|
||||||
|
new Element('h3', {
|
||||||
|
'text': 'Enable more providers'
|
||||||
|
})
|
||||||
|
).inject(content_container)
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -550,15 +571,21 @@ Option.Enabler = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
checkState: function(){
|
checkState: function(){
|
||||||
var self = this;
|
var self = this,
|
||||||
|
enabled = self.getValue();
|
||||||
|
|
||||||
|
self.parentFieldset[ enabled ? 'removeClass' : 'addClass']('disabled');
|
||||||
|
|
||||||
|
if(self.parentList)
|
||||||
|
self.parentFieldset.inject(self.parentList.getElement('h3'), enabled ? 'before' : 'after');
|
||||||
|
|
||||||
self.parentFieldset[ self.getValue() ? 'removeClass' : 'addClass']('disabled');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
afterInject: function(){
|
afterInject: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
self.parentFieldset = self.el.getParent('fieldset')
|
self.parentFieldset = self.el.getParent('fieldset').addClass('enabler')
|
||||||
|
self.parentList = self.parentFieldset.getParent('.option_list');
|
||||||
self.el.inject(self.parentFieldset, 'top')
|
self.el.inject(self.parentFieldset, 'top')
|
||||||
self.checkState()
|
self.checkState()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,10 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
.page fieldset h2 .hint a {
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.page fieldset.disabled .ctrlHolder {
|
.page fieldset.disabled .ctrlHolder {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -102,7 +106,7 @@
|
|||||||
width: auto;
|
width: auto;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-bottom: -25px;
|
margin-bottom: -23px;
|
||||||
border: none;
|
border: none;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
}
|
}
|
||||||
@@ -149,6 +153,73 @@
|
|||||||
|
|
||||||
.page .xsmall { width: 20px !important; text-align: center; }
|
.page .xsmall { width: 20px !important; text-align: center; }
|
||||||
|
|
||||||
|
.page .enabler {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page .option_list {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page .option_list .enabler {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page .option_list .enabler:not(.disabled) {
|
||||||
|
margin: 0 0 0 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page .option_list .enabler:not(.disabled) .ctrlHolder:first-child {
|
||||||
|
margin: 10px 0 -33px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page .option_list h3 {
|
||||||
|
padding: 0;
|
||||||
|
margin: 10px 0 0 0;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: normal;
|
||||||
|
text-shadow: none;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 12px;
|
||||||
|
background: rgba(255,255,255,0.03);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page .option_list .enabler.disabled {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 3px 3px 3px 20px;
|
||||||
|
padding: 4px 0;
|
||||||
|
width: 159px;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page .option_list .enabler.disabled h2 {
|
||||||
|
border: none;
|
||||||
|
box-shadow: none;
|
||||||
|
padding: 0 10px 0 25px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page .option_list .enabler:not(.disabled) h2 {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
border: none;
|
||||||
|
border-top: 1px solid rgba(255,255,255, 0.15);
|
||||||
|
box-shadow: 0 -1px 0px #333;
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 0 5px 25px;
|
||||||
|
}
|
||||||
|
.page .option_list .enabler:not(.disabled):first-child h2 {
|
||||||
|
border: none;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page .option_list .enabler.disabled h2 .hint {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.page .option_list .enabler h2 .hint {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
.page input[type=text], .page input[type=password] {
|
.page input[type=text], .page input[type=password] {
|
||||||
padding: 5px 3px;
|
padding: 5px 3px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user