summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-10-14 13:54:14 +0300
committerThanos Apollo <[email protected]>2023-10-17 09:24:21 +0300
commitc8175cb6977c5879392bf137f97cd4b8aae96b01 (patch)
treebf241841dbe58915d4d3647803f4151d276108fa
parent81d72a650564b719807aa16942145142d07d5fc0 (diff)
yeetube: Add yeetube-get
yeetube-get function accepts a keyword argument. Retrieves information for keyword from yeetube-content.
-rw-r--r--yeetube.el9
1 files changed, 9 insertions, 0 deletions
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="