|
13 | 13 | def apprise_custom_api_call_wrapper(body, title, notify_type, *args, **kwargs):
|
14 | 14 | import requests
|
15 | 15 | import json
|
| 16 | + from urllib.parse import unquote_plus |
16 | 17 | from apprise.utils import parse_url as apprise_parse_url
|
17 | 18 | from apprise import URLBase
|
18 | 19 |
|
@@ -47,22 +48,22 @@ def apprise_custom_api_call_wrapper(body, title, notify_type, *args, **kwargs):
|
47 | 48 | if results:
|
48 | 49 | # Add our headers that the user can potentially over-ride if they wish
|
49 | 50 | # to to our returned result set and tidy entries by unquoting them
|
50 |
| - headers = {URLBase.unquote(x): URLBase.unquote(y) |
| 51 | + headers = {unquote_plus(x): unquote_plus(y) |
51 | 52 | for x, y in results['qsd+'].items()}
|
52 | 53 |
|
53 | 54 | # https://github.com/caronc/apprise/wiki/Notify_Custom_JSON#get-parameter-manipulation
|
54 | 55 | # In Apprise, it relies on prefixing each request arg with "-", because it uses say &method=update as a flag for apprise
|
55 | 56 | # but here we are making straight requests, so we need todo convert this against apprise's logic
|
56 | 57 | for k, v in results['qsd'].items():
|
57 | 58 | if not k.strip('+-') in results['qsd+'].keys():
|
58 |
| - params[URLBase.unquote(k)] = URLBase.unquote(v) |
| 59 | + params[unquote_plus(k)] = unquote_plus(v) |
59 | 60 |
|
60 | 61 | # Determine Authentication
|
61 | 62 | auth = ''
|
62 | 63 | if results.get('user') and results.get('password'):
|
63 |
| - auth = (URLBase.unquote(results.get('user')), URLBase.unquote(results.get('user'))) |
| 64 | + auth = (unquote_plus(results.get('user')), unquote_plus(results.get('user'))) |
64 | 65 | elif results.get('user'):
|
65 |
| - auth = (URLBase.unquote(results.get('user'))) |
| 66 | + auth = (unquote_plus(results.get('user'))) |
66 | 67 |
|
67 | 68 | # Try to auto-guess if it's JSON
|
68 | 69 | h = 'application/json; charset=utf-8'
|
|
0 commit comments