From ba65700aad24f1306f1ac9b44c5ababc3bafcc2d Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 31 May 2014 23:46:34 +0200 Subject: [PATCH 1/6] Use textarea value for log posting --- couchpotato/core/plugins/log/static/log.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/plugins/log/static/log.js b/couchpotato/core/plugins/log/static/log.js index 8b97dab4..11acb5ca 100644 --- a/couchpotato/core/plugins/log/static/log.js +++ b/couchpotato/core/plugins/log/static/log.js @@ -210,7 +210,8 @@ Running on: ...\n\ version = Updater.getInfo(), body = self.report_text .replace('{issue}', text) - .replace('{version}', version ? version.version.repr : '...'); + .replace('{version}', version ? version.version.repr : '...'), + textarea; var overlay = new Element('div.report', { 'method': 'post', @@ -243,7 +244,7 @@ Running on: ...\n\ 'text': ' before posting, then copy the text below' }) ), - new Element('textarea', { + textarea = new Element('textarea', { 'text': body, 'events': { 'click': function(){ @@ -254,7 +255,17 @@ Running on: ...\n\ new Element('a.button', { 'target': '_blank', 'text': 'Create a new issue on GitHub with the text above', - 'href': 'https://github.com/RuudBurger/CouchPotatoServer/issues/new?body=' + (body.length < 2000 ? encodeURIComponent(body) : 'Paste the text here') + 'href': 'https://github.com/RuudBurger/CouchPotatoServer/issues/new', + 'events': { + 'click': function(e){ + (e).stop(); + + var body = textarea.get('value'), + bdy = '?body=' + (body.length < 2000 ? encodeURIComponent(body) : 'Paste the text here'), + win = window.open(e.target.get('href') + bdy, '_blank'); + win.focus(); + } + } }) ) ); From d6d0ff724a24cf85ddd6f5ea41c5ad6517f4186b Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 1 Jun 2014 00:11:09 +0200 Subject: [PATCH 2/6] Change label --- couchpotato/core/media/movie/_base/static/movie.actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchpotato/core/media/movie/_base/static/movie.actions.js b/couchpotato/core/media/movie/_base/static/movie.actions.js index 26ee2421..b3878fd5 100644 --- a/couchpotato/core/media/movie/_base/static/movie.actions.js +++ b/couchpotato/core/media/movie/_base/static/movie.actions.js @@ -252,7 +252,7 @@ MA.Release = new Class({ self.trynext_container.adopt( new Element('span.or', { - 'text': 'This movie is snatched, if anything went wrong, download' + 'text': 'If anything went wrong, download' }), lr ? new Element('a.button.orange', { 'text': 'the same release again', From 47749c2d73d27d7d80dd3416c95e8640b63f2bf3 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 1 Jun 2014 00:23:46 +0200 Subject: [PATCH 3/6] Transmission login failed. #1110 --- couchpotato/core/downloaders/transmission.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/downloaders/transmission.py b/couchpotato/core/downloaders/transmission.py index 49c8bc58..d941cca6 100644 --- a/couchpotato/core/downloaders/transmission.py +++ b/couchpotato/core/downloaders/transmission.py @@ -174,8 +174,8 @@ class TransmissionRPC(object): self.session = {} if username and password: password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() - password_manager.add_password(realm = None, uri = self.url, user = username, passwd = password) - opener = urllib2.build_opener(urllib2.HTTPBasicAuthHandler(password_manager), urllib2.HTTPDigestAuthHandler(password_manager)) + password_manager.add_password(realm = 'Transmission', uri = self.url, user = username, passwd = password) + opener = urllib2.build_opener(urllib2.HTTPBasicAuthHandler(password_manager)) opener.addheaders = [('User-agent', 'couchpotato-transmission-client/1.0')] urllib2.install_opener(opener) elif username or password: From a28ee58a1f793d6b463ef029901c8819b62ac712 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 1 Jun 2014 00:26:37 +0200 Subject: [PATCH 4/6] Remove digestauth header --- couchpotato/core/downloaders/utorrent.py | 1 - 1 file changed, 1 deletion(-) diff --git a/couchpotato/core/downloaders/utorrent.py b/couchpotato/core/downloaders/utorrent.py index 08b8d5a5..7ff5930d 100644 --- a/couchpotato/core/downloaders/utorrent.py +++ b/couchpotato/core/downloaders/utorrent.py @@ -229,7 +229,6 @@ class uTorrentAPI(object): password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() password_manager.add_password(realm = None, uri = self.url, user = username, passwd = password) self.opener.add_handler(urllib2.HTTPBasicAuthHandler(password_manager)) - self.opener.add_handler(urllib2.HTTPDigestAuthHandler(password_manager)) elif username or password: log.debug('User or password missing, not using authentication.') self.token = self.get_token() From e6b4d32506cd854cac42e416133a67135daa1ee8 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 1 Jun 2014 11:37:57 +0200 Subject: [PATCH 5/6] IMDB Watchlist count was off --- couchpotato/core/media/movie/providers/automation/imdb.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/media/movie/providers/automation/imdb.py b/couchpotato/core/media/movie/providers/automation/imdb.py index c66d7665..37d762bc 100644 --- a/couchpotato/core/media/movie/providers/automation/imdb.py +++ b/couchpotato/core/media/movie/providers/automation/imdb.py @@ -3,6 +3,7 @@ import re from bs4 import BeautifulSoup from couchpotato import fireEvent +from couchpotato.core.helpers.encoding import ss from couchpotato.core.helpers.rss import RSS from couchpotato.core.helpers.variable import getImdb, splitString, tryInt from couchpotato.core.logger import CPLog @@ -51,7 +52,7 @@ class IMDBBase(Automation, RSS): except: log.error('Failed parsing IMDB page "%s": %s', (url, traceback.format_exc())) - html = str(html) + html = ss(html) imdbs = getImdb(html, multiple = True) if html else [] return imdbs @@ -104,13 +105,14 @@ class IMDBWatchlist(IMDBBase): log.debug('Found %s movies on %s', (len(imdbs), w_url)) - if len(imdbs) < 250: + if len(imdbs) < 225: break - start += 250 + start = len(movies) except: log.error('Failed loading IMDB watchlist: %s %s', (watchlist_url, traceback.format_exc())) + break return movies From 27f331a1fc48c80b16ae6242e3581b0f25c35fe3 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 1 Jun 2014 14:30:45 +0200 Subject: [PATCH 6/6] Don't verify ssl for downloaders --- couchpotato/core/downloaders/nzbvortex.py | 4 ++-- couchpotato/core/downloaders/sabnzbd.py | 2 +- couchpotato/core/plugins/base.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/downloaders/nzbvortex.py b/couchpotato/core/downloaders/nzbvortex.py index 9094055f..92ece6d6 100644 --- a/couchpotato/core/downloaders/nzbvortex.py +++ b/couchpotato/core/downloaders/nzbvortex.py @@ -130,7 +130,7 @@ class NZBVortex(DownloaderBase): url = cleanHost(self.conf('host'), ssl = self.conf('ssl')) + 'api/' + call try: - data = self.urlopen('%s?%s' % (url, params), *args, **kwargs) + data = self.urlopen('%s?%s' % (url, params), *args, verify_ssl = False, **kwargs) if data: return json.loads(data) @@ -154,7 +154,7 @@ class NZBVortex(DownloaderBase): url = cleanHost(self.conf('host')) + 'api/app/apilevel' try: - data = self.urlopen(url, show_error = False) + data = self.urlopen(url, show_error = False, verify_ssl = False) self.api_level = float(json.loads(data).get('apilevel')) except URLError as e: if hasattr(e, 'code') and e.code == 403: diff --git a/couchpotato/core/downloaders/sabnzbd.py b/couchpotato/core/downloaders/sabnzbd.py index cd51cb87..57e1dca5 100644 --- a/couchpotato/core/downloaders/sabnzbd.py +++ b/couchpotato/core/downloaders/sabnzbd.py @@ -194,7 +194,7 @@ class Sabnzbd(DownloaderBase): 'output': 'json' })) - data = self.urlopen(url, timeout = 60, show_error = False, headers = {'User-Agent': Env.getIdentifier()}, **kwargs) + data = self.urlopen(url, timeout = 60, show_error = False, verify_ssl = False, headers = {'User-Agent': Env.getIdentifier()}, **kwargs) if use_json: d = json.loads(data) if d.get('error'): diff --git a/couchpotato/core/plugins/base.py b/couchpotato/core/plugins/base.py index f548cb29..dae522f4 100644 --- a/couchpotato/core/plugins/base.py +++ b/couchpotato/core/plugins/base.py @@ -161,7 +161,7 @@ class Plugin(object): log.error('Couldn\'t remove empty directory %s: %s', (folder, traceback.format_exc())) # http request - def urlopen(self, url, timeout = 30, data = None, headers = None, files = None, show_error = True): + def urlopen(self, url, timeout = 30, data = None, headers = None, files = None, show_error = True, verify_ssl = True): url = urllib2.quote(ss(url), safe = "%/:=&?~#+!$,;'@()*[]") if not headers: headers = {} @@ -200,6 +200,7 @@ class Plugin(object): 'data': data if len(data) > 0 else None, 'timeout': timeout, 'files': files, + 'verify': verify_ssl, } method = 'post' if len(data) > 0 or files else 'get'