@ -0,0 +1,14 @@ |
|||
#So you feel like posting a bug, sending me a pull request or just telling me how awesome I am. No problem! |
|||
|
|||
##Just make sure you think of the following things: |
|||
|
|||
* Search through the existing (and closed) issues first. See if you can get your answer there. |
|||
* Double check the result manually, because it could be an external issue. |
|||
* Post logs! Without seeing what is going on, I can't reproduce the error. |
|||
* What are you settings for the specific problem |
|||
* What providers are you using. (While your logs include these, scanning through hundred of lines of log isn't my hobby) |
|||
* Give me a short step by step of how to reproduce |
|||
* What hardware / OS are you using and what are the limits? NAS can be slow and maybe have a different python installed then when you use CP on OSX or Windows for example. |
|||
* I will mark issues with the "can't reproduce" tag. Don't go asking me "why closed" if it clearly says the issue in the tag ;) |
|||
|
|||
**If I don't get enough info, the change of the issue getting closed is a lot bigger ;)** |
@ -1,39 +1,35 @@ |
|||
from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode |
|||
from couchpotato.core.helpers.encoding import toUnicode |
|||
from couchpotato.core.logger import CPLog |
|||
from couchpotato.core.notifications.base import Notification |
|||
from httplib import HTTPSConnection |
|||
import traceback |
|||
|
|||
log = CPLog(__name__) |
|||
|
|||
|
|||
class Prowl(Notification): |
|||
|
|||
urls = { |
|||
'api': 'https://api.prowlapp.com/publicapi/add' |
|||
} |
|||
|
|||
def notify(self, message = '', data = {}, listener = None): |
|||
if self.isDisabled(): return |
|||
|
|||
http_handler = HTTPSConnection('api.prowlapp.com') |
|||
|
|||
data = { |
|||
'apikey': self.conf('api_key'), |
|||
'application': self.default_title, |
|||
'description': toUnicode(message), |
|||
'priority': self.conf('priority'), |
|||
} |
|||
headers = { |
|||
'Content-type': 'application/x-www-form-urlencoded' |
|||
} |
|||
|
|||
http_handler.request('POST', |
|||
'/publicapi/add', |
|||
headers = {'Content-type': 'application/x-www-form-urlencoded'}, |
|||
body = tryUrlencode(data) |
|||
) |
|||
response = http_handler.getresponse() |
|||
request_status = response.status |
|||
|
|||
if request_status == 200: |
|||
try: |
|||
self.urlopen(self.urls['api'], headers = headers, params = data, multipart = True, show_error = False) |
|||
log.info('Prowl notifications sent.') |
|||
return True |
|||
elif request_status == 401: |
|||
log.error('Prowl auth failed: %s', response.reason) |
|||
return False |
|||
else: |
|||
log.error('Prowl notification failed.') |
|||
except: |
|||
log.error('Prowl failed: %s', traceback.format_exc()) |
|||
|
|||
return False |
|||
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 573 B |
Before Width: | Height: | Size: 451 B After Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 220 B |
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 624 B After Width: | Height: | Size: 511 B |
Before Width: | Height: | Size: 840 B After Width: | Height: | Size: 763 B |
Before Width: | Height: | Size: 757 B After Width: | Height: | Size: 690 B |
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 724 B |
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 568 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 435 B |
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 585 B |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 151 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.8 KiB |