From 945f8970c2935da326125e30a6d9289dc98a2ddd Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 13:56:01 +0300 Subject: yeetube:(yeetube-get-url) Rewrite to use yeetube-get Rewrite yeetube-get-url to use (yeetube-get :videoid), as well as using yeetube-url variable instead of hardcoding youtube value --- yeetube.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/yeetube.el b/yeetube.el index d6c44ed..5cd7a88 100644 --- a/yeetube.el +++ b/yeetube.el @@ -104,16 +104,17 @@ You can change the value to an invidious instance.") video-info)) (defun yeetube-get-url () - "Get url for subject in *yeetube* buffer at point." - (let ((video-url (concat "https://youtube.com/watch?v=" - (cadr (nth (- (line-number-at-pos) 1) (reverse yeetube-content)))))) + "Get video url." + (let ((video-url (concat yeetube-url + (yeetube-get :videoid)))) video-url)) ;;;###autoload (defun yeetube-play () "Play video at point in *yeetube* buffer." (interactive) - (funcall yeetube-player (yeetube-get-url))) + (funcall yeetube-player (yeetube-get-url)) + (message "Playing: %s" (yeetube-get :title))) (defun yeetube-load-saved-videos () "Load saved videos." -- cgit v1.2.3