|
- <?php( J" d6 f" y+ e! X0 G3 s
- header("content-Type: text/html; charset=UTF-8");) f. g( H9 J6 J/ q& a: ~" F. I
- $id=$_GET['a'];, ~& e& J* x3 o; ]) c m+ Q
- $data =file_get_contents("http://s.music.qq.com/fcgi-bin/music_search_new_platform?t=0&n=20&aggr=1&cr=1&loginUin=0&format=json&inCharset=GB2312&outCharset=utf-8¬ice=0&platform=jqminiframe.json&needNewCode=0&p=1&catZhida=0&remoteplace=sizer.newclient.next_song&w=$id");* _# ` r. X: ^8 H3 ~+ O. t4 f
- $table_change = array('|'=>'。');
4 R/ z; F0 ?+ [% o: C - $data= strtr("$data",$table_change);
! p1 R+ v3 |8 ?% E* B7 C - $c=(json_decode($data,true));9 @' C& O& S3 L$ ?
- $list=$_GET["b"];
7 [4 w9 l$ {! e j s! }1 S/ X - if($list==null)& G. _, p" ?, x* y: B
- {8 E/ Z3 B6 m; M& D. }+ x s1 B
- liebiao($c);7 L5 u( h5 w* N
- }
# @7 ~8 G/ M4 J7 D/ j( A - else
2 H/ p# _* p6 U8 @" N - {
6 B* M! q; ?% v2 ~ - xuange($c,$list);
. u1 C! g' _. y( l# }6 f - }
, N& Z: |6 C6 n e
; F. w' [) p1 d2 }& I- function liebiao($c)
* ]1 I1 w, P# i) Z - {! y" ~+ C% U- x2 \9 _6 i f
- $d=$c["result"]["songs"][0];+ f S+ @& G V" b. s
- $d=$d["id"];- o( a4 x8 e% {' l' i( V9 ?, r
- if($d==null)
" d& A2 C% o8 o( q - {% R% w: V( J1 Y5 l. L* y5 o
- echo "没有这首歌";
, ?: z8 P. \) p A6 k - }: O- _/ J4 ?4 o$ I1 m1 K0 @
- else
* J4 _, m0 n* M1 V8 V' Y' i& X - {
( T6 W2 E t3 `4 C - for ($o=0; $o<=14; $o++) 6 Z$ V, u* J7 q# L
- {# q9 T0 S7 l2 n* V) u
- $e=$c["data"]["song"]["list"][$o];
- ~' N2 K8 e8 ?0 {. V0 h - $name=$e["fsinger"];
) D+ t0 q" T- ]) M% @, @& n - $music=$e["fsong"];
* c, I% _8 N* L - $f=$e["f"];
0 {8 J- z/ K1 H - echo ($o+1),"✨",$name,"---",$music,"\n";
: G8 D1 J$ F0 f9 p) { - }6 u7 p7 R3 `) a! f
- }
& M" I$ w# g- \$ g* { e - }$ X# ^% T/ r% o8 m
; F; D6 D) e! ^/ G8 b; i- function xuange($c,$list)+ O. M+ n( b. P7 G$ r
- {
. L# r4 _/ Y2 r# h3 K: F2 b. a - $e=$c["data"]["song"]["list"][($list-1)];
$ Y) {6 q0 [: I1 D2 j( j - $f=$e["f"];* P$ N0 {" i3 n' f
- preg_match_all('/0。00(.*?)。(.*?)。(.*?)。/',$f,$o);8 B% \6 S6 Z% t8 ^) |' L' n
- $id=$o[1][0];//歌曲id& o" N! x2 S" O
- $pic=$o[3][0];//图片id
q3 I( c1 B* w {# X9 u- u2 R - $name=$e["fsinger"];
9 B, B+ }9 w; j - $music=$e["fsong"];! L/ G: b& I6 O/ l2 ?/ B ?
- $id="http://dl.stream.qqmusic.qq.com/C10000".$id.".m4a?vkey=";
* n4 t8 |" R P& ^+ u" H7 j0 W' e) k - $pic="https://y.gtimg.cn/music/photo_new/T002R150x150M000".$pic.".jpg";
0 c& I( Y3 c+ I% b5 F3 a% j - echo "card:1<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><msg serviceID="2" templateID="1" action="web" brief="逸超QQ音乐API" sourceMsgId="0" url="$id" flag="0" adverSign="0" multiMsgFlag="0"><item layout="2"><audio cover="$pic" src="$id" /><title>".$music."</title><summary>".$name."</summary></item><source name="QQ音乐" icon="https://i.gtimg.cn/open/app_icon/00/49/73/08/100497308_100_m.png?date=20170724" url="http://yichao20.club" action="app" a_actionData="com.tencent.qqmusic" i_actionData="tencent100497308://" appid="100497308" /></msg>";
: f* P" G% f* E1 G4 F$ n - }
9 w* L; V6 H; X- Y- ], U - ?>
复制代码 |
|