From 2b073e5c8611bbbb80f32b3771f7a99ecd2b61fa Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 3 Aug 2023 23:58:07 +0300 Subject: 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 --- yeetube.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'yeetube.el') 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. -- cgit v1.2.3