summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgeeseven <2334728+geeseven@users.noreply.github.com>2021-01-02 07:39:47 -0600
committergeeseven <2334728+geeseven@users.noreply.github.com>2021-01-02 07:39:47 -0600
commit576de1aa18f76630fdf46ab248bd689786f1d161 (patch)
tree97db3c1dc9d4d50060c29bf9172415356e7c5519
parent6ade0c3bd4c262cce1b1f42a17ae2163ea803c16 (diff)
downloadqutebrowser-576de1aa18f76630fdf46ab248bd689786f1d161.tar.gz
qutebrowser-576de1aa18f76630fdf46ab248bd689786f1d161.zip
clean up URL encoding
-rwxr-xr-xmisc/userscripts/add-nextcloud-bookmarks8
1 files changed, 5 insertions, 3 deletions
diff --git a/misc/userscripts/add-nextcloud-bookmarks b/misc/userscripts/add-nextcloud-bookmarks
index cace1fd32..5da887086 100755
--- a/misc/userscripts/add-nextcloud-bookmarks
+++ b/misc/userscripts/add-nextcloud-bookmarks
@@ -42,7 +42,7 @@ from os import environ, path
from sys import argv, exit
from PyQt5.QtWidgets import QApplication, QInputDialog, QLineEdit
-from requests import get, post, utils
+from requests import get, post
from requests.auth import HTTPBasicAuth
@@ -120,14 +120,16 @@ tags = settings["tags"].split(",")
QUTE_URL = environ["QUTE_URL"]
api_url = settings["host"] + "/index.php/apps/bookmarks/public/rest/v2/bookmark"
-headers = {"Content-Type": "application/json"}
auth = HTTPBasicAuth(settings["user"], settings["password"])
+headers = {"Content-Type": "application/json"}
+params = {"url": QUTE_URL}
# check if there is already a bookmark for the URL
r = get(
- "{}?url={}".format(api_url, utils.quote(QUTE_URL, safe="")),
+ api_url,
auth=auth,
headers=headers,
+ params=params,
timeout=(3.05, 27),
)
if r.status_code != 200: