diff options
author | Thanos Apollo <[email protected]> | 2023-09-28 14:45:40 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-09-28 14:45:40 +0300 |
commit | 9ac16334059f87ea8c4aecb1ffbe3e5c2d8dd79c (patch) | |
tree | 1b6189e60d2c23313b1abe7515aca61b941bb131 | |
parent | 19f07b95144834aae8ffb707f82b0e4b55a0f12d (diff) |
yeetube: Add yeetube-get-item
yeetube-get-item: Search for an item from youtube results, simplifying
yeetube-get-content
-rw-r--r-- | yeetube.el | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -226,8 +226,15 @@ WHERE indicates where in the buffer the update should happen." (yeetube-get-content-youtube) (yeetube-buffer-create query yeetube-content 'yeetube-mode))) - -(defun yeetube-get-content-youtube () +(defun yeetube-get-item (query) + "Get item from youtube results for QUERY. + +Video result starts with videorenderer. +Search back to videorenderer (start of video results), +then for item." + (search-backward "videorenderer" nil t) + (search-forward query nil t) + (search-forward "text" nil t)) "Get content from youtube." (setf yeetube-content nil) ;; we define these temp lists to keep tract of video-ids and |