From 492cb3104fabe1b54f360d2a0ea57de60674f404 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Wed, 8 Nov 2023 22:02:10 +0100 Subject: Updated 7 files, added android/app/release/app-release.apk.zip and renamed android/app/release/app-release.apka (automated) --- api/lyrics.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'api') diff --git a/api/lyrics.php b/api/lyrics.php index d72a17c..74503dc 100644 --- a/api/lyrics.php +++ b/api/lyrics.php @@ -2,6 +2,7 @@ header("X-Frame-Options: SAMEORIGIN"); header("Content-Type: application/json"); +//header("Content-Type: text/plain"); require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $songs; $token = json_decode(file_exists("/opt/spotify/token.json") ? file_get_contents("/opt/spotify/token.json") : file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/includes/app.json"), true); @@ -34,6 +35,22 @@ if (isset($data) && str_ends_with($data["syncType"], "_SYNCED")) { ], JSON_PRETTY_PRINT)); } +$probe = []; +exec("ffprobe -v quiet -print_format json -show_format $_SERVER[DOCUMENT_ROOT]/assets/content/$_GET[id].flac", $probe); +$metadata = json_decode(implode("\n", $probe), true); + +if (isset($metadata["format"]["tags"]["UNSYNCEDLYRICS"])) { + die(json_encode([ + "synced" => false, + "payload" => trim($metadata["format"]["tags"]["UNSYNCEDLYRICS"]) + ], JSON_PRETTY_PRINT)); +} elseif (isset($metadata["format"]["tags"]["unsyncedlyrics"])) { + die(json_encode([ + "synced" => false, + "payload" => trim($metadata["format"]["tags"]["unsyncedlyrics"]) + ], JSON_PRETTY_PRINT)); +} + $genius = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["genius"]; $id = array_values(array_filter(json_decode(file_get_contents("https://api.genius.com/search?q=" . rawurlencode($song["title"] . " " . $song["artist"]), false, stream_context_create([ -- cgit