-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.php
29 lines (27 loc) · 1010 Bytes
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require('debug.php');
require('src/kugouSource.php');
$downloader = (new ReflectionClass('AumKugouSource'))->newInstance();
$testArray = array(
array('title' => '一块红布', 'artist' => '崔健'),
array('title' => '还要多久', 'artist' => '宫阁 / 余佳运'),
array('title' => '빠빠빠', 'artist' => 'Crayon Pop')
);
foreach ($testArray as $key => $item) {
echo "\n++++++++++++++++++++++++++++++\n";
echo "测试 $key 开始...\n";
if ($key > 0) {
echo "等待 5 秒...\n";
sleep(5);
}
echo "{title = " . $item['title'] . "; artist = " . $item['artist'] . " }.\n";
$testObj = new AudioStationResult();
$count = $downloader->getLyricsList($item['artist'], $item['title'], $testObj);
if ($count > 0) {
$item = $testObj->getFirstItem();
$downloader->getLyrics($item['id'], $testObj);
} else {
echo "没有查找到任何歌词!\n";
}
echo "测试 $key 结束。\n";
}