diff --git a/PlayBot/sites/soundcloud.pm b/PlayBot/sites/soundcloud.pm index 2e15419c5805e4b2df2be1b5e4929315f247ec59..e6c2126d967364646e93a16a84c674dfa55fd880 100644 --- a/PlayBot/sites/soundcloud.pm +++ b/PlayBot/sites/soundcloud.pm @@ -102,14 +102,18 @@ sub get { shift; my $id = shift; + my $response; + $log->info("the id is ".$id); + + my $content = `./soundcloud $id`; + my ($external_id, $url, $title, $author, $duration) = split(/\n/, $content); + +=cut my $ua = LWP::UserAgent->new( timeout => 30, env_proxy => 1, ); - my $response; - $log->info("the id is ".$id); - if (looks_like_number($id)) { $response = $ua->get( @@ -141,6 +145,16 @@ sub get { if ($content->{'downloadable'}) { $infos->{'ddl'} = $content->{'download_url'}; } +=cut + + my $infos = { + author => $author, + external_id => $external_id, + duration => $duration, + site => 'soundcloud', + title => $title, + url => $url, + }; return %$infos; }