From c8175cb6977c5879392bf137f97cd4b8aae96b01 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 13:54:14 +0300 Subject: yeetube: Add yeetube-get yeetube-get function accepts a keyword argument. Retrieves information for keyword from yeetube-content. --- yeetube.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'yeetube.el') diff --git a/yeetube.el b/yeetube.el index f112db5..d6c44ed 100644 --- a/yeetube.el +++ b/yeetube.el @@ -94,6 +94,15 @@ Example Usage: "URL used to play videos from. You can change the value to an invidious instance.") + +(defun yeetube-get (keyword) + "Retrieve KEYWORD value from `yeetube-content'." + (unless (keywordp keyword) + (error "Value %s is not a keyword" keyword)) + (let ((video-info + (cl-getf (nth (- (line-number-at-pos) 1) (reverse yeetube-content)) keyword))) + video-info)) + (defun yeetube-get-url () "Get url for subject in *yeetube* buffer at point." (let ((video-url (concat "https://youtube.com/watch?v=" -- cgit v1.2.3