分析天天静听在线音乐播放器的js逻辑

是这样的,我打算自己写一个音乐播放器,用到的资源来自于天天静听的
http://www.dongting.com/
我尝试着分析一下,当我搜索一个歌手的时候,页面会有那些js代码在运行

请注意:我首先输入歌手周杰伦的名字,然后才点击面板的性能监控的按钮,当搜索结果返回后,点击停止监控按钮,然后出现了一大堆函数调用.
图片描述

截图就没必要完整给出了,反正就是出现一大堆执行的函数,而且好像名字被压缩过了,更难以看懂,在这种情况下,叫我如何分析是哪一个函数给我返回了搜索结果啊?感觉根本无法入手.

我知道可以通过监控网络面板来得知搜索过程中向服务器发送了什么数据,然后自己可以模仿写一个类似的发送数据的函数,但是问题在于,难道我就没法知道js页面到底执行了什么代码来获取搜索结果吗?

回复
阅读 3.1k
1 个回答

打开控制台输入jay的时候请求http://so.ard.iyyin.com/suggest.do?q=jay&size=5&callback=jQuery18308427503108978271_1435147979137返回jQuery18308427503108978271_1435147979137({"code":1,"data":["jay chou","jay park","jay z","jayesslee","jay sean"]}),这是jsonp ,然后确认搜索jay chou,访问http://so.ard.iyyin.com/s/song_with_out?q=jay%20chou&page=1&size=50&callback=jsonp_search,返回一个列表,也是jsonp

phpjsonp_search({"code":1,"rows":8339,"pages":167,"data":[{"song_id":286315,"singer_id":11852,"pick_count":346091,"vip":0,"album_id":0,"artist_flag":1,"song_name":"青花瓷","singer_name":"周杰伦","audition_list":[{"duration":"03:59","format":"m4a","bitrate":32,"type_description":"压缩品质","url":"http://a.ali.dongting.com/55e18b2b8d576473/1435580023/m4a_32_2/d2/94/d2c05bb6fa14104f3eeb0fbc508cf194.m4a?s=t","size":"0.94M","type":1},{"duration":"03:57","format":"mp3","bitrate":128,"type_description":"标准品质","url":"http://nmo.ouj.yymommy.com/55e18b2b8d576473/1435580023/mp3_128_2/d2/94/d2c05bb6fa14104f3eeb0fbc508cf194.mp3?s=t","size":"3.62M","type":2},{"duration":"03:57","format":"mp3","bitrate":320,"type_description":"超高品质","url":"http://a.ali.dongting.com/62b05d2b71b48907/1435580023/mp3_190_2/80/b9/808a4fb29bc40a281ed4c378e7bef2b9.mp3?s=t","size":"9.06M","type":3}],"url_list":[{"duration":"03:59","format":"m4a","bitrate":32,"type_description":"压缩品质
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏