让嵌入式播放器可以自动下载歌词

转载时请注明出处和作者联系方式:http://blog.csdn.net/mimepp
作者联系方式:YU TAO <yut616 at sohu dot com>

 

歌词的显示,对一个媒体播放器来说是很需要的,特别是对有网络功能的产品,如果还要自己手工去找歌词,那么就不够充分利用其网络功能了。

如果能让其自动下载歌词,那么就是一个更酷的feature了。

 

这里列一下“千千静听”的歌词自动下载的功能,值得嵌入产品借鉴。

 

所抓的数据包:

1、根据 artist, title 来发送 http get 请求:

 

GET /dll/lyricsvr.dll?sh?Artist=730068006500&Title=E26CAF652B73&Flags=0 HTTP/1.1 Referer: http://ttlrccnc.qianqian.com/ Accept: image/gif, image/x-xbitmap, image/jpg, image/pjpeg, text/html, text/xml, */* User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Host: ttlrccnc.qianqian.com Connection: Keep-Alive Cache-Control: no-cache HTTP/1.1 200 OK Connection: close Content-type: text/html; charset=UTF-8 Content-Length: 179 Date: Fri, 26 Jun 2009 01:45:51 GMT Server: Apache 1.3.29 <?xml version="1.0" encoding="UTF-8" ?> <result> .<lrc id="7956" artist="S.H.E." title="........."></lrc> .<lrc id="235751" artist="S.H.E" title="........."></lrc> </result>  

 

2、根据得到的歌词列表 ID 号,发送 http get 请求:

GET /dll/lyricsvr.dll?dl?Id=7956&Code=2013547666&ci=6a661c70523225565316101c0260121f21542a5559264444141c464808425c5353011d01 HTTP/1.1 Referer: http://ttlrccnc.qianqian.com/ Accept: image/gif, image/x-xbitmap, image/jpg, image/pjpeg, text/html, text/xml, */* User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Host: ttlrccnc.qianqian.com Connection: Keep-Alive Cache-Control: no-cache HTTP/1.1 200 OK Connection: close tt-title: 43534B62C289F39747900A4E6B51C281577F496C0CFF56951A590D4E82595695D26B0A00535F645BEC725152A25B479030528E7F3D4E7359A04F tt-url: 68007400740070003A002F002F0079006F007500780069002E00620061006900640075002E0063006F006D002F0073007400610074002F00700072006F006D006F00740069006F006E00 2E006A00730070003F0070006D00690064003D003400330031002600750072006C003D00680074007400700025003300410025003200460025003200460079006F007500780069002E0062006100 6900640075002E0063006F006D0025003200460077006C00630071002500320046000A0068007400740070003A002F002F0079006F007500780069002E00620061006900640075002E0063006F00 6D002F0073007400610074002F00700072006F006D006F00740069006F006E002E006A00730070003F0070006D00690064003D003400330031002600750072006C003D0068007400740070002500 3300410025003200460025003200460079006F007500780069002E00620061006900640075002E0063006F006D0025003200460077006C0063007100250032004600 Content-type: text/html; charset=UTF-8 Content-Length: 2218 Date: Fri, 26 Jun 2009 01:45:56 GMT Ser ver: Apache 1.3.29 [ti:.........] [ar:S.H.E] [al:............] [by:253057646] [00:00.54]......... - S.H.E [00:06.82] [00:08.47]............... .................. [00:10.81] [00:16.87]............... QQ...253057646 [00:22.99] [00:30.54]Selina:.................. .................. [00:34.44]......... .................. ............... [00:38.40]......... ......... .......... ........... [00:45.33] [00:45.68]Hebe:.................. .................. [00:49.31].................. ............... [00:53.65]......... ......... ........................ [01:01.95] [01:03.48]Ella:......... ............ ......... ............ [01:07.12]................................. [01:10.73]Hebe:......... ............ ......... ............ [01:14.54].................................... [01:18.13] [01:18.68]Selina: ......... ............ ......... ............ [01:22.13]................................. [01:25.67]Ella: ......... ............ ......... ............ [01:29.76].................................... [01:33.27] [01:33.93]S.H.E: ........................... ........................... [01:41.22]........................... ............... ......... [01:50.61] [01:57.95]Ella: .................. .................. [02:02.59].................. ............... [02:06.80]......... ......... ........................ [02:14.58] [02:16.43]Selina:......... ..... ....... [02:18.37]Ella:......... ............ [02:20.38]Hebe: ................................. [02:23.79]Selina: ......... ............ [02:25.79]Ella: ......... ............ [02:27.79]Hebe: .................................... [02:31.39] [02:31.66]Ella: ......... ............ [02:33.15]Hebe: ......... ............ [02:35.36]Selina: ................................. [02:38. 81]Ella: ......... ............ [02:41.11]Hebe: ......... ............ [02:42.88]Selina: .................................... [02:46.76] [02:46.97]La La La La [03:04.43]S.H.E: ........................... ........................... [03:11.51]........................... ............... ......... [03:21.23]La La La La [03:37.41]S.H.E: ......... ......... [03:40.68] [03:48.52]............... QQ...253057646  

 

 

你可能感兴趣的:(apache,c,windows,Date,嵌入式,encoding)