diff options
author | Jesús <heckyel@hyperbola.info> | 2021-01-22 17:10:40 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-01-22 17:10:40 -0500 |
commit | 2e031a449a789fe086245620703b1ae46388e2f7 (patch) | |
tree | e0bf9214d7ec362c4488d52b3a2c5c55a8eac787 | |
parent | 8ad25fded8bb03324b237123efdefe5171c95bc7 (diff) | |
download | livie-2e031a449a789fe086245620703b1ae46388e2f7.tar.lz livie-2e031a449a789fe086245620703b1ae46388e2f7.tar.xz livie-2e031a449a789fe086245620703b1ae46388e2f7.zip |
Define default stream
-rw-r--r-- | livie.el | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -458,13 +458,18 @@ If ARG is given, make a new search." (if (equal (livie--get-entry-type (livie-get-current-video)) 'video) (let* ((video (livie-get-current-video)) (id (livie-video-id video)) - (quality-arg "") - (quality-val (completing-read "Max height resolution (0 for unlimited): " - '("0" "240" "360" "480" "720" "1080") + (quality-val (completing-read "Max height resolution for default is 480 (0 for unlimited): " + '("default" "0" "240" "360" "480" "720" "1080") nil nil))) - (setq quality-val (string-to-number quality-val)) - (when (< 0 quality-val) + + (if (not (equal quality-val "default")) + (setq quality-val (string-to-number quality-val)) + (setq quality-val 480)) + + (if (equal quality-val 0) + (setq quality-arg "") (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) (message "Opening [youtube] %s with height≤%s with mpv..." id quality-val)) (message "It's not a video"))) |