commit f3609fac601b54d2d303f2588e6ec35858bbaa00
parent 2663f4a88905a632336b826779343e60765999d3
Author: noodle <noodle@pastanoggin.com>
Date: Thu, 25 Sep 2025 17:13:20 +0000
fix edge case where yt vid id starting with a - always fails to get a title
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mata_bot.pl b/mata_bot.pl
@@ -153,7 +153,7 @@ sub respond {
} elsif ($message =~ m,watch\?v=([a-zA-Z0-9_-]+),) {
# post youtube video titles from video ID
my $video_id = $1;
- my $response = HTTP::Tiny->new->get("https://fuyt.lab8.cz/?s=${video_id}&o=relevance");
+ my $response = HTTP::Tiny->new->get("https://fuyt.lab8.cz/?s=https%3A//www.youtube.com/watch%3Fv%3D${video_id}&o=relevance");
unless ($response->{success}) {
$reply = "failed to get title of youtube video ${video_id} ${MATA_DEAD} ($response->{status} $response->{reason}!)";
return $message, $reply;