mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Update playback_m3u.php
This commit is contained in:
parent
2cbdd70848
commit
fc485bf14c
1 changed files with 9 additions and 1 deletions
|
@ -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,
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue