公众号文章里的qq音乐如何批量下载

公众号文章里的qq音乐如何批量下载

 

打开的文章内,播放音乐,注意开发者工具中,网络选项卡中,media类型的请求.那就是音乐.那么这条media的请求,就是音乐地址.

https://isure6.stream.qqmusic.qq.com/C200000LlDmu3jNrV4.m4a?guid=2000000122&vkey=53C62F2A8EDC390CFCCB9C19AE8A330B331740833C55151815B35E95C9F395FC5BE89D692C20DC7B76169BCCC351155D74D909C989ECCF22&uin=0&fromtag=20122&__wxtag__=00299X0x0UrqGw

 

 

上方,标黄的内容删掉,也可以得到想要的音乐.

西方标黄的,是必要的参数

 

C200000LlDmu3jNrV4.m4a?

guid=2000000122&

vkey=53C62F2A8EDC390CFCCB9C19AE8A330B331740833C55151815B35E95C9F395FC5BE89D692C20DC7B76169BCCC351155D74D909C989ECCF22&

fromtag=20122

 

再次抓另外一首歌曲

https://isure6.stream.qqmusic.qq.com/C200003n5MkB163KW3.m4a?guid=2000000122&vkey=89571EE0D8FA8AF6169B5530897AD8A30F36DBD419B9429DA59C23528746F1ECAC153955ABD76554F1FC206E6C4FC68F79A8372E64C956E1&uin=0&fromtag=20122&__wxtag__=000QnaUz4Of1Vu

 

C200003n5MkB163KW3.m4a?

guid=2000000122&

vkey=89571EE0D8FA8AF6169B5530897AD8A30F36DBD419B9429DA59C23528746F1ECAC153955ABD76554F1FC206E6C4FC68F79A8372E64C956E1&

fromtag=20122

标红的内容,是区分哪首歌的东西.

 

重开开发者工具,刷新网页

在元素选项卡,搜搜 C200003n5MkB163KW3

搜索 C200000LlDmu3jNrV4

 

复制他的js路径

document.querySelector("#js_content > section:nth-child(9) > section:nth-child(1) > qqmusic")

 

在控制台,录入 document.querySelectorAll("qqmusic"),可以得到30个元素.

 

<qqmusic class="js_editor_qqmusic js_uneditable" musicid="7395998" mid="00299X0x0UrqGw" albumurl="https://y.gtimg.cn/music/photo_new/T002R68x68M000002U4Uoo4BGwsZ.jpg" audiourl="http://isure6.stream.qqmusic.qq.com/C200000LlDmu3jNrV4.m4a?guid=2000001731&amp;vkey=DD14E05258F0CC3DBABF826B29A30166A2B115416986AA20A85BA6CAE443A937771FB65E0A36881FEED3B80B0D894FC1BE62810EDC596B9B&amp;uin=&amp;fromtag=50" music_name="冷碳" singer="赵季平&nbsp;-&nbsp;大宅门&nbsp;音乐专辑" play_length="114" src="/mp/readtemplate?t=app_editor/music&amp;singer=%E8%B5%B5%E5%AD%A3%E5%B9%B3%20-%20%E5%A4%A7%E5%AE%85%E9%97%A8%20%E9%9F%B3%E4%B9%90%E4%B8%93%E8%BE%91&amp;music_name=%E5%86%B7%E7%A2%B3&amp;albumurl=https%3A%2F%2Fy.gtimg.cn%2Fmusic%2Fphoto_new%2FT002R68x68M000002U4Uoo4BGwsZ.jpg&amp;musictype=1" musictype="1" otherid="00299X0x0UrqGw" albumid="002U4Uoo4BGwsZ" jumpurlkey="" data-pluginname="insertaudio" style="outline: 0px;overflow-wrap: break-word !important;" has-insert-preloading="1"></qqmusic>

 

可以得到 错误的vkey 和其他一切东西.

那么如何得到vkey?就是此问题的答案.

 

我们来测试,从元素中获取的内容,这句

http://isure6.stream.qqmusic.qq.com/C200000LlDmu3jNrV4.m4a?guid=2000001731&amp;vkey=DD14E05258F0CC3DBABF826B29A30166A2B115416986AA20A85BA6CAE443A937771FB65E0A36881FEED3B80B0D894FC1BE62810EDC596B9B&amp;uin=&amp;fromtag=50

 

注意,&amp和其他修改一下

http://isure6.stream.qqmusic.qq.com/C200000LlDmu3jNrV4.m4a?guid=2000001731&vkey=DD14E05258F0CC3DBABF826B29A30166A2B115416986AA20A85BA6CAE443A937771FB65E0A36881FEED3B80B0D894FC1BE62810EDC596B9B &fromtag=20122

 

但是无法打开,说明 vkey是错误的,很重要

 

我们在网络选项卡,ctrl+f,搜索mediakey的一部分 53C62F2A8EDC390CFCC

然后发现,通过如下链接,获取的

 

https://mp.weixin.qq.com/mp/qqmusic?action=get_song_info&song_mid=00299X0x0UrqGw&uin=&key=&pass_ticket=&wxtoken=777&devicetype=&clientversion=&__biz=Mzg3OTEwMTIxMg==&appmsg_token=&x5=0&f=json

 

那么这里的 url中的 song_mid又从何来?

可以看到 ,qqmusic 元素中存在.

那么

可以这样

 

先获取 所有qqmusic 元素, mid,就是 song_id

<qqmusic  mid="00299X0x0UrqGw"

热后,得到song_mid,通过

https://mp.weixin.qq.com/mp/qqmusic?action=get_song_info&song_mid=00299X0x0UrqGw&uin=&key=&pass_ticket=&wxtoken=777&devicetype=&clientversion=&__biz=Mzg3OTEwMTIxMg==&appmsg_token=&x5=0&f=json

获取 json

{"base_resp":{"ret":0},"resp_data":"{\"ret\":0,\"sub_ret\":0,\"msg\":\"ok\",\"songlist\":[{\"song_id\":7395998,\"song_mid\":\"00299X0x0UrqGw\",\"song_name\":\"冷碳\",\"song_title\":\"冷碳\",\"isonly\":0,\"vip\":0,\"language\":\"纯音乐\",\"genre\":\"无流派\",\"public_time\":\"2001-01-01\",\"song_play_time\":114,\"isdigital_album\":0,\"copyright\":1,\"hot\":0,\"playable\":1,\"song_h5_url\":\"http:\/\/c.y.qq.com\/v8\/playsong.html?songmid=00299X0x0UrqGw\",\"mv_id\":0,\"mv_vid\":\"\",\"k_song_id\":0,\"k_song_mid\":\"\",\"singer_id\":33530,\"singer_mid\":\"003QFnkv2ahfwW\",\"singer_name\":\"赵季平\",\"singer_title\":\"赵季平\",\"singer_pic\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T001R120x120M000003QFnkv2ahfwW_1.jpg\",\"singer_pic_150x150\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003QFnkv2ahfwW_1.jpg\",\"singer_pic_300x300\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T001R300x300M000003QFnkv2ahfwW_1.jpg\",\"singer_pic_500x500\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T001R500x500M000003QFnkv2ahfwW_1.jpg\",\"other_singer_list\":[],\"album_id\":673372,\"album_mid\":\"002U4Uoo4BGwsZ\",\"album_name\":\"大宅门 音乐专辑\",\"album_title\":\"大宅门 音乐专辑\",\"album_pic\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T002R120x120M000002U4Uoo4BGwsZ_1.jpg\",\"album_pic_150x150\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T002R150x150M000002U4Uoo4BGwsZ_1.jpg\",\"album_pic_300x300\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T002R300x300M000002U4Uoo4BGwsZ_1.jpg\",\"album_pic_500x500\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T002R500x500M000002U4Uoo4BGwsZ_1.jpg\",\"song_play_url\":\"http:\/\/isure6.stream.qqmusic.qq.com\/C200000LlDmu3jNrV4.m4a?guid=2000000122\\u0026vkey=B7F5D2588938D4B338FC6CCE47DB08BAADF936DAFA1780EF787639D0EBD20CDE89589EE87C7066F6EA5E9669DA7F7F0AF2092B64A67C8DFC\\u0026uin=0\\u0026fromtag=20122\",\"song_play_url_standard\":\"http:\/\/isure6.stream.qqmusic.qq.com\/C400000LlDmu3jNrV4.m4a?fromtag=30122\\u0026guid=2000000122\\u0026uin=0\\u0026vkey=4C083E422590B47888091DCA830A67ECA0F9FE7B743C4BA8E8BCD33D72F4A8314C1E0C55082114D0055689CE8DB6F9251E8590E77896D09C\",\"song_play_url_hq\":\"\",\"song_play_url_sq\":\"\",\"song_size\":669564,\"song_size_standard\":1344180,\"song_size_hq\":0,\"song_size_sq\":0,\"try_playable\":0,\"try_begin\":0,\"try_end\":0,\"try_30s_url\":\"\",\"try_file_size\":0,\"unplayable_code\":0,\"unplayable_msg\":\"\",\"user_own_rule\":1,\"song_version\":0,\"WeightPlayCnt\":0,\"fnote\":0,\"editAllow\":0,\"song_play_url_dolby\":\"\",\"song_size_dolby\":0,\"action\":{\"switch\":1795,\"switch2\":0},\"song_ekey_standard\":\"\",\"song_ekey_hq\":\"\",\"song_ekey_sq\":\"\",\"song_ekey_dolby\":\"\"}]}","http_code":200}

 

进而获取 歌曲信息和歌曲链接

下载歌曲即可.

 

 

 

 

公众号文章里的qq音乐如何批量下载

 

打开的文章内,播放音乐,注意开发者工具中,网络选项卡中,media类型的请求.那就是音乐.那么这条media的请求,就是音乐地址.

https://isure6.stream.qqmusic.qq.com/C200000LlDmu3jNrV4.m4a?guid=2000000122&vkey=53C62F2A8EDC390CFCCB9C19AE8A330B331740833C55151815B35E95C9F395FC5BE89D692C20DC7B76169BCCC351155D74D909C989ECCF22&uin=0&fromtag=20122&__wxtag__=00299X0x0UrqGw

 

 

上方,标黄的内容删掉,也可以得到想要的音乐.

西方标黄的,是必要的参数

 

C200000LlDmu3jNrV4.m4a?

guid=2000000122&

vkey=53C62F2A8EDC390CFCCB9C19AE8A330B331740833C55151815B35E95C9F395FC5BE89D692C20DC7B76169BCCC351155D74D909C989ECCF22&

fromtag=20122

 

再次抓另外一首歌曲

https://isure6.stream.qqmusic.qq.com/C200003n5MkB163KW3.m4a?guid=2000000122&vkey=89571EE0D8FA8AF6169B5530897AD8A30F36DBD419B9429DA59C23528746F1ECAC153955ABD76554F1FC206E6C4FC68F79A8372E64C956E1&uin=0&fromtag=20122&__wxtag__=000QnaUz4Of1Vu

 

C200003n5MkB163KW3.m4a?

guid=2000000122&

vkey=89571EE0D8FA8AF6169B5530897AD8A30F36DBD419B9429DA59C23528746F1ECAC153955ABD76554F1FC206E6C4FC68F79A8372E64C956E1&

fromtag=20122

标红的内容,是区分哪首歌的东西.

 

重开开发者工具,刷新网页

在元素选项卡,搜搜 C200003n5MkB163KW3

搜索 C200000LlDmu3jNrV4

 

复制他的js路径

document.querySelector("#js_content > section:nth-child(9) > section:nth-child(1) > qqmusic")

 

在控制台,录入 document.querySelectorAll("qqmusic"),可以得到30个元素.

 

<qqmusic class="js_editor_qqmusic js_uneditable" musicid="7395998" mid="00299X0x0UrqGw" albumurl="https://y.gtimg.cn/music/photo_new/T002R68x68M000002U4Uoo4BGwsZ.jpg" audiourl="http://isure6.stream.qqmusic.qq.com/C200000LlDmu3jNrV4.m4a?guid=2000001731&amp;vkey=DD14E05258F0CC3DBABF826B29A30166A2B115416986AA20A85BA6CAE443A937771FB65E0A36881FEED3B80B0D894FC1BE62810EDC596B9B&amp;uin=&amp;fromtag=50" music_name="冷碳" singer="赵季平&nbsp;-&nbsp;大宅门&nbsp;音乐专辑" play_length="114" src="/mp/readtemplate?t=app_editor/music&amp;singer=%E8%B5%B5%E5%AD%A3%E5%B9%B3%20-%20%E5%A4%A7%E5%AE%85%E9%97%A8%20%E9%9F%B3%E4%B9%90%E4%B8%93%E8%BE%91&amp;music_name=%E5%86%B7%E7%A2%B3&amp;albumurl=https%3A%2F%2Fy.gtimg.cn%2Fmusic%2Fphoto_new%2FT002R68x68M000002U4Uoo4BGwsZ.jpg&amp;musictype=1" musictype="1" otherid="00299X0x0UrqGw" albumid="002U4Uoo4BGwsZ" jumpurlkey="" data-pluginname="insertaudio" style="outline: 0px;overflow-wrap: break-word !important;" has-insert-preloading="1"></qqmusic>

 

可以得到 错误的vkey 和其他一切东西.

那么如何得到vkey?就是此问题的答案.

 

我们来测试,从元素中获取的内容,这句

http://isure6.stream.qqmusic.qq.com/C200000LlDmu3jNrV4.m4a?guid=2000001731&amp;vkey=DD14E05258F0CC3DBABF826B29A30166A2B115416986AA20A85BA6CAE443A937771FB65E0A36881FEED3B80B0D894FC1BE62810EDC596B9B&amp;uin=&amp;fromtag=50

 

注意,&amp和其他修改一下

http://isure6.stream.qqmusic.qq.com/C200000LlDmu3jNrV4.m4a?guid=2000001731&vkey=DD14E05258F0CC3DBABF826B29A30166A2B115416986AA20A85BA6CAE443A937771FB65E0A36881FEED3B80B0D894FC1BE62810EDC596B9B &fromtag=20122

 

但是无法打开,说明 vkey是错误的,很重要

 

我们在网络选项卡,ctrl+f,搜索mediakey的一部分 53C62F2A8EDC390CFCC

然后发现,通过如下链接,获取的

 

https://mp.weixin.qq.com/mp/qqmusic?action=get_song_info&song_mid=00299X0x0UrqGw&uin=&key=&pass_ticket=&wxtoken=777&devicetype=&clientversion=&__biz=Mzg3OTEwMTIxMg==&appmsg_token=&x5=0&f=json

 

那么这里的 url中的 song_mid又从何来?

可以看到 ,qqmusic 元素中存在.

那么

可以这样

 

先获取 所有qqmusic 元素, mid,就是 song_id

<qqmusic  mid="00299X0x0UrqGw"

热后,得到song_mid,通过

https://mp.weixin.qq.com/mp/qqmusic?action=get_song_info&song_mid=00299X0x0UrqGw&uin=&key=&pass_ticket=&wxtoken=777&devicetype=&clientversion=&__biz=Mzg3OTEwMTIxMg==&appmsg_token=&x5=0&f=json

获取 json

{"base_resp":{"ret":0},"resp_data":"{\"ret\":0,\"sub_ret\":0,\"msg\":\"ok\",\"songlist\":[{\"song_id\":7395998,\"song_mid\":\"00299X0x0UrqGw\",\"song_name\":\"冷碳\",\"song_title\":\"冷碳\",\"isonly\":0,\"vip\":0,\"language\":\"纯音乐\",\"genre\":\"无流派\",\"public_time\":\"2001-01-01\",\"song_play_time\":114,\"isdigital_album\":0,\"copyright\":1,\"hot\":0,\"playable\":1,\"song_h5_url\":\"http:\/\/c.y.qq.com\/v8\/playsong.html?songmid=00299X0x0UrqGw\",\"mv_id\":0,\"mv_vid\":\"\",\"k_song_id\":0,\"k_song_mid\":\"\",\"singer_id\":33530,\"singer_mid\":\"003QFnkv2ahfwW\",\"singer_name\":\"赵季平\",\"singer_title\":\"赵季平\",\"singer_pic\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T001R120x120M000003QFnkv2ahfwW_1.jpg\",\"singer_pic_150x150\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003QFnkv2ahfwW_1.jpg\",\"singer_pic_300x300\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T001R300x300M000003QFnkv2ahfwW_1.jpg\",\"singer_pic_500x500\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T001R500x500M000003QFnkv2ahfwW_1.jpg\",\"other_singer_list\":[],\"album_id\":673372,\"album_mid\":\"002U4Uoo4BGwsZ\",\"album_name\":\"大宅门 音乐专辑\",\"album_title\":\"大宅门 音乐专辑\",\"album_pic\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T002R120x120M000002U4Uoo4BGwsZ_1.jpg\",\"album_pic_150x150\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T002R150x150M000002U4Uoo4BGwsZ_1.jpg\",\"album_pic_300x300\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T002R300x300M000002U4Uoo4BGwsZ_1.jpg\",\"album_pic_500x500\":\"http:\/\/y.gtimg.cn\/music\/photo_new\/T002R500x500M000002U4Uoo4BGwsZ_1.jpg\",\"song_play_url\":\"http:\/\/isure6.stream.qqmusic.qq.com\/C200000LlDmu3jNrV4.m4a?guid=2000000122\\u0026vkey=B7F5D2588938D4B338FC6CCE47DB08BAADF936DAFA1780EF787639D0EBD20CDE89589EE87C7066F6EA5E9669DA7F7F0AF2092B64A67C8DFC\\u0026uin=0\\u0026fromtag=20122\",\"song_play_url_standard\":\"http:\/\/isure6.stream.qqmusic.qq.com\/C400000LlDmu3jNrV4.m4a?fromtag=30122\\u0026guid=2000000122\\u0026uin=0\\u0026vkey=4C083E422590B47888091DCA830A67ECA0F9FE7B743C4BA8E8BCD33D72F4A8314C1E0C55082114D0055689CE8DB6F9251E8590E77896D09C\",\"song_play_url_hq\":\"\",\"song_play_url_sq\":\"\",\"song_size\":669564,\"song_size_standard\":1344180,\"song_size_hq\":0,\"song_size_sq\":0,\"try_playable\":0,\"try_begin\":0,\"try_end\":0,\"try_30s_url\":\"\",\"try_file_size\":0,\"unplayable_code\":0,\"unplayable_msg\":\"\",\"user_own_rule\":1,\"song_version\":0,\"WeightPlayCnt\":0,\"fnote\":0,\"editAllow\":0,\"song_play_url_dolby\":\"\",\"song_size_dolby\":0,\"action\":{\"switch\":1795,\"switch2\":0},\"song_ekey_standard\":\"\",\"song_ekey_hq\":\"\",\"song_ekey_sq\":\"\",\"song_ekey_dolby\":\"\"}]}","http_code":200}

 

进而获取 歌曲信息和歌曲链接

下载歌曲即可.

 

 

 

 

posted @ 2022-10-24 09:31  interim  阅读(452)  评论(0编辑  收藏  举报