repo: music
action: commit
revision: 
path_from: 
revision_from: 949cb2fa84dfc98716d8f2329c7dd52699265d39:
path_to: 
revision_to: 
git.thebackupbox.net
music
git clone git://git.thebackupbox.net/music
commit 949cb2fa84dfc98716d8f2329c7dd52699265d39
Author: epoch 
Date:   Mon Dec 16 03:15:16 2019 -0600

    added ability for music-player to call external program on URLs... it adds a dependency of uritools though. comment out if you do not have it I guess. should error around it if you do not have it anyway.

diff --git a/music-player b/music-player
index 7910014358f36714695508ba55c0299677c2cce8..
index ..ead132abc1b45d10b665934c53bb39132d4305bb 100755
--- a/music-player
+++ b/music-player
@@ -1,3 +1,7 @@
 #!/bin/bash
+if printf "%s\n" "$1" | urimatch -D youtube.com >/dev/null;then
+  music-setnowplaying "$(urititle "$1")" & #toss this in background so it won't hold up the song playing.
+  exec youtube "$1"
+fi
 music-setnowplaying "$(music-fileinfo "$1")"
 exec mpv --no-video --no-terminal "$1"
diff --git a/youtube b/youtube
new file mode 100755
index 0000000000000000000000000000000000000000..c24ff9d1bbdae6e2c6f4ba9981ae229d39fc24b3
--- /dev/null
+++ b/youtube
@@ -0,0 +1,2 @@
+#!/bin/sh
+stdbuf -o0 youtube-dl --audio-format opus "$1" -o - | mpv --no-video -

-----END OF PAGE-----