shithub: wiki.9front.org

Download patch

ref: b7517f4da9d4c05fc57753d0583059b1184a3a5a
parent: 0feeea2db63be4a85143753952fb2927252a11d5
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Sep 16 08:09:22 EDT 2020

youtube: prefer av1/hd720 over other formats

--- a/youtube.md
+++ b/youtube.md
@@ -24,7 +24,19 @@
 
 	#!/bin/rc
 	rfork ne
-	vitag=`{youtubedr -info $"1 | awk '/av01/ { print $2; exit }'}
+	vitag=`{youtubedr -info $"1 | awk '
+		/av01/ {
+			tags[ntags++] = $2
+			if($2 == "398"){ # prefer hd720
+				tags[0] = $2
+				exit
+			}
+		}
+		END {
+			if(ntags > 0)
+				print tags[0]
+		}
+	'}
 	if(~ $#vitag 0)
 		treason `"{youtubedr -i 18 -o /tmp/_vid.mp4 $"1}
 	if not