summaryrefslogtreecommitdiff
path: root/bin/common/y2feed
diff options
context:
space:
mode:
Diffstat (limited to 'bin/common/y2feed')
-rwxr-xr-xbin/common/y2feed7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/common/y2feed b/bin/common/y2feed
index 8d2f9d9..196ecb7 100755
--- a/bin/common/y2feed
+++ b/bin/common/y2feed
@@ -1,9 +1,12 @@
#!/bin/sh
-ua="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36"
+ua="$(yt-dlp --dump-user-agent)"
test -z "${url:=$1}" &&
url="$(cat /dev/stdin)"
+url="http://youtube.com/$(echo "$url" |
+ awk -F '/' '{print $NF}')"
echo "url: $url" >&2
-curl -s -H "$ua" "$url"|
+
+curl -L -s -H "$ua" "$url" |
pup 'link[title=RSS] attr{href}'