代码拉取完成,页面将自动刷新
同步操作将从 lifankohome/eraser-music 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
include_once 'Eraser/Eraser.php';
const MAX_TEMP = 86400 * 30;
$eraser = new Eraser();
$option = $eraser->get('o', 'Param Error');
$uid = $eraser->get('u', 'Unique Label Error');
$eraser->setUid($uid);
if ($option == 'init') {
echo $eraser->out([1, 'success', $eraser->init()]);
} elseif ($option == 'search') {
$platform = $eraser->get('p', 'Library Not Specific');
$keyword = $eraser->get('k', 'Param Error');
$res = $eraser->search($platform, $keyword);
$ret = [];
foreach ($res as $key => $item) {
$album = $eraser->get_album($platform, $item['pic_id']);
if ($key == 0) {
$author = implode(', ', $item['artist']);
$data = $eraser->get_data($platform, $item['url_id'], $item['lyric_id'], $album, $item['name'], $author, $item['id']);
array_push($ret, [
'id' => $item['id'],
'name' => $item['name'],
'author' => $author,
'album' => $album,
'url' => $data['url'],
'lyric' => $data['lyric'],
'platform' => $platform
]);
} else {
array_push($ret, [
'id' => $item['id'],
'name' => $item['name'],
'author' => implode(', ', $item['artist']),
'album' => $album,
'url' => $item['url_id'],
'lyric' => $item['lyric_id'],
'platform' => $platform
]);
}
}
// temp playlist, so next time open it immediately
$eraser->save_list($ret);
echo $eraser->out([1, 'success', $ret]);
} elseif ($option == 'parse') {
$platform = $eraser->get('p', 'Library Not Specific');
$name = $eraser->get('n', 'Param Error');
$author = $eraser->get('t', 'Param Error');
$url_id = $eraser->get('r', 'Param Error');
$lyric_id = $eraser->get('l', 'Param Error');
$album = $eraser->get('a', 'Param Error');
$song_id = $eraser->get('s', 'Param Error');
$data = $eraser->get_data($platform, $url_id, $lyric_id, $album, $name, $author, $song_id);
$ret = [
'url' => $data['url'],
'lyric' => $data['lyric']
];
echo $eraser->out([1, 'success', $ret]);
} elseif ($option == 'wipe') {
$key = $eraser->get('k', 'Key Not Specific');
$s = ['history_search', 'history_play'];
if (!in_array($key, $s)) {
echo $eraser->out([0, 'Key Error']);
exit();
}
$eraser->wipe($key);
echo $eraser->out([1, 'success']);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。