1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 19:41:55 +02:00

Requests project replace Snoopy project and update to MusicBrainz API v2

This commit is contained in:
Afterster 2013-12-26 16:54:04 +01:00
parent 1bbeee0ef4
commit a98ecd7376
122 changed files with 10860 additions and 6059 deletions

View file

@ -73,9 +73,9 @@ class Ampachelyricwiki {
public function get_lyrics($song) {
$uri = 'http://lyrics.wikia.com/api.php?action=lyrics&artist=' . urlencode($song->f_artist) . '&song=' . urlencode($song->title) . '&fmt=xml&func=getSong';
$response = PluginHelper::wsGet($uri);
if ($response['status'] == 200) {
$xml = simplexml_load_string($response['body']);
$request = Requests::get($uri);
if ($request->status_code == 200) {
$xml = simplexml_load_string($request->body);
if ($xml) {
if (!empty($xml->lyrics) && $xml->lyrics != "Not found") {
return array('text' => nl2br($xml->lyrics), 'url' => $xml->url);