Compare commits
232 Commits
develop
...
build/2.6.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b20a590aab | ||
|
|
f08f2b0339 | ||
|
|
a4dff7a331 | ||
|
|
40cd1b4e08 | ||
|
|
5b1dd68675 | ||
|
|
4603b0c3b9 | ||
|
|
568e42e2f3 | ||
|
|
4929e7bbcc | ||
|
|
38ee0ebe7b | ||
|
|
9964d9591b | ||
|
|
2f5526d57e | ||
|
|
0288cc8848 | ||
|
|
739d668261 | ||
|
|
f450f2d1e3 | ||
|
|
a2be29c3b2 | ||
|
|
8770ab6696 | ||
|
|
aea673ddcd | ||
|
|
f9fa87ce1d | ||
|
|
ac65775743 | ||
|
|
cd55966575 | ||
|
|
5873a5c8e2 | ||
|
|
32163b3951 | ||
|
|
e0cc86b51c | ||
|
|
7ec64e202b | ||
|
|
da97b62c44 | ||
|
|
1fb031ff40 | ||
|
|
86edf5eb04 | ||
|
|
92f9743d3c | ||
|
|
1b151fbd97 | ||
|
|
0567504394 | ||
|
|
c8a3b64624 | ||
|
|
c657d6d70b | ||
|
|
d307d343e5 | ||
|
|
f2ab59e384 | ||
|
|
55f201040b | ||
|
|
476a5cc3dd | ||
|
|
342a4ad885 | ||
|
|
12159a1b7b | ||
|
|
b773f7b71c | ||
|
|
41aba6b19c | ||
|
|
96def8563b | ||
|
|
bf46a937c0 | ||
|
|
2edb6caa97 | ||
|
|
9e125a361a | ||
|
|
2252ed710c | ||
|
|
07a790e9b2 | ||
|
|
bb6fefd010 | ||
|
|
55e489cc51 | ||
|
|
7fe5a271dc | ||
|
|
ea92c503bb | ||
|
|
6942126b7f | ||
|
|
a6d37bf9c2 | ||
|
|
37c6bc7612 | ||
|
|
d6a264aaed | ||
|
|
108f3292c3 | ||
|
|
fc60727e82 | ||
|
|
49cd8fbc2c | ||
|
|
1991792291 | ||
|
|
29290022e6 | ||
|
|
04aa2e5fa4 | ||
|
|
6772b9d965 | ||
|
|
5df14d67e1 | ||
|
|
73abd1f022 | ||
|
|
e75a8529c9 | ||
|
|
07a7f8cbcf | ||
|
|
9b35a0fb20 | ||
|
|
0622e6e5ab | ||
|
|
f16931906f | ||
|
|
68dcba8853 | ||
|
|
ae8f66df1a | ||
|
|
5237ead5cb | ||
|
|
45b2dff6d2 | ||
|
|
30d56b5d2c | ||
|
|
5ff6824ae9 | ||
|
|
0210859155 | ||
|
|
665478db13 | ||
|
|
84c366ab54 | ||
|
|
908e5eae77 | ||
|
|
c4aaa10308 | ||
|
|
d10536a829 | ||
|
|
1e7fa82e11 | ||
|
|
1d448f3d9c | ||
|
|
338b5f427a | ||
|
|
59e3e73c4c | ||
|
|
cb2614127c | ||
|
|
fdbd826917 | ||
|
|
31daf4915e | ||
|
|
4ca7691afd | ||
|
|
64d3ecd9b8 | ||
|
|
d55df3240f | ||
|
|
52214e4938 | ||
|
|
b45307e493 | ||
|
|
4320369448 | ||
|
|
f560dc093c | ||
|
|
d26a2b1480 | ||
|
|
e11b07b559 | ||
|
|
b6ee8ef4d4 | ||
|
|
f80559d380 | ||
|
|
8530b00e7b | ||
|
|
5851e1e69f | ||
|
|
686bfd62eb | ||
|
|
9b82603c26 | ||
|
|
f41792915f | ||
|
|
2fa77fb610 | ||
|
|
e64d0e33fc | ||
|
|
b168643600 | ||
|
|
240283405e | ||
|
|
b69f8b7ed5 | ||
|
|
fbccba77a7 | ||
|
|
d3efda74b2 | ||
|
|
66b849cb29 | ||
|
|
b19f98ef5b | ||
|
|
c389790cf2 | ||
|
|
d7445dfa80 | ||
|
|
36782768a4 | ||
|
|
2c9d487614 | ||
|
|
b9a724c8bb | ||
|
|
68d826ca1c | ||
|
|
d6921882e1 | ||
|
|
2cfff73486 | ||
|
|
0c7dda8d44 | ||
|
|
dbaa377770 | ||
|
|
47d2b81d1c | ||
|
|
f79fcda27f | ||
|
|
cdbcad2238 | ||
|
|
5d913e87c3 | ||
|
|
16f02bda27 | ||
|
|
8d108b92bf | ||
|
|
46783028b1 | ||
|
|
d08c7c57a8 | ||
|
|
eeeb845ef3 | ||
|
|
651a063f94 | ||
|
|
f20aaa2d9d | ||
|
|
ba925ec191 | ||
|
|
3b7376fd18 | ||
|
|
c31b10c798 | ||
|
|
acda664686 | ||
|
|
e2852407ea | ||
|
|
88e738c6cd | ||
|
|
eaae8bdb0b | ||
|
|
821f68909d | ||
|
|
2b8dfed475 | ||
|
|
607b5ea766 | ||
|
|
88579cd71a | ||
|
|
6c57316ce6 | ||
|
|
6702683da3 | ||
|
|
1ed58586a1 | ||
|
|
f08ccd4fd8 | ||
|
|
312562a9f5 | ||
|
|
9e260a89af | ||
|
|
d233e4d22e | ||
|
|
23893dbcb9 | ||
|
|
506871b506 | ||
|
|
6115917660 | ||
|
|
21df8819d3 | ||
|
|
fb3f3e11f6 | ||
|
|
178c8942c3 | ||
|
|
51e747049d | ||
|
|
0582f7d694 | ||
|
|
fa7cac7538 | ||
|
|
9a314cfbc4 | ||
|
|
5941d0bf77 | ||
|
|
d326c1c25c | ||
|
|
96472a9a8f | ||
|
|
27252561e2 | ||
|
|
c9e732651f | ||
|
|
7849e7170d | ||
|
|
087894eb4e | ||
|
|
25f1b8c7a7 | ||
|
|
e71da1f14d | ||
|
|
938b14ba18 | ||
|
|
d6522d8f38 | ||
|
|
78eab890e7 | ||
|
|
1a56191f83 | ||
|
|
41c0f34d95 | ||
|
|
37bf205d7a | ||
|
|
aa1fa3eb9a | ||
|
|
0e2f8a612c | ||
|
|
465e7b2abc | ||
|
|
578fb45785 | ||
|
|
96995bbbe5 | ||
|
|
4cfdafebbc | ||
|
|
b97acb8ef5 | ||
|
|
d68d2dfdb6 | ||
|
|
39b269a454 | ||
|
|
ac081d3e10 | ||
|
|
5d4efb60cf | ||
|
|
cc408b980c | ||
|
|
59590b3ac9 | ||
|
|
ff759dacf3 | ||
|
|
a328e44130 | ||
|
|
7924cac5f9 | ||
|
|
1cef3b0c93 | ||
|
|
3cd59edc8b | ||
|
|
0d624af01d | ||
|
|
a09132570c | ||
|
|
ee3fc38432 | ||
|
|
dbf0192c8e | ||
|
|
6962cfc3f5 | ||
|
|
e096ec3b5b | ||
|
|
b30a74ae0c | ||
|
|
978eeb16c9 | ||
|
|
e5c9d91657 | ||
|
|
fa81c3a07a | ||
|
|
9cdd520d41 | ||
|
|
55d7898771 | ||
|
|
b8256bef97 | ||
|
|
5be9dc0b4a | ||
|
|
7d0be0cefb | ||
|
|
f7ce1edb13 | ||
|
|
5ad9280b60 | ||
|
|
2b353f1b20 | ||
|
|
75ab90b87b | ||
|
|
0219296120 | ||
|
|
20032b3a31 | ||
|
|
ea9e9a8c90 | ||
|
|
f7b0ee145b | ||
|
|
cc866738ee | ||
|
|
eadccf6e33 | ||
|
|
b70b66e567 | ||
|
|
5b6792dc20 | ||
|
|
f498e7343a | ||
|
|
6962f441e6 | ||
|
|
1def62b1b1 | ||
|
|
a4a4a6a185 | ||
|
|
d4c9469c1a | ||
|
|
3e2d4c5d7b | ||
|
|
d03f711d69 | ||
|
|
44dd8d9b96 | ||
|
|
549a3be0d8 | ||
|
|
1bb2edf8ec | ||
|
|
84c6f36315 |
241
Desktop.py
Normal file
241
Desktop.py
Normal file
@@ -0,0 +1,241 @@
|
||||
from esky.util import appdir_from_executable #@UnresolvedImport
|
||||
from threading import Thread
|
||||
from version import VERSION
|
||||
from wx.lib.softwareupdate import SoftwareUpdate
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import webbrowser
|
||||
import wx
|
||||
|
||||
# Include proper dirs
|
||||
if hasattr(sys, 'frozen'):
|
||||
import libs
|
||||
base_path = os.path.dirname(os.path.dirname(os.path.abspath(libs.__file__)))
|
||||
else:
|
||||
base_path = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
def icon():
|
||||
icon = 'icon_windows.png'
|
||||
if os.path.isfile('icon_mac.png'):
|
||||
icon = 'icon_mac.png'
|
||||
|
||||
return wx.Icon(icon, wx.BITMAP_TYPE_PNG)
|
||||
|
||||
lib_dir = os.path.join(base_path, 'libs')
|
||||
|
||||
sys.path.insert(0, base_path)
|
||||
sys.path.insert(0, lib_dir)
|
||||
|
||||
from couchpotato.environment import Env
|
||||
|
||||
class TaskBarIcon(wx.TaskBarIcon):
|
||||
|
||||
TBMENU_OPEN = wx.NewId()
|
||||
TBMENU_SETTINGS = wx.NewId()
|
||||
TBMENU_EXIT = wx.ID_EXIT
|
||||
|
||||
closed = False
|
||||
menu = False
|
||||
enabled = False
|
||||
|
||||
def __init__(self, frame):
|
||||
wx.TaskBarIcon.__init__(self)
|
||||
self.frame = frame
|
||||
|
||||
self.SetIcon(icon())
|
||||
|
||||
self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.OnTaskBarClick)
|
||||
self.Bind(wx.EVT_TASKBAR_RIGHT_UP, self.OnTaskBarClick)
|
||||
|
||||
self.Bind(wx.EVT_MENU, self.onOpen, id = self.TBMENU_OPEN)
|
||||
self.Bind(wx.EVT_MENU, self.onSettings, id = self.TBMENU_SETTINGS)
|
||||
self.Bind(wx.EVT_MENU, self.onTaskBarClose, id = self.TBMENU_EXIT)
|
||||
|
||||
def OnTaskBarClick(self, evt):
|
||||
menu = self.CreatePopupMenu()
|
||||
self.PopupMenu(menu)
|
||||
menu.Destroy()
|
||||
|
||||
def enable(self):
|
||||
self.enabled = True
|
||||
|
||||
if self.menu:
|
||||
self.open_menu.Enable(True)
|
||||
self.setting_menu.Enable(True)
|
||||
|
||||
self.open_menu.SetText('Open')
|
||||
|
||||
def CreatePopupMenu(self):
|
||||
|
||||
if not self.menu:
|
||||
self.menu = wx.Menu()
|
||||
self.open_menu = self.menu.Append(self.TBMENU_OPEN, 'Open')
|
||||
self.setting_menu = self.menu.Append(self.TBMENU_SETTINGS, 'About')
|
||||
self.exit_menu = self.menu.Append(self.TBMENU_EXIT, 'Quit')
|
||||
|
||||
if not self.enabled:
|
||||
self.open_menu.Enable(False)
|
||||
self.setting_menu.Enable(False)
|
||||
|
||||
self.open_menu.SetText('Loading...')
|
||||
|
||||
return self.menu
|
||||
|
||||
def onOpen(self, event):
|
||||
url = self.frame.parent.getSetting('base_url')
|
||||
webbrowser.open(url)
|
||||
|
||||
def onSettings(self, event):
|
||||
url = self.frame.parent.getSetting('base_url') + 'settings/about/'
|
||||
webbrowser.open(url)
|
||||
|
||||
def onTaskBarClose(self, evt):
|
||||
if self.closed:
|
||||
return
|
||||
|
||||
self.closed = True
|
||||
|
||||
self.RemoveIcon()
|
||||
wx.CallAfter(self.frame.Close)
|
||||
|
||||
|
||||
def makeIcon(self, img):
|
||||
if "wxMSW" in wx.PlatformInfo:
|
||||
img = img.Scale(16, 16)
|
||||
elif "wxGTK" in wx.PlatformInfo:
|
||||
img = img.Scale(22, 22)
|
||||
|
||||
icon = wx.IconFromBitmap(img.CopyFromBitmap())
|
||||
return icon
|
||||
|
||||
|
||||
class MainFrame(wx.Frame):
|
||||
|
||||
def __init__(self, parent):
|
||||
wx.Frame.__init__(self, None, style = wx.FRAME_NO_TASKBAR)
|
||||
|
||||
self.parent = parent
|
||||
self.tbicon = TaskBarIcon(self)
|
||||
|
||||
|
||||
class WorkerThread(Thread):
|
||||
|
||||
def __init__(self, desktop):
|
||||
Thread.__init__(self)
|
||||
self.daemon = True
|
||||
self._desktop = desktop
|
||||
|
||||
self.start()
|
||||
|
||||
def run(self):
|
||||
|
||||
# Get options via arg
|
||||
from couchpotato.runner import getOptions
|
||||
args = ['--quiet']
|
||||
self.options = getOptions(args)
|
||||
|
||||
# Load settings
|
||||
settings = Env.get('settings')
|
||||
settings.setFile(self.options.config_file)
|
||||
|
||||
# Create data dir if needed
|
||||
self.data_dir = os.path.expanduser(Env.setting('data_dir'))
|
||||
if self.data_dir == '':
|
||||
from couchpotato.core.helpers.variable import getDataDir
|
||||
self.data_dir = getDataDir()
|
||||
|
||||
if not os.path.isdir(self.data_dir):
|
||||
os.makedirs(self.data_dir)
|
||||
|
||||
# Create logging dir
|
||||
self.log_dir = os.path.join(self.data_dir, 'logs');
|
||||
if not os.path.isdir(self.log_dir):
|
||||
os.mkdir(self.log_dir)
|
||||
|
||||
try:
|
||||
from couchpotato.runner import runCouchPotato
|
||||
runCouchPotato(self.options, base_path, args, data_dir = self.data_dir, log_dir = self.log_dir, Env = Env, desktop = self._desktop)
|
||||
except:
|
||||
pass
|
||||
|
||||
self._desktop.frame.Close()
|
||||
self._desktop.ExitMainLoop()
|
||||
|
||||
|
||||
class CouchPotatoApp(wx.App, SoftwareUpdate):
|
||||
|
||||
settings = {}
|
||||
events = {}
|
||||
restart = False
|
||||
closing = False
|
||||
triggered_onClose = False
|
||||
|
||||
def OnInit(self):
|
||||
|
||||
# Updater
|
||||
base_url = 'https://api.couchpota.to/updates/%s'
|
||||
self.InitUpdates(base_url % VERSION + '/', 'https://couchpota.to/updates/%s' % 'changelog.html',
|
||||
icon = icon())
|
||||
|
||||
self.frame = MainFrame(self)
|
||||
self.frame.Bind(wx.EVT_CLOSE, self.onClose)
|
||||
|
||||
# CouchPotato thread
|
||||
self.worker = WorkerThread(self)
|
||||
|
||||
return True
|
||||
|
||||
def onAppLoad(self):
|
||||
self.frame.tbicon.enable()
|
||||
|
||||
def setSettings(self, settings = {}):
|
||||
self.settings = settings
|
||||
|
||||
def getSetting(self, name):
|
||||
return self.settings.get(name)
|
||||
|
||||
def addEvents(self, events = {}):
|
||||
for name in events.iterkeys():
|
||||
self.events[name] = events[name]
|
||||
|
||||
def onClose(self, event):
|
||||
|
||||
if not self.closing:
|
||||
self.closing = True
|
||||
self.frame.tbicon.onTaskBarClose(event)
|
||||
|
||||
onClose = self.events.get('onClose')
|
||||
if onClose and not self.triggered_onClose:
|
||||
self.triggered_onClose = True
|
||||
onClose(event)
|
||||
|
||||
def afterShutdown(self, restart = False):
|
||||
self.frame.Destroy()
|
||||
self.restart = restart
|
||||
self.ExitMainLoop()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
app = CouchPotatoApp(redirect = False)
|
||||
app.MainLoop()
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
if app.restart:
|
||||
|
||||
def appexe_from_executable(exepath):
|
||||
appdir = appdir_from_executable(exepath)
|
||||
exename = os.path.basename(exepath)
|
||||
|
||||
if sys.platform == "darwin":
|
||||
if os.path.isdir(os.path.join(appdir, "Contents", "MacOS")):
|
||||
return os.path.join(appdir, "Contents", "MacOS", exename)
|
||||
|
||||
return os.path.join(appdir, exename)
|
||||
|
||||
exe = appexe_from_executable(sys.executable)
|
||||
os.chdir(os.path.dirname(exe))
|
||||
|
||||
os.execv(exe, [exe] + sys.argv[1:])
|
||||
@@ -31,7 +31,7 @@ class Hadouken(DownloaderBase):
|
||||
log.error('Config properties are not filled in correctly, port is missing.')
|
||||
return False
|
||||
|
||||
if not self.conf('api_key'):
|
||||
if not self.conf('apikey'):
|
||||
log.error('Config properties are not filled in correctly, API key is missing.')
|
||||
return False
|
||||
|
||||
|
||||
@@ -38,12 +38,9 @@ def toUnicode(original, *args):
|
||||
try:
|
||||
detected = detect(original)
|
||||
try:
|
||||
if detected.get('confidence') > 0.8:
|
||||
return original.decode(detected.get('encoding'))
|
||||
return original.decode(detected.get('encoding'))
|
||||
except:
|
||||
pass
|
||||
|
||||
return ek(original, *args)
|
||||
return ek(original, *args)
|
||||
except:
|
||||
raise
|
||||
except:
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import os
|
||||
import traceback
|
||||
|
||||
from couchpotato import CPLog, md5
|
||||
from couchpotato import CPLog
|
||||
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
|
||||
from couchpotato.core.helpers.encoding import toUnicode
|
||||
from couchpotato.core.helpers.variable import getExt
|
||||
from couchpotato.core.plugins.base import Plugin
|
||||
import six
|
||||
|
||||
@@ -93,15 +92,7 @@ class MediaBase(Plugin):
|
||||
if not isinstance(image, (str, unicode)):
|
||||
continue
|
||||
|
||||
# Check if it has top image
|
||||
filename = '%s.%s' % (md5(image), getExt(image))
|
||||
existing = existing_files.get(file_type, [])
|
||||
has_latest = False
|
||||
for x in existing:
|
||||
if filename in x:
|
||||
has_latest = True
|
||||
|
||||
if not has_latest or file_type not in existing_files or len(existing_files.get(file_type, [])) == 0:
|
||||
if file_type not in existing_files or len(existing_files.get(file_type, [])) == 0:
|
||||
file_path = fireEvent('file.download', url = image, single = True)
|
||||
if file_path:
|
||||
existing_files[file_type] = [toUnicode(file_path)]
|
||||
|
||||
@@ -5,11 +5,6 @@ import time
|
||||
import traceback
|
||||
import xml.etree.ElementTree as XMLTree
|
||||
|
||||
try:
|
||||
from xml.etree.ElementTree import ParseError as XmlParseError
|
||||
except ImportError:
|
||||
from xml.parsers.expat import ExpatError as XmlParseError
|
||||
|
||||
from couchpotato.core.event import addEvent, fireEvent
|
||||
from couchpotato.core.helpers.encoding import ss
|
||||
from couchpotato.core.helpers.variable import tryFloat, mergeDicts, md5, \
|
||||
@@ -99,7 +94,7 @@ class Provider(Plugin):
|
||||
try:
|
||||
data = XMLTree.fromstring(ss(data))
|
||||
return self.getElements(data, item_path)
|
||||
except XmlParseError:
|
||||
except XMLTree.ParseError:
|
||||
log.error('Invalid XML returned, check "%s" manually for issues', url)
|
||||
except:
|
||||
log.error('Failed to parsing %s: %s', (self.getName(), traceback.format_exc()))
|
||||
|
||||
@@ -17,7 +17,7 @@ class Base(TorrentProvider):
|
||||
'login': 'https://www.torrentleech.org/user/account/login/',
|
||||
'login_check': 'https://torrentleech.org/user/messages',
|
||||
'detail': 'https://www.torrentleech.org/torrent/%s',
|
||||
'search': 'https://www.torrentleech.org/torrents/browse/index/query/%s/categories/%s',
|
||||
'search': 'https://www.torrentleech.org/torrents/browse/index/query/%s/categories/%d',
|
||||
'download': 'https://www.torrentleech.org%s',
|
||||
}
|
||||
|
||||
|
||||
@@ -13,12 +13,12 @@ log = CPLog(__name__)
|
||||
class Base(TorrentProvider):
|
||||
|
||||
urls = {
|
||||
'test': 'https://torrentshack.me/',
|
||||
'login': 'https://torrentshack.me/login.php',
|
||||
'login_check': 'https://torrentshack.me/inbox.php',
|
||||
'detail': 'https://torrentshack.me/torrent/%s',
|
||||
'search': 'https://torrentshack.me/torrents.php?action=advanced&searchstr=%s&scene=%s&filter_cat[%d]=1',
|
||||
'download': 'https://torrentshack.me/%s',
|
||||
'test': 'http://torrentshack.eu/',
|
||||
'login': 'http://torrentshack.eu/login.php',
|
||||
'login_check': 'http://torrentshack.eu/inbox.php',
|
||||
'detail': 'http://torrentshack.eu/torrent/%s',
|
||||
'search': 'http://torrentshack.eu/torrents.php?action=advanced&searchstr=%s&scene=%s&filter_cat[%d]=1',
|
||||
'download': 'http://torrentshack.eu/%s',
|
||||
}
|
||||
|
||||
http_time_between_calls = 1 # Seconds
|
||||
@@ -82,7 +82,7 @@ config = [{
|
||||
'tab': 'searcher',
|
||||
'list': 'torrent_providers',
|
||||
'name': 'TorrentShack',
|
||||
'description': '<a href="https://torrentshack.me/">TorrentShack</a>',
|
||||
'description': '<a href="http://torrentshack.eu/">TorrentShack</a>',
|
||||
'wizard': True,
|
||||
'icon': 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABmElEQVQoFQXBzY2cVRiE0afqvd84CQiAnxWWtyxsS6ThINBYg2Dc7mZBMEjE4mzs6e9WcY5+ePNuVFJJodQAoLo+SaWCy9rcV8cmjah3CI6iYu7oRU30kE5xxELRfamklY3k1NL19sSm7vPzP/ZdNZzKVDaY2sPZJBh9fv5ITrmG2+Vp4e1sPchVqTCQZJnVXi+/L4uuAJGly1+Pw8CprLbi8Om7tbT19/XRqJUk11JP9uHj9ulxhXbvJbI9qJvr5YkGXFG2IBT8tXczt+sfzDZCp3765f3t9tHEHGEDACma77+8o4oATKk+/PfW9YmHruRFjWoVSFsVsGu1YSKq6Oc37+n98unPZSRlY7vsKDqN+92X3yR9+PdXee3iJNKMStqdcZqoTJbUSi5JOkpfRlhSI0mSpEmCFKoU7FqSNOLAk54uGwCStMUCgLrVic62g7oDoFmmdI+P3S0pDe1xvDqb6XrZqbtzShWNoh9fv/XQHaDdM9OqrZi2M7M3UrB2vlkPS1IbdEBk7UiSoD6VlZ6aKWer4aH4f/AvKoHUTjuyAAAAAElFTkSuQmCC',
|
||||
'options': [
|
||||
|
||||
@@ -38,10 +38,10 @@ class Base(TorrentProvider):
|
||||
|
||||
search_url = self.urls['search'] % (domain, getIdentifier(movie))
|
||||
|
||||
data = self.getJsonData(search_url) or {}
|
||||
data = self.getJsonData(search_url)
|
||||
data = data.get('data')
|
||||
|
||||
if isinstance(data, dict) and data.get('movies'):
|
||||
if data and data.get('movies'):
|
||||
try:
|
||||
for result in data.get('movies'):
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import json
|
||||
import re
|
||||
import traceback
|
||||
|
||||
from couchpotato import Env
|
||||
from couchpotato.core.event import addEvent, fireEvent
|
||||
from couchpotato.core.helpers.encoding import tryUrlencode
|
||||
from couchpotato.core.helpers.variable import tryInt, tryFloat, splitString
|
||||
@@ -18,8 +17,8 @@ autoload = 'OMDBAPI'
|
||||
class OMDBAPI(MovieProvider):
|
||||
|
||||
urls = {
|
||||
'search': 'http://www.omdbapi.com/?type=movie&%s',
|
||||
'info': 'http://www.omdbapi.com/?type=movie&i=%s',
|
||||
'search': 'http://www.omdbapi.com/?%s',
|
||||
'info': 'http://www.omdbapi.com/?i=%s',
|
||||
}
|
||||
|
||||
http_time_between_calls = 0
|
||||
@@ -39,8 +38,7 @@ class OMDBAPI(MovieProvider):
|
||||
}
|
||||
|
||||
cache_key = 'omdbapi.cache.%s' % q
|
||||
url = self.urls['search'] % tryUrlencode({'t': name_year.get('name'), 'y': name_year.get('year', '')})
|
||||
cached = self.getCache(cache_key, url, timeout = 3, headers = {'User-Agent': Env.getIdentifier()})
|
||||
cached = self.getCache(cache_key, self.urls['search'] % tryUrlencode({'t': name_year.get('name'), 'y': name_year.get('year', '')}), timeout = 3)
|
||||
|
||||
if cached:
|
||||
result = self.parseMovie(cached)
|
||||
@@ -58,7 +56,7 @@ class OMDBAPI(MovieProvider):
|
||||
return {}
|
||||
|
||||
cache_key = 'omdbapi.cache.%s' % identifier
|
||||
cached = self.getCache(cache_key, self.urls['info'] % identifier, timeout = 3, headers = {'User-Agent': Env.getIdentifier()})
|
||||
cached = self.getCache(cache_key, self.urls['info'] % identifier, timeout = 3)
|
||||
|
||||
if cached:
|
||||
result = self.parseMovie(cached)
|
||||
|
||||
@@ -16,12 +16,12 @@ class TorrentLeech(MovieProvider, Base):
|
||||
([9], ['ts', 'tc']),
|
||||
([10], ['r5', 'scr']),
|
||||
([11], ['dvdrip']),
|
||||
([13, 14], ['brrip']),
|
||||
([14], ['brrip']),
|
||||
([12], ['dvdr']),
|
||||
]
|
||||
|
||||
def buildUrl(self, title, media, quality):
|
||||
return (
|
||||
tryUrlencode(title.replace(':', '')),
|
||||
','.join([str(x) for x in self.getCatId(quality)])
|
||||
self.getCatId(quality)[0]
|
||||
)
|
||||
|
||||
@@ -196,7 +196,7 @@ class Plugin(object):
|
||||
headers['Host'] = headers.get('Host', None)
|
||||
headers['User-Agent'] = headers.get('User-Agent', self.user_agent)
|
||||
headers['Accept-encoding'] = headers.get('Accept-encoding', 'gzip')
|
||||
headers['Connection'] = headers.get('Connection', 'keep-alive')
|
||||
headers['Connection'] = headers.get('Connection', 'close')
|
||||
headers['Cache-Control'] = headers.get('Cache-Control', 'max-age=0')
|
||||
|
||||
r = Env.get('http_opener')
|
||||
|
||||
@@ -240,7 +240,7 @@ class QualityPlugin(Plugin):
|
||||
|
||||
# Add additional size score if only 1 size validated
|
||||
if len(size_scores) == 1:
|
||||
self.calcScore(score, size_scores[0], 7)
|
||||
self.calcScore(score, size_scores[0], 8)
|
||||
del size_scores
|
||||
|
||||
# Return nothing if all scores are <= 0
|
||||
@@ -491,7 +491,6 @@ class QualityPlugin(Plugin):
|
||||
'Movie Name.2014.720p Web-Dl Aac2.0 h264-ReleaseGroup': {'size': 3800, 'quality': 'brrip'},
|
||||
'Movie Name.2014.720p.WEBRip.x264.AC3-ReleaseGroup': {'size': 3000, 'quality': 'scr'},
|
||||
'Movie.Name.2014.1080p.HDCAM.-.ReleaseGroup': {'size': 5300, 'quality': 'cam'},
|
||||
'Movie.Name.2014.720p.HDSCR.4PARTS.MP4.AAC.ReleaseGroup': {'size': 2401, 'quality': 'scr'},
|
||||
}
|
||||
|
||||
correct = 0
|
||||
|
||||
@@ -63,8 +63,8 @@ class Scanner(Plugin):
|
||||
}
|
||||
|
||||
file_sizes = { # in MB
|
||||
'movie': {'min': 200},
|
||||
'trailer': {'min': 2, 'max': 199},
|
||||
'movie': {'min': 300},
|
||||
'trailer': {'min': 2, 'max': 250},
|
||||
'backdrop': {'min': 0, 'max': 5},
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ autoload = 'Subtitle'
|
||||
|
||||
class Subtitle(Plugin):
|
||||
|
||||
services = ['opensubtitles', 'thesubdb', 'subswiki', 'subscenter']
|
||||
services = ['opensubtitles', 'thesubdb', 'subswiki', 'podnapisi', 'subscenter']
|
||||
|
||||
def __init__(self):
|
||||
addEvent('renamer.before', self.searchSingle)
|
||||
|
||||
BIN
icon_mac.png
Normal file
BIN
icon_mac.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 435 B |
BIN
icon_windows.png
Normal file
BIN
icon_windows.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 367 B |
52
installer.iss
Normal file
52
installer.iss
Normal file
@@ -0,0 +1,52 @@
|
||||
#define MyAppName "CouchPotato"
|
||||
#define MyAppVer "2.6.2"
|
||||
#define MyAppBit "win32"
|
||||
//#define MyAppBit "win-amd64"
|
||||
|
||||
[Setup]
|
||||
AppName={#MyAppName}
|
||||
AppVersion=2
|
||||
AppVerName={#MyAppName}
|
||||
DefaultDirName={userappdata}\{#MyAppName}\application
|
||||
DisableProgramGroupPage=yes
|
||||
DisableDirPage=yes
|
||||
UninstallDisplayIcon=./icon.ico
|
||||
SetupIconFile=./icon.ico
|
||||
OutputDir=./dist
|
||||
OutputBaseFilename={#MyAppName}-{#MyAppVer}.{#MyAppBit}.installer
|
||||
AppPublisher=Your Mom
|
||||
AppPublisherURL=http://couchpota.to
|
||||
PrivilegesRequired=none
|
||||
WizardSmallImageFile=installer_icon.bmp
|
||||
WizardImageFile=installer_banner.bmp
|
||||
UsePreviousAppDir=no
|
||||
|
||||
[Messages]
|
||||
WelcomeLabel1=Installing [name]!
|
||||
WelcomeLabel2=This wizard will install [name] to your AppData folder. It does this so it can use the build in updater without needing admin rights.
|
||||
|
||||
[CustomMessages]
|
||||
LaunchProgram=Launch {#MyAppName} right now.
|
||||
|
||||
[Files]
|
||||
Source: "./dist/{#MyAppName}-{#MyAppVer}.{#MyAppBit}/*"; Flags: recursesubdirs; DestDir: "{app}"
|
||||
|
||||
[Icons]
|
||||
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppName}.exe"
|
||||
Name: "{userstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppName}.exe"; Tasks: startup
|
||||
|
||||
[Tasks]
|
||||
Name: "startup"; Description: "Run {#MyAppName} at startup"; Flags: unchecked
|
||||
|
||||
[Run]
|
||||
Filename: {app}\{#MyAppName}.exe; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent
|
||||
|
||||
|
||||
[UninstallDelete]
|
||||
Type: filesandordirs; Name: "{app}\appdata"
|
||||
Type: filesandordirs; Name: "{app}\Microsoft.VC90.CRT"
|
||||
Type: filesandordirs; Name: "{app}\updates"
|
||||
Type: filesandordirs; Name: "{app}\CouchPotato*"
|
||||
Type: filesandordirs; Name: "{app}\python27.dll"
|
||||
Type: filesandordirs; Name: "{app}\unins000.dat"
|
||||
Type: filesandordirs; Name: "{app}\unins000.exe"
|
||||
BIN
installer_banner.bmp
Normal file
BIN
installer_banner.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 151 KiB |
BIN
installer_icon.bmp
Normal file
BIN
installer_icon.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.6 KiB |
133
setup.py
Normal file
133
setup.py
Normal file
@@ -0,0 +1,133 @@
|
||||
from esky import bdist_esky
|
||||
from setuptools import setup
|
||||
import os
|
||||
import sys
|
||||
import version
|
||||
|
||||
|
||||
# Include proper dirs
|
||||
base_path = os.path.dirname(os.path.abspath(__file__))
|
||||
lib_dir = os.path.join(base_path, 'libs')
|
||||
|
||||
sys.path.insert(0, base_path)
|
||||
sys.path.insert(0, lib_dir)
|
||||
|
||||
def getDataFiles(dirs):
|
||||
data_files = []
|
||||
for directory in dirs:
|
||||
for root, dirs, files in os.walk(directory):
|
||||
if files:
|
||||
for filename in files:
|
||||
if filename[:-4] is not '.pyc':
|
||||
data_files.append((root, [os.path.join(root, filename)]))
|
||||
|
||||
return data_files
|
||||
|
||||
includes = [
|
||||
'telnetlib',
|
||||
'xml.etree.ElementTree',
|
||||
'xml.etree.cElementTree',
|
||||
'xml.dom',
|
||||
'xml.dom.minidom',
|
||||
'netrc',
|
||||
'csv',
|
||||
'HTMLParser',
|
||||
'version',
|
||||
'distutils',
|
||||
'lxml', 'lxml.etree', 'lxml._elementpath', 'gzip',
|
||||
]
|
||||
|
||||
excludes = [
|
||||
'doctest',
|
||||
'pdb',
|
||||
'unittest',
|
||||
'difflib',
|
||||
'bsddb',
|
||||
'pywin.debugger', 'pywin.debugger.dbgcon', 'pywin.dialogs',
|
||||
'Tkconstants', 'Tkinter',
|
||||
'curses',
|
||||
'_gtkagg', '_tkagg',
|
||||
]
|
||||
|
||||
# Windows
|
||||
if sys.platform == "win32":
|
||||
import py2exe
|
||||
|
||||
sys.path.append('C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91')
|
||||
|
||||
FREEZER = 'py2exe'
|
||||
FREEZER_OPTIONS = dict(
|
||||
compressed = 0,
|
||||
bundle_files = 3,
|
||||
dll_excludes = [
|
||||
'msvcp90.dll',
|
||||
'msvcr90.dll',
|
||||
'msvcr71.dll',
|
||||
'mswsock.dll',
|
||||
'powrprof.dll',
|
||||
'USP10.dll',
|
||||
'libgdk-win32-2.0-0.dll',
|
||||
'libgobject-2.0-0.dll',
|
||||
'tcl84.dll',
|
||||
'tk84.dll'
|
||||
],
|
||||
packages = ['couchpotato', 'libs'],
|
||||
includes = includes,
|
||||
excludes = excludes,
|
||||
skip_archive = 1,
|
||||
)
|
||||
exeICON = os.path.join(base_path, 'icon.ico')
|
||||
DATA_FILES = getDataFiles([r'.\\couchpotato', r'.\\libs'])
|
||||
DATA_FILES.append('icon_windows.png')
|
||||
file_ext = 'win32.zip'
|
||||
|
||||
|
||||
# OSX
|
||||
elif sys.platform == "darwin":
|
||||
import py2app
|
||||
|
||||
FREEZER = 'py2app'
|
||||
FREEZER_OPTIONS = dict(
|
||||
arch = 'intel',
|
||||
optimize = 0,
|
||||
strip = True,
|
||||
argv_emulation = False,
|
||||
site_packages = False,
|
||||
iconfile = 'icon.icns',
|
||||
plist = dict(
|
||||
LSUIElement = True,
|
||||
),
|
||||
packages = ['couchpotato', 'libs'],
|
||||
includes = includes,
|
||||
excludes = excludes,
|
||||
)
|
||||
exeICON = None
|
||||
DATA_FILES = ['icon_mac.png']
|
||||
|
||||
file_ext = 'macosx-10_6-intel.zip'
|
||||
|
||||
# Common
|
||||
NAME = "CouchPotato"
|
||||
APP = [bdist_esky.Executable("Desktop.py", name = NAME, icon = exeICON, gui_only = True,)]
|
||||
ESKY_OPTIONS = dict(
|
||||
freezer_module = FREEZER,
|
||||
freezer_options = FREEZER_OPTIONS,
|
||||
bundle_msvcrt = True,
|
||||
)
|
||||
|
||||
# Build the app and the esky bundle
|
||||
setup(
|
||||
name = NAME,
|
||||
scripts = APP,
|
||||
version = version.VERSION,
|
||||
author = "Ruud",
|
||||
author_email = "info@couchpota.to",
|
||||
description = 'CouchPotato %s' % version.VERSION,
|
||||
data_files = DATA_FILES,
|
||||
options = dict(bdist_esky = ESKY_OPTIONS),
|
||||
)
|
||||
|
||||
#distpath = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'dist')
|
||||
#zipfilename = os.path.join(distpath, '%s-%s.%s' % (NAME, version.VERSION, file_ext))
|
||||
#zfile = zipfile.ZipFile(zipfilename, "r")
|
||||
#zfile.extractall(distpath)
|
||||
@@ -1,2 +1,2 @@
|
||||
VERSION = None
|
||||
BRANCH = 'develop'
|
||||
VERSION = '2.6.2'
|
||||
BRANCH = 'desktop'
|
||||
|
||||
Reference in New Issue
Block a user