follow teacher Huang Yi"s VUE course QQ Music APP. To make a music player, the interfaces are all qq.
now that the playlist data is available, you need to click on the song to play it. You are going to use the audio tag to achieve it. But I don"t know how to generate the src of the audio tag. The src approach in the course has expired. Go to QQ and see their src is like this
http://dl.stream.qqmusic.qq.com/C400001uxKNp3a7Qkv.m4a?vkey=72E3CE808E6EB2FEBE2AA5A625DE5C12468604025CC9F05A0D0ADD898CB77FDF83888D29BEE6097761F53DE1C82B7DDB7A67AD38DD15517B&guid=504753841&uin=0&fromtag=66
click on a few songs and compare and analyze the src, and find that the src has the following parameters:
1.C400001uxKNp3a7Qkv
2.vkeyword 7F4E18EEF24DFC
3.guid parameter
4.uin parameter
5.fromtag parameter
but the variables are only 1 and 2.
it"s easy to generate 1. The mid in the resulting data object is C400.
vkeyQQ
:
url:
vkey
QQjsonp
param()dataurloriginJSONP()jsonp
I got vkey. when I got what I wanted. Stitched together with the variable mid, they are 1, 3, 4 and 5, put them into vuex"s state, and use state directly in src.
the song is played normally when it is clicked at first. But then there was a 403 error
compare the two src versions of the same song with the official version of QQ, except that vkey is different, everything else is the same, vkey is randomly generated, it is normal to be different.
official src
http://dl.stream.qqmusic.qq.com/C400001uxKNp3a7Qkv.m4a?vkey=71FF9880454604D580A3B64BD664EEE92069E28F42780C2F2DCE3F6A26C6ECB30ED4E790833E580AA1D3943928049747691A9758158917A9&guid=504753841&uin=0&fromtag=66
my src
http://dl.stream.qqmusic.qq.com/C400001uxKNp3a7Qkv.m4a?vkey=1373FD715FCE0AFB7580063C280CEE6945E3DC2E8D52CEE4567BD92E5EA78C1807D9730D34A8F592A7E096D2EF9FAB927921B4BD4FD357DA&guid=504753841&uin=0&fromtag=66
the question now is:
1. Why can"t it play steadily? Later on 403, what strategy did QQ take to block my src? (Oh, I have a terrible headache. I got better when I copy my src just now.)