Define default stream
This commit is contained in:
parent
8ad25fded8
commit
2e031a449a
13
livie.el
13
livie.el
@ -458,13 +458,18 @@ If ARG is given, make a new search."
|
|||||||
(if (equal (livie--get-entry-type (livie-get-current-video)) 'video)
|
(if (equal (livie--get-entry-type (livie-get-current-video)) 'video)
|
||||||
(let* ((video (livie-get-current-video))
|
(let* ((video (livie-get-current-video))
|
||||||
(id (livie-video-id video))
|
(id (livie-video-id video))
|
||||||
(quality-arg "")
|
(quality-val (completing-read "Max height resolution for default is 480 (0 for unlimited): "
|
||||||
(quality-val (completing-read "Max height resolution (0 for unlimited): "
|
'("default" "0" "240" "360" "480" "720" "1080")
|
||||||
'("0" "240" "360" "480" "720" "1080")
|
|
||||||
nil nil)))
|
nil nil)))
|
||||||
|
|
||||||
|
(if (not (equal quality-val "default"))
|
||||||
(setq quality-val (string-to-number quality-val))
|
(setq quality-val (string-to-number quality-val))
|
||||||
(when (< 0 quality-val)
|
(setq quality-val 480))
|
||||||
|
|
||||||
|
(if (equal quality-val 0)
|
||||||
|
(setq quality-arg "")
|
||||||
(setq quality-arg (format "--ytdl-format=[height<=?%s]" quality-val)))
|
(setq quality-arg (format "--ytdl-format=[height<=?%s]" quality-val)))
|
||||||
|
|
||||||
(start-process "livie-mpv" nil "mpv" (format "https://www.youtube.com/watch?v=%s" id) quality-arg)
|
(start-process "livie-mpv" nil "mpv" (format "https://www.youtube.com/watch?v=%s" id) quality-arg)
|
||||||
(message "Opening [youtube] %s with height≤%s with mpv..." id quality-val))
|
(message "Opening [youtube] %s with height≤%s with mpv..." id quality-val))
|
||||||
(message "It's not a video")))
|
(message "It's not a video")))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user