summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-08-18 16:14:39 +0300
committerThanos Apollo <[email protected]>2023-08-18 16:14:39 +0300
commit2569efcc6aa157f99e528e8d9e492c4844799032 (patch)
tree467b6755e3ecfe50421b8526f7a5dba6c4c2d97e
parenta6b10db1cb7e911582a8c759b15b8691be515fdd (diff)
Rewrite yeetube-mpv-toggle-video
-rw-r--r--yeetube.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/yeetube.el b/yeetube.el
index 0b5528d..74ac8cf 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -258,11 +258,13 @@ Example Usage:
"Send KEY to mpv process."
(interactive "sKeypress: ")
(process-send-string "yeetube" key))
+
+(defun yeetube-mpv-toggle-video ()
"Toggle video on/off mpv."
(interactive)
- (unless (string-match "mpv" yeetube-player)
- (error "Not using mpv as yeetube-player"))
- (yeetube--send-command 'cycle 'video))
+ (process-send-string "yeetube" "_")
+ (message "yeetube: toggle video"))
+
;; Usually titles from youtube get messed up,
;; This should fix some of the common issues.
@@ -362,7 +364,8 @@ Example Usage:
(view-count (buffer-substring
(+ view-count-start 3)
(- view-count-end 1))))
- ;; Don't remove this!
+ ;; Don't remove this! It'll make it easier to scrape more
+ ;; info in the future
(search-backward "videoid")
;; show livestreams views as nil
(if (string-match-p "text" view-count)