|
@@ -19,5 +19,26 @@ for music in playlist:
|
|
|
|
|
|
## 源码分析
|
|
|
|
|
|
-1、网易云对请求进行了加密
|
|
|
+1、网易云对请求进行了加密,采用post方式,传递:
|
|
|
+
|
|
|
+```
|
|
|
+{
|
|
|
+ "params":"",
|
|
|
+ "encSecKey":""
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+两个参数,通过 encSecKey 解密 params,从而返回结果。
|
|
|
+
|
|
|
+2、所以封装一个 send 的方法,统一发送 post 请求:
|
|
|
+
|
|
|
+```
|
|
|
+ def send(self, url, param={}, method=''):
|
|
|
+ return query.post(url,
|
|
|
+ self.headers,
|
|
|
+ encrypt.encrypted_request(param, method))
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|