forgottenweapons: use http-user-agent. - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit a94e0bf1349495148cfdcf94bba43a12dcf39367
(DIR) parent 738fe32144c11085af506b996a931c95edd63e36
(HTM) Author: eidolon <?>
Date: Wed, 16 Oct 2024 12:44:33 -0400
forgottenweapons: use http-user-agent.
Signed-off-by: Annna Robert-Houdin <annna@bitreich.org>
Diffstat:
M annna-message-common | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/annna-message-common b/annna-message-common
@@ -165,7 +165,8 @@ case "${text}" in
fi
;;
*www.forgottenweapons.com/*)
- resp=$(curl -sgfm 5 "$uri" | sed -n '/<meta name="description"/ s/.*\(https:\/\/youtu\.be\/[-A-Za-z0-9_]\{11\}\).*/\1/p')
+ ua="$(http-user-agent)"
+ resp=$(curl -A "$ua" -sgfm 5 "$uri" | sed -n '/<meta name="description"/ s/.*\(https:\/\/youtu\.be\/[-A-Za-z0-9_]\{11\}\).*/\1/p')
[ -n "$resp" ] && nuris="video: ytdl://${resp##*/}"
;;
*www.wsj.com/*|*www.ft.com/*|*www.nytimes.com/*)