@@ -25,8 +25,9 @@ class QQClient @Inject constructor(
2525 // 通用参数
2626 private val comm = mutableMapOf<String , Any >(
2727 " ct" to 11 ,
28- " cv" to " 2111" ,
29- " v" to " 2111" ,
28+ // QQ 音乐目前只接受轻量版客户端标识;桌面版组合会返回 2001。
29+ " cv" to " 1003006" ,
30+ " v" to " 1003006" ,
3031 " os_ver" to " 15" ,
3132 " phonetype" to " 24122RKC7C" , // REDMI K80 Pro
3233 " rom" to " Redmi/miro/miro:15/AE3A.240806.005/OS2.0.10${
@@ -35,7 +36,7 @@ class QQClient @Inject constructor(
3536 6
3637 )
3738 } .0.VOMCNXM:user/release-keys" ,
38- " tmeAppID" to " qqmusic " ,
39+ " tmeAppID" to " qqmusiclight " ,
3940 " nettype" to " NETWORK_WIFI" ,
4041 " udid" to " 0"
4142 )
@@ -56,7 +57,8 @@ class QQClient @Inject constructor(
5657 val data = request(" GetSession" , " music.getSession.session" , param)
5758 val session = data.getJSONObject(" session" )
5859
59- comm[" uid" ] = session.getString(" uid" )
60+ // 服务端返回的是数值 uid,保留其 JSON 类型以匹配轻量版客户端请求。
61+ comm[" uid" ] = session.getLong(" uid" )
6062 comm[" sid" ] = session.getString(" sid" )
6163 comm[" userip" ] = session.getString(" userip" )
6264
@@ -131,8 +133,8 @@ class QQClient @Inject constructor(
131133 " grp" to 1
132134 )
133135
134- val data = request(" DoSearchForQQMusicDesktop " , " music.search.SearchCgiService" , param)
135- val itemSong = data.getJSONObject(" body" ).getJSONObject( " song " ). optJSONArray(" list " ) ? : JSONArray ()
136+ val data = request(" DoSearchForQQMusicLite " , " music.search.SearchCgiService" , param)
137+ val itemSong = data.getJSONObject(" body" ).optJSONArray(" item_song " ) ? : JSONArray ()
136138 val result = ArrayList <QQSong >()
137139 for (i in 0 until itemSong.length()) {
138140 val obj = itemSong.getJSONObject(i)
0 commit comments