From b1d69778cb8467b5a426b42f083d049d8b9e058b Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 13 Oct 2023 12:50:39 +0300 Subject: README: Add badge for self-hosted git --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 04ad99e..6998ecf 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![self-host-badge](https://img.shields.io/badge/Repository-Self_hosted-black?logo=git&logoColor=red)](https://git.thanosapollo.com/about) [![MELPA](https://melpa.org/packages/yeetube-badge.svg)](https://melpa.org/#/yeetube) # Yeetube | Emacs' Youtube Front End -- cgit v1.2.3 From 0509f298cbd87141a865890ea78295bdce59d33e Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 13 Oct 2023 16:07:10 +0300 Subject: yeetube-mpv-play-url: Rename to yeetube-mpv-play This function is not specific to just playing urls. User may make custom functions to play local files with it, thus the change of name. --- README.md | 2 +- yeetube-mpv.el | 9 ++++++--- yeetube.el | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6998ecf..f06c3d8 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ $ sudo apt install mpv yt-dlp ## Configuration ### Media Player -By default `yeetube-player` is set to `yeetube-mpv-play-url`, you can +By default `yeetube-player` is set to `yeetube-mpv-play`, you can use [mpv.el](https://github.com/kljohann/mpv.el), [GNU/Emms](https://www.gnu.org/software/emms/) or other similar packages like so: diff --git a/yeetube-mpv.el b/yeetube-mpv.el index 6c59552..22c78ae 100644 --- a/yeetube-mpv.el +++ b/yeetube-mpv.el @@ -50,11 +50,14 @@ (start-process-shell-command "yeetube" nil command)))) -(defun yeetube-mpv-play-url (url) - "Start yeetube process to play URL using mpv." +(defun yeetube-mpv-play (input) + "Start yeetube process to play INPUT using mpv. + +This function is not specific to just playing urls. Feel free to use +to play local files." (yeetube-mpv-process (concat yeetube-mpv-path " " - (shell-quote-argument url) + (shell-quote-argument input) (when yeetube-mpv-disable-video " --no-video"))) (message "yeetube: starting mpv process")) diff --git a/yeetube.el b/yeetube.el index 3b41587..6d4f898 100644 --- a/yeetube.el +++ b/yeetube.el @@ -53,7 +53,7 @@ :type 'natnump :group 'yeetube) -(defcustom yeetube-player #'yeetube-mpv-play-url +(defcustom yeetube-player #'yeetube-mpv-play "Select media player function." :type 'function :group 'yeetube) -- cgit v1.2.3 From 810ea52bc1aed75a18b560aafa076c3442983c5f Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 17:54:31 +0300 Subject: README: Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f06c3d8..a80ee28 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![self-host-badge](https://img.shields.io/badge/Repository-Self_hosted-black?logo=git&logoColor=red)](https://git.thanosapollo.com/about) +[![self-host-badge](https://img.shields.io/badge/Repository-Self_hosted-black?logo=git&logoColor=red)](https://git.thanosapollo.com/yeetube/about) [![MELPA](https://melpa.org/packages/yeetube-badge.svg)](https://melpa.org/#/yeetube) # Yeetube | Emacs' Youtube Front End -- cgit v1.2.3 From 81d72a650564b719807aa16942145142d07d5fc0 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 13:53:35 +0300 Subject: Add yeetube-url variable Avoid hardcoding youtube.com, user can change this to an invidious instance if they desire so --- yeetube.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yeetube.el b/yeetube.el index 6d4f898..f112db5 100644 --- a/yeetube.el +++ b/yeetube.el @@ -90,7 +90,10 @@ Example Usage: (defvar yeetube-last-played nil "Last played url.") -;; TODO: Rewrite without hardcoding youtube.com +(defvar yeetube-url "https://youtube.com/watch?v=" + "URL used to play videos from. + +You can change the value to an invidious instance.") (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 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(+) 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 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 From 2663fb204f19a618d8b9eb70212dc0723e966725 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 13:56:56 +0300 Subject: yeetube:(yeetube-get-content) Use keywords Rewrite yeetube-get-content to push content with keywords, retriving values easier --- yeetube.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yeetube.el b/yeetube.el index 5cd7a88..64d61a1 100644 --- a/yeetube.el +++ b/yeetube.el @@ -229,7 +229,11 @@ then for item." (yeetube-get-item "longbylinetext") ;; Channel Name (let ((channel (buffer-substring (+ (point) 3) (- (search-forward ",") 2)))) (push - `(,title ,videoid ,view-count ,video-duration ,channel) + (list :title title + :videoid videoid + :view-count view-count + :duration video-duration + :channel channel) yeetube-content)))))))))) (add-variable-watcher 'yeetube-saved-videos #'yeetube-update-saved-videos-list) -- cgit v1.2.3 From 512a9a3bb5953bc62cc263899d3a888dd87a2090 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 13:57:48 +0300 Subject: yeetube-buffer:(insert-content) Rewrite using keywords --- yeetube-buffer.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/yeetube-buffer.el b/yeetube-buffer.el index 565d192..0ef7134 100644 --- a/yeetube-buffer.el +++ b/yeetube-buffer.el @@ -183,12 +183,15 @@ Emojis cause formatting issues, this should be off by default." (defun yeetube-buffer-insert-content (content) "Insert formatted CONTENT." (insert - (concat (yeetube-buffer--format-title (yeetube-buffer-fix-title (car content))) - (yeetube-buffer--format-view-count (yeetube-buffer-view-count-add-commas - (yeetube-buffer-fix-view-count (nth 2 content)))) - (yeetube-buffer--format-video-duration (nth 3 content)) - (yeetube-buffer--format-channel (nth 4 content)) - "\n"))) + (concat + (yeetube-buffer--format-title (yeetube-buffer-fix-title + (cl-getf content :title))) + (yeetube-buffer--format-view-count (yeetube-buffer-view-count-add-commas + (yeetube-buffer-fix-view-count + (cl-getf content :view-count)))) + (yeetube-buffer--format-video-duration (cl-getf content :duration)) + (yeetube-buffer--format-channel (cl-getf content :channel)) + "\n"))) ;;;###autoload (defun yeetube-buffer-create (query content buffer-mode) -- cgit v1.2.3 From b954c2f124a94a5eae12b4439640a3c6bbabe72f Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 16:13:16 +0300 Subject: yeetube:(play-saved-video) Message the label of bookmarked URL --- yeetube.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yeetube.el b/yeetube.el index 64d61a1..d12e618 100644 --- a/yeetube.el +++ b/yeetube.el @@ -136,13 +136,16 @@ You can change the value to an invidious instance.") (url (yeetube-get-url))) (push (cons name url) yeetube-saved-videos))) +;; We could use keywords here, but it would break users saved videos +;; from previous versions. ;;;###autoload (defun yeetube-play-saved-video () "Select & Play a saved video." (interactive) (yeetube-load-saved-videos) (let ((video (completing-read "Select video: " yeetube-saved-videos nil t))) - (funcall yeetube-player (cdr (assoc video yeetube-saved-videos))))) + (funcall yeetube-player (cdr (assoc video yeetube-saved-videos))) + (message "Playing: %s" (car (assoc video yeetube-saved-videos))))) ;;;###autoload (defun yeetube-remove-saved-video () -- cgit v1.2.3 From 8e8985293ea73e15637f10a4c40c05b4cbbca97e Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 16:21:07 +0300 Subject: yeetube: Add yeetube--title-replacements Add variable to track unicode character replacements --- yeetube.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/yeetube.el b/yeetube.el index d12e618..d928b9f 100644 --- a/yeetube.el +++ b/yeetube.el @@ -214,6 +214,13 @@ then for item." (search-forward query nil t) (search-forward "text" nil t)) +(defvar yeetube--title-replacements + '(("&" . "&") + (""" . "\"") + ("'" . "'") + ("u0026" . "&") + ("\\\\" . "")) + "Unicode character replacements.") (defun yeetube-get-content () "Get content from youtube." (setf yeetube-content nil) -- cgit v1.2.3 From fbf3a9309e52913fc80e5a82a292ff75e54c5068 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 16:21:41 +0300 Subject: yeetube: Add yeetube--fix-title - Function that fixes scraped titles - Use in yeetube-get-content to push correct title values to yeetube-content --- yeetube.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/yeetube.el b/yeetube.el index d928b9f..3e6e761 100644 --- a/yeetube.el +++ b/yeetube.el @@ -221,6 +221,18 @@ then for item." ("u0026" . "&") ("\\\\" . "")) "Unicode character replacements.") + +;; Usually titles from youtube get messed up, +;; This should fix some of the common issues. +(defun yeetube---fix-title (title) + "Adjust TITLE." + (mapc (lambda (replacement) + (setf title (replace-regexp-in-string (car replacement) (cdr replacement) title))) + yeetube--title-replacements) + (if yeetube-buffer-display-emojis + title + (yeetube-buffer-strip-emojis title))) + (defun yeetube-get-content () "Get content from youtube." (setf yeetube-content nil) @@ -230,7 +242,8 @@ then for item." (let ((videoid (buffer-substring (+ (point) 3) (- (search-forward ",") 2)))) (unless (member videoid (car yeetube-content)) (yeetube-get-item "title") ;; Video Title - (let ((title (buffer-substring (+ (point) 3) (- (search-forward ",\"") 5)))) + (let ((title (yeetube---fix-title + (buffer-substring (+ (point) 3) (- (search-forward ",\"") 5))))) (unless (member title (car yeetube-content)) (yeetube-get-item "viewcounttext") ;; View Count (let ((view-count (buffer-substring (+ (point) 3) (- (search-forward " ") 0)))) -- cgit v1.2.3 From 787d24e4bc7acfe74923c341813d483544965b4c Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 16:23:20 +0300 Subject: yeetube-buffer: Remove (fix-title) Fix titles before they are pushed in yeetube-content with previous commit. --- yeetube-buffer.el | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/yeetube-buffer.el b/yeetube-buffer.el index 0ef7134..119c07f 100644 --- a/yeetube-buffer.el +++ b/yeetube-buffer.el @@ -75,22 +75,6 @@ Emojis cause formatting issues, this should be off by default." (equal (aref char-script-table c) 'emoji)) str)) -;; Usually titles from youtube get messed up, -;; This should fix some of the common issues. -(defun yeetube-buffer-fix-title (title) - "Adjust TITLE." - (let ((replacements '(("&" . "&") - (""" . "\"") - ("'" . "'") - ("u0026" . "&") - ("\\\\" . "")))) - (mapc (lambda (replacement) - (setf title (replace-regexp-in-string (car replacement) (cdr replacement) title))) - replacements) - (if yeetube-buffer-display-emojis - title - (yeetube-buffer-strip-emojis title)))) - (defun yeetube-buffer-fix-view-count (view-count) "Fix VIEW-COUNT display issues." (replace-regexp-in-string "[^0-9]" "" view-count)) @@ -184,8 +168,7 @@ Emojis cause formatting issues, this should be off by default." "Insert formatted CONTENT." (insert (concat - (yeetube-buffer--format-title (yeetube-buffer-fix-title - (cl-getf content :title))) + (yeetube-buffer--format-title (cl-getf content :title)) (yeetube-buffer--format-view-count (yeetube-buffer-view-count-add-commas (yeetube-buffer-fix-view-count (cl-getf content :view-count)))) -- cgit v1.2.3 From bba1a4c3481b8f29bb8735db9988ad2361e4e3bf Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 17:50:56 +0300 Subject: yeetube:(download-video) Message video title and download directory --- yeetube.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yeetube.el b/yeetube.el index 3e6e761..111f2a1 100644 --- a/yeetube.el +++ b/yeetube.el @@ -317,7 +317,8 @@ Optional values: (when (string-prefix-p "http" url) (let ((default-directory yeetube-download-directory)) (yeetube-download--ytdlp url nil yeetube-download-audio-format) - (message "Downloading %s " url))))) + (message "Downloading: '%s' at '%s'" + (yeetube-get :title) yeetube-download-directory))))) ;; TODO: Add option to use ffmpeg ;;;###autoload -- cgit v1.2.3 From 4da36672262962e8185349f568f25ae20b17c93a Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 14 Oct 2023 19:03:31 +0300 Subject: Update to version 2.0.7 --- yeetube.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yeetube.el b/yeetube.el index 111f2a1..1f990a9 100644 --- a/yeetube.el +++ b/yeetube.el @@ -5,7 +5,7 @@ ;; Author: Thanos Apollo ;; Keywords: extensions youtube videos ;; URL: https://git.thanosapollo.com/yeetube -;; Version: 2.0.6 +;; Version: 2.0.7 ;; Package-Requires: ((emacs "27.2")) -- cgit v1.2.3 From bf696e589431ebef3936c8f8764c501f2863d8a1 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 15 Oct 2023 12:44:50 +0300 Subject: Add yeetube-history Variable to track recently played content --- yeetube.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yeetube.el b/yeetube.el index 1f990a9..ecf3ba8 100644 --- a/yeetube.el +++ b/yeetube.el @@ -87,8 +87,8 @@ Example Usage: (defvar yeetube-saved-videos nil "Saved/bookmarked video urls.") -(defvar yeetube-last-played nil - "Last played url.") +(defvar yeetube-history nil + "Stored urls & titles of recently played content.") (defvar yeetube-url "https://youtube.com/watch?v=" "URL used to play videos from. -- cgit v1.2.3 From 5f60251c567730b554f87374119b5fc2eef8c426 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 15 Oct 2023 12:46:49 +0300 Subject: yeetube:(play) push url & title to yeetube-history - Keep track of played urls with video-titles by pushing them to yeetube-history. --- yeetube.el | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/yeetube.el b/yeetube.el index ecf3ba8..2769dff 100644 --- a/yeetube.el +++ b/yeetube.el @@ -105,16 +105,18 @@ You can change the value to an invidious instance.") (defun yeetube-get-url () "Get video url." - (let ((video-url (concat yeetube-url - (yeetube-get :videoid)))) + (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)) - (message "Playing: %s" (yeetube-get :title))) + (let ((video-url (yeetube-get-url)) + (video-title (yeetube-get :title))) + (funcall yeetube-player video-url) + (push (list :url video-url :title video-title) yeetube-history) + (message "Playing: %s" video-title))) (defun yeetube-load-saved-videos () "Load saved videos." @@ -226,12 +228,12 @@ then for item." ;; This should fix some of the common issues. (defun yeetube---fix-title (title) "Adjust TITLE." - (mapc (lambda (replacement) - (setf title (replace-regexp-in-string (car replacement) (cdr replacement) title))) - yeetube--title-replacements) - (if yeetube-buffer-display-emojis - title - (yeetube-buffer-strip-emojis title))) + (mapc (lambda (replacement) + (setf title (replace-regexp-in-string (car replacement) (cdr replacement) title))) + yeetube--title-replacements) + (if yeetube-buffer-display-emojis + title + (yeetube-buffer-strip-emojis title))) (defun yeetube-get-content () "Get content from youtube." -- cgit v1.2.3 From 67cbf8ab8b76daef17549a4f562c79a930b7b6fe Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 15 Oct 2023 16:47:30 +0300 Subject: yeetube:(get) Fix error messages Report back value in quotes --- yeetube.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yeetube.el b/yeetube.el index 2769dff..01b747d 100644 --- a/yeetube.el +++ b/yeetube.el @@ -98,7 +98,7 @@ 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)) + (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)) -- cgit v1.2.3 From f3196c8ecc11a425014358382811976ec5d68ce3 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 16 Oct 2023 08:44:40 +0300 Subject: yeetube:(get) Update docstring --- yeetube.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/yeetube.el b/yeetube.el index 01b747d..7ca9729 100644 --- a/yeetube.el +++ b/yeetube.el @@ -96,7 +96,17 @@ Example Usage: You can change the value to an invidious instance.") (defun yeetube-get (keyword) - "Retrieve KEYWORD value from `yeetube-content'." + "Retrieve KEYWORD value for entry at point. + +Retrieve keyword value for entry at point, from `yeetube-content', in +*yeetube* buffer. + +Keywords: +- :title +- :videoid +- :view-count +- :duration +- :channel" (unless (keywordp keyword) (error "Value `%s' is not a keyword" keyword)) (let ((video-info -- cgit v1.2.3 From af7eafc4c4d9106614d998ec553013431e68e749 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 16 Oct 2023 15:14:40 +0300 Subject: yeetube:(feature) Add yeetube-replay Replay history entry --- yeetube.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/yeetube.el b/yeetube.el index 7ca9729..74fa05b 100644 --- a/yeetube.el +++ b/yeetube.el @@ -128,6 +128,19 @@ Keywords: (push (list :url video-url :title video-title) yeetube-history) (message "Playing: %s" video-title))) +;;;###autoload +(defun yeetube-replay () + "Select entry from history to replay. + +Select entry title from yeetube-history and play corresponding URL." + (interactive) + (let* ((titles (mapcar (lambda (entry) (cl-getf entry :title)) yeetube-history)) + (selected (completing-read "Replay: " titles)) + (selected-entry (cl-find-if (lambda (entry) (string= selected (cl-getf entry :title))) yeetube-history)) + (url (cl-getf selected-entry :url))) + (funcall yeetube-player url) + (message "Replaying: %s" selected))) + (defun yeetube-load-saved-videos () "Load saved videos." (let ((file-path (concat user-emacs-directory "yeetube"))) -- cgit v1.2.3 From 1b4a3c46643cf08cf867d632078eaff446f2dd0c Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 16 Oct 2023 15:15:11 +0300 Subject: yeetube:(mode-map) Add yeetube-search & yeetube-replay --- README.md | 2 +- yeetube.el | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a80ee28..1b564de 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ displayed in a proced-like buffer. Package functionality includes: -- Search Youtube for query +- Query YouTube - Play video url *by default using mpv* - Bookmark/Save video url - Download video *using yt-dlp* diff --git a/yeetube.el b/yeetube.el index 74fa05b..7edfcd8 100644 --- a/yeetube.el +++ b/yeetube.el @@ -30,7 +30,7 @@ ;; ;; Basic functionality includes: ;; -;; - Search Youtube for query +;; - Query YouTube ;; - Play video url by default using mpv ;; - Bookmark/Save video url ;; - Download video using yt-dlp @@ -369,6 +369,7 @@ prompt blank to keep the default name." ;; Yeetube Mode (defvar yeetube-mode-map (make-sparse-keymap)) (define-key yeetube-mode-map (kbd "RET") #'yeetube-play) +(define-key yeetube-mode-map (kbd "M-RET") #'yeetube-search) (define-key yeetube-mode-map (kbd "b") #'yeetube-browse-url) (define-key yeetube-mode-map (kbd "d") #'yeetube-download-video) (define-key yeetube-mode-map (kbd "D") #'yeetube-download-change-directory) @@ -378,6 +379,7 @@ prompt blank to keep the default name." (define-key yeetube-mode-map (kbd "s") #'yeetube-save-video) (define-key yeetube-mode-map (kbd "P") #'yeetube-play-saved-video) (define-key yeetube-mode-map (kbd "q") #'quit-window) +(define-key yeetube-mode-map (kbd "r") #'yeetube-replay) (define-derived-mode yeetube-mode special-mode "Yeetube" "Yeetube mode." -- cgit v1.2.3