Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 330a92fe rédigé par Alexandre Morignot's avatar Alexandre Morignot
Parcourir les fichiers

feat(sites): remove delegation to external process

This delegation is now done in an upper level.
parent ff4f4f57
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -22,28 +22,6 @@ our $log; ...@@ -22,28 +22,6 @@ our $log;
our $regex; our $regex;
our $playbot_api_key; our $playbot_api_key;
sub external_parse {
my $url = shift;
my $content = `./PlayBot.go "$url"`;
if ( $? >> 8 != 0 ) {
die "Error";
}
my ( $matched_url, $external_id, $url, $title, $author, $duration ) =
split( /\n/, $content );
return (
author => $author,
external_id => $external_id,
duration => $duration,
matched_url => $matched_url,
playlist => 0,
site => 'soundcloud',
title => $title,
url => $url,
);
}
sub parse { sub parse {
my ( $kernel, $user, $chan, $msg, $playlist ) = @_; my ( $kernel, $user, $chan, $msg, $playlist ) = @_;
...@@ -56,8 +34,6 @@ sub parse { ...@@ -56,8 +34,6 @@ sub parse {
my $matching_url; my $matching_url;
my @matching_tags; my @matching_tags;
eval { %content = external_parse($msg) };
if ($@) {
# parsing # parsing
foreach my $site ( __PACKAGE__->sites ) { foreach my $site ( __PACKAGE__->sites ) {
if ( not grep { $site eq "PlayBot::sites::$_" } @{ $chan_conf->sites } ) { if ( not grep { $site eq "PlayBot::sites::$_" } @{ $chan_conf->sites } ) {
...@@ -86,10 +62,6 @@ sub parse { ...@@ -86,10 +62,6 @@ sub parse {
$log->warning($@); $log->warning($@);
return; return;
} }
} else {
$matching_url = $content{matched_url};
delete $content{matched_url};
}
my $id; my $id;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter