aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-07-05 10:34:59 +0300
committerThanos Apollo <[email protected]>2023-07-05 18:14:01 +0300
commit980a73a228fdfe8a5b360ac5b9581fc30c19c6b2 (patch)
tree03ec5f2d8478000feaaf480920e7d2c5594da93e
parent264b9f14d90d6cdd7cf56c534d4f765642af381f (diff)
Add support for localhost
Check if url contains localhost, then ask for port
-rw-r--r--yeetube.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/yeetube.el b/yeetube.el
index c63b9ea..5af0873 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -295,7 +295,10 @@ then run this command interactively."
"Change yeetube-query-url."
(interactive)
(setq yeetube-query-url (read-string "URL: "))
- (unless (string-prefix-p "https://" yeetube-query-url)
+ (when (string-prefix-p "localhost" yeetube-query-url)
+ (setq port (read-string "Port: "))
+ (setq yeetube-query-url (concat "http://localhost:" port)))
+ (unless (string-prefix-p "http://" yeetube-query-url)
(setq yeetube-query-url (concat "https://" yeetube-query-url)))
(when (string-suffix-p "/" yeetube-query-url)
(setq yeetube-query-url (substring yeetube-query-url 0 -1))))