ref: b4b066b67a91df416f2024fdfda4eb2f7377f150
parent: 27aef28612de0ccc6ad4dc354f71a84ec4410199
author: Sigrid Haflínudóttir <[email protected]>
date: Mon Sep 14 19:17:27 EDT 2020
youtube
--- a/howto.md
+++ b/howto.md
@@ -14,3 +14,5 @@
[Drawterm](drawterm.html)
[cwfs(4) tips and tricks](cwfs.html)
+
+[Youtube](youtube.html)
--- /dev/null
+++ b/youtube.md
@@ -1,0 +1,28 @@
+Youtube
+=======
+
+Commit [treason](https://git.sr.ht/~ft/treason).
+
+Install [youtubedr](https://github.com/ftrvxmtrx/youtubedr):
+
+ 9fs ftrv.se
+ gunzip /n/ftrv.se/bin/youtubedr.amd64.gz > $home/bin/amd64/youtubedr
+
+## Playing just audio alone
+
+ mcfs -t 1 `"{youtubedr -i 140 -o /tmp/audio.mp4 ybGOT4d2Hs8} | audio/aacdec > /dev/audio
+
+## Playing video and/or audio
+
+ #!/bin/rc
+ rfork ne
+ vitag=`{youtubedr -info $1 | awk '/av01/ { print $2; exit }'}
+ if(~ $#vitag 0)
+ mcfs -t 1 `"{youtubedr -i 140 -o /tmp/_aud.mp4 $1} | audio/aacdec > /dev/audio
+ if not
+ treason -a `"{youtubedr -i 140 -o /tmp/_aud.mp4 $1} `"{youtubedr -i $vitag -o /tmp/_vid.mp4 $1}
+ #rm -f /tmp/_^(aud vid)^.mp4
+
+## Caveats
+
+Many. Patches welcome.