summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-08-03 23:58:07 +0300
committerThanos Apollo <[email protected]>2023-08-03 23:58:07 +0300
commit2b073e5c8611bbbb80f32b3771f7a99ecd2b61fa (patch)
tree7080fe116c6e3849c74e9adbe0e36e926a85d7a0
parent6dd1290ddb25bcce9263bfdd5983ec8c9b00e529 (diff)
Add yeetube-change-platform
Instead of having user just to use yeetube-change-query-url and be prompted with just a "URL: ", having predefined invidious instaces and options is a nice addition
-rw-r--r--yeetube.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/yeetube.el b/yeetube.el
index 2f08507..9ddcb30 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -444,6 +444,18 @@ prompt blank to keep the default name."
(when (string-suffix-p "/" yeetube-query-url)
(setq yeetube-query-url (substring yeetube-query-url 0 -1))))
+(defun yeetube-change-platform ()
+ "Change video platform."
+ (interactive)
+ (let ((platform (completing-read "Choose video platform: "
+ '("YouTube" "Invidious" "Localhost" "Custom"))))
+ (pcase platform
+ ("Invidious" (yeetube-change-query-url
+ (completing-read "Select Instance: " yeetube-invidious-instances)))
+ ("Localhost" (yeetube-change-query-url "localhost"))
+ ("YouTube" (yeetube-change-query-url "youtube.com"))
+ ("Custom" (yeetube-change-query-url (read-string "URL: "))))))
+
(defun yeetube-update-info (symbol-name new-value _operation _where)
"Update information for SYMBOL-NAME with NEW-VALUE.