From fc485bf14cded3b993bd66623d1590e80ee7ae02 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 5 Sep 2024 19:00:15 +0700 Subject: [PATCH] Update playback_m3u.php --- playback_m3u.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/playback_m3u.php b/playback_m3u.php index 7cea73c4c..3f426f57d 100644 --- a/playback_m3u.php +++ b/playback_m3u.php @@ -33,6 +33,9 @@ if (!$topic_id) { bb_die($lang['INVALID_TOPIC_ID'], 404); } +// Download mode +$dl_m3u = request_var('dl_m3u', 0); + // Getting torrent info from database $sql = 'SELECT attach_id, info_hash, info_hash_v2 FROM ' . BB_BT_TORRENTS . ' @@ -48,6 +51,11 @@ if (!$m3uFile = (new \TorrentPier\TorrServerAPI())->getM3UPath($row['attach_id'] bb_die($lang['ERROR_NO_ATTACHMENT']); } +// Start downloading +if ($dl_m3u) { + dump($m3uFile); +} + // Parse M3U file $m3uParser = new M3uParser\M3uParser(); $m3uParser->addDefaultTags(); @@ -91,7 +99,7 @@ foreach ($m3uData as $entry) { 'IS_VALID' => in_array($getExtension, array_merge($validFormats['audio'], $validFormats['video'])), 'IS_AUDIO' => in_array($getExtension, $validFormats['audio']), 'STREAM_LINK' => $streamLink, - 'M3U_DL_LINK' => $m3uFile, + 'M3U_DL_LINK' => PLAYBACK_M3U_URL . $topic_id . '&dl_m3u=1', 'TITLE' => $title, ]); }