3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 11:12:42 +01:00

modules/get_title.pl: Fix Twitter URL titles

This commit is contained in:
Pragmatic Software 2021-06-11 14:57:29 -07:00
parent ade9f1e2c2
commit 06d0951e2a

View File

@ -25,6 +25,7 @@ print STDERR "nick: [$nick], args: [$arguments]\n";
$arguments =~ s/\W$//; $arguments =~ s/\W$//;
exit if $arguments =~ m{https?://matrix\.to}i;
exit if $arguments =~ m{https?://.*\.c$}i; exit if $arguments =~ m{https?://.*\.c$}i;
exit if $arguments =~ m{https?://.*\.h$}i; exit if $arguments =~ m{https?://.*\.h$}i;
exit if $arguments =~ m{https?://ibb.co/}i; exit if $arguments =~ m{https?://ibb.co/}i;
@ -92,7 +93,7 @@ exit if $arguments =~ m/paste.*\.(?:com|org|net|ch|ca|de|uk|info)/i;
exit if $arguments =~ m/pasting.*\.(?:com|org|net|ca|de|uk|info|ch)/i; exit if $arguments =~ m/pasting.*\.(?:com|org|net|ca|de|uk|info|ch)/i;
my $ua = LWP::UserAgent->new; my $ua = LWP::UserAgent->new;
if ($arguments =~ /youtube|youtu.be|googlevideo/) { if ($arguments =~ /youtube|youtu.be|googlevideo|twitter/) {
$ua->agent("Googlebot"); $ua->agent("Googlebot");
$ua->max_size(1200 * 1024); $ua->max_size(1200 * 1024);
} else { } else {