diff --git a/README.md b/README.md index ba1a8a1..361e073 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,13 @@ ### 使用 - 安装 `pip install NeteaseCloudMusic` -- 导入API进行使用(具体查看`test.py`中的示例) +- 导入API进行使用(具体查看`example.py`中的示例) ```python from NeteaseCloudMusic import NeteaseCloudMusicApi, api_help, api_list import os netease_cloud_music_api = NeteaseCloudMusicApi() # 初始化API -netease_cloud_music_api.cookie = os.getenv("COOKIE") # 设置cookie +netease_cloud_music_api.cookie = "你的cookie" # 设置cookie, 如果没有cookie需要先登录 具体见example.py response = netease_cloud_music_api.request("song_url_v1", {"id": 33894312, "level": "exhigh"}) # 调用API # 获取帮助 diff --git a/config.json b/config.json index 80cdb2e..851b7be 100644 --- a/config.json +++ b/config.json @@ -307763,5 +307763,15 @@ "result": {} } ] + }, + "/login/status": { + "name": "登录状态", + "explain": "说明 : 调用此接口,可获取登录状态", + "example": [ + { + "query":{}, + "result": {} + } + ] } } \ No newline at end of file diff --git a/example.py b/example.py new file mode 100644 index 0000000..ed04a6f --- /dev/null +++ b/example.py @@ -0,0 +1,110 @@ +""" +description: 网易云音乐API使用示例,这个示例引导你进行登录操作,然后下载一首歌曲 +author: LuTong +date: 2020-10-07 10:00 +""" +from pprint import pprint + +import requests + +from package.NeteaseCloudMusic import NeteaseCloudMusicApi, api_help, api_list + +netease_cloud_music_api = NeteaseCloudMusicApi() # 初始化API + + +def captcha_sent(_phone): + response = netease_cloud_music_api.request("/captcha/sent", {"phone": f"{_phone}"}) + return response + + +def login_cellphone(_phone, _captcha): + response = netease_cloud_music_api.request("/login/cellphone", {"phone": f"{_phone}", "captcha": f"{_captcha}"}) + return response + + +def song_url_v1(song_id): + # 获取歌曲mp3地址 + response = netease_cloud_music_api.request("song_url_v1", {"id": song_id, "level": "exhigh"}) + return response + + +def song_detail(song_id): + # 获取歌曲详情 + response = netease_cloud_music_api.request("song_detail", {"ids": str(song_id)}) + # 这里记得传一个字符串,其实所有参数都传字符串就行,需要数字的话内部会自己转换的,但是它默认你传入的时候是字符串,所以你传数字他不会自动转字符串, + # 这时如果遇到操作字符串的方法就会报错,所以最好都传字符串,避免出现意外 + return response + + +def login_status(): + response = netease_cloud_music_api.request("/login/status") + return response + + +# 登录 +if not netease_cloud_music_api.cookie: + print("请设置cookie") + phone = input("请输入手机号:") + result = captcha_sent(phone) + print(result) + if result.get("code") == 200: + print("验证码已发送,请查收") + captcha = input("请输入验证码:") + result = login_cellphone(phone, captcha) + if result.get("code") == 200: + print("登录成功") + if netease_cloud_music_api.cookie: + print("cookie已自动设置") + else: + print("登录失败") +""" +调用登录接口后,会自动设置cookie,如果cookie失效,需要重新登录,登录过后api会在你的当前工作目录下创建cookie_storage文件保存你的cookie +在下次调用运行程序时,他会判断cookie是否过期,没有过期就自动读取cookie_storage文件中的cookie。 + +总的来说你不需要手动管理cookie,只需要调用登录接口,然后调用其他接口即可,cookie会自动设置,如果cookie过期,再次调用登录接口就好。 +更好的办法是,在cookie还没有失效之前使用refresh_login接口刷新cookie,这样就不需要重新登录了(建议在你每次启动软件时都刷新,当然频繁重启调试的时候另算) + +如果你想判断当前是否已经登录,if not netease_cloud_music_api.cookie 就可以了,或者调用/login/status接口 +""" + +# 获取登录状态 +login_status_result = login_status() +# pprint(login_status_result) +if login_status_result['data']['data']["code"] == 200: + print(f'当前登录账号:{login_status_result["data"]["data"]["profile"]["nickname"]}') + +version_result = netease_cloud_music_api.request("inner_version") +print( + f'当前使用NeteaseCloudMusicApi版本号:{version_result["NeteaseCloudMusicApi"]}\n当前使用NeteaseCloudMusicApi_V8版本号:{version_result["NeteaseCloudMusicApi_V8"]}') # 退出登录 + +# 获取歌曲mp3地址 +song_url_result = song_url_v1(33894312) +if song_url_result.get("code") == 200: + song_url = song_url_result['data']["data"][0]['url'] +else: + print("获取歌曲mp3地址失败") + exit(1) +# 获取歌曲详情 +song_detail_result = song_detail(33894312) +if song_detail_result.get("code") == 200: + song_name = song_detail_result['data']['songs'][0]['name'] + song_artist = song_detail_result['data']['songs'][0]['ar'][0]['name'] +else: + print("获取歌曲详情失败") + exit(1) +# 下载歌曲mp3 +print(f"正在下载歌曲:{song_name} - {song_artist}") +result = requests.get(song_url) +with open(f"{song_name} - {song_artist}.mp3", "wb") as f: + f.write(result.content) +print("下载完成") + +""" +示例程序结束,如果你运行成功了,那么你的执行目录下应该有一个cookie_storage文件,里面保存了你的cookie,还有一个mp3文件,就是你下载的歌曲 +有关其他API的使用方法请参考:https://docs.neteasecloudmusicapi.binaryify.com/ + +再次注明一下,我之前也想过要不要将登录状态管理和cookie刷新等等封装到NeteaseCloudMusicApi类中, +但最后我想的是,这毕竟这是一个api接口类,就让他保持最原始简洁的状态就好,其他的留给大家去自由发挥吧! + +友情提示:单个账户每天发送验证码的次数有限制,千万别一直调试登录接口。 +""" diff --git a/package/NeteaseCloudMusic.egg-info/PKG-INFO b/package/NeteaseCloudMusic.egg-info/PKG-INFO index e9b280b..09f7be5 100644 --- a/package/NeteaseCloudMusic.egg-info/PKG-INFO +++ b/package/NeteaseCloudMusic.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: NeteaseCloudMusic -Version: 0.1.3 +Version: 0.1.4 Summary: 网易云音乐API NeteaseCloudMusicApi项目的 Python SDK Home-page: https://github.com/2061360308/NeteaseCloudMusic_PythonSDK Author: 盧瞳 @@ -16,4 +16,94 @@ Requires-Python: >=3.6.0 Description-Content-Type: text/markdown License-File: LICENSE -网易云音乐API NeteaseCloudMusicApi项目的 Python SDK + +# NeteaseCloudMusic_PythonSDK +> 基于 [ NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi) 封装的 Python SDK。 +> 网易云API Python版本。 +> 现已同步原项目接口且测试通过的有200多个 +> 已发布到PyPi,可直接使用pip安装 +> 项目地址:[GitHub](https://github.com/2061360308/NeteaseCloudMusic_PythonSDK) + +![](https://img.shields.io/badge/py_mini_racer-@0.6.0-red.svg) +![License](https://img.shields.io/badge/license-MIT-yellow) + +### 依赖于 +- [ NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi) +- [ NeteaseCloudMusicApi_V8 ](https://github.com/2061360308/NeteaseCloudMusicApi_V8) + +### 原理 +- 通过 `py_mini_racer` 调用 `NeteaseCloudMusicApi_V8` 的 `js` 方法。进一步进行了简单封装。 + +### 使用 +- 安装 `pip install NeteaseCloudMusic` +- 导入API进行使用(具体查看`test.py`中的示例) +```python +from NeteaseCloudMusic import NeteaseCloudMusicApi, api_help, api_list +import os + +netease_cloud_music_api = NeteaseCloudMusicApi() # 初始化API +netease_cloud_music_api.cookie = os.getenv("COOKIE") # 设置cookie +response = netease_cloud_music_api.request("song_url_v1", {"id": 33894312, "level": "exhigh"}) # 调用API + +# 获取帮助 +print(api_help()) +print(api_help('song_url_v1')) +# 获取API列表 +print(api_list()) +``` + +> 注意: request(self, name, query=None) 的第一个参数为API名称,第二个参数为API参数,具体API名称和参数请参考 [NeteaseCloudMusicApi文档](https://docs.neteasecloudmusicapi.binaryify.com),name支持`/song/url/v1`和`song_url_v1`两种写法。 + + +### 开发 +- 克隆项目 `git clone git@github.com:2061360308/NeteaseCloudMusic_PythonSDK.git` +- 安装依赖 `pip install -r requirements.txt` +- 目录/文件说明 +├── package 项目包根目录 +├── test_gender 生成测试代码的脚本 +├── test.py 手动测试/ 使用示例 + + +### 改进 +> 下列API未支持 +> +- apicache.js +- memory-cache.js +- request_reference.js +- avatar_upload.js +- cloud.js +- playlist_cover_update.js +- voice_upload.js +- register_anonimous.js +- verify_getQr.js + +> 以下api未测试(这些接口测试起来比较繁琐) +> +- /user/replacephone +- /audio/match +- /rebind +- /nickname/check +- /activate/init/profile +- /cellphone/existence/check +- /register/cellphone +- /captcha/verify +- /captcha/sent +- /login/refresh +- /logout +- /user/update +- /pl/count +- /playlist/update +- /playlist/desc/update +- /playlist/name/update +- /playlist/tags/update +- /event/forward +- /event/del +- /share/resource +- /send/text +- /send/playlist +- /playlist/create +- /playlist/tracks +- /daily_signin +- /fm_trash + +### 欢迎提交PR diff --git a/package/NeteaseCloudMusic/NeteaseCloudMusicApi.js b/package/NeteaseCloudMusic/NeteaseCloudMusicApi.js index 9d431b7..d849989 100644 --- a/package/NeteaseCloudMusic/NeteaseCloudMusicApi.js +++ b/package/NeteaseCloudMusic/NeteaseCloudMusicApi.js @@ -77,13 +77,13 @@ if (typeof window === "undefined") { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 452: +/***/ 6244: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(8214), __webpack_require__(888), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(4227), __webpack_require__(2857), __webpack_require__(842), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -310,13 +310,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 7407: +/***/ 2717: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(8214), __webpack_require__(888), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(4227), __webpack_require__(2857), __webpack_require__(842), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -780,13 +780,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 5109: +/***/ 3667: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(888)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(842)); } else {} }(this, function (CryptoJS) { @@ -1674,7 +1674,7 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 8249: +/***/ 2034: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { @@ -1722,7 +1722,7 @@ return /******/ (() => { // webpackBootstrap // Native crypto import via require (NodeJS) if (!crypto && "function" === 'function') { try { - crypto = __webpack_require__(2480); + crypto = __webpack_require__(2297); } catch (err) {} } @@ -2480,13 +2480,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 8269: +/***/ 4227: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249)); + module.exports = exports = factory(__webpack_require__(2034)); } else {} }(this, function (CryptoJS) { @@ -2615,13 +2615,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 3786: +/***/ 1182: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249)); + module.exports = exports = factory(__webpack_require__(2034)); } else {} }(this, function (CryptoJS) { @@ -2762,13 +2762,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 298: +/***/ 3018: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249)); + module.exports = exports = factory(__webpack_require__(2034)); } else {} }(this, function (CryptoJS) { @@ -2910,13 +2910,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 888: +/***/ 842: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(2783), __webpack_require__(9824)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(6635), __webpack_require__(5574)); } else {} }(this, function (CryptoJS) { @@ -3043,13 +3043,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 2209: +/***/ 7908: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -3108,13 +3108,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 9824: +/***/ 5574: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249)); + module.exports = exports = factory(__webpack_require__(2034)); } else {} }(this, function (CryptoJS) { @@ -3250,13 +3250,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 1354: +/***/ 1292: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(4938), __webpack_require__(4433), __webpack_require__(298), __webpack_require__(8269), __webpack_require__(3786), __webpack_require__(8214), __webpack_require__(2783), __webpack_require__(2153), __webpack_require__(7792), __webpack_require__(34), __webpack_require__(7460), __webpack_require__(3327), __webpack_require__(706), __webpack_require__(9824), __webpack_require__(2112), __webpack_require__(888), __webpack_require__(5109), __webpack_require__(8568), __webpack_require__(4242), __webpack_require__(9968), __webpack_require__(7660), __webpack_require__(1148), __webpack_require__(3615), __webpack_require__(2807), __webpack_require__(1077), __webpack_require__(6475), __webpack_require__(6991), __webpack_require__(2209), __webpack_require__(452), __webpack_require__(4253), __webpack_require__(1857), __webpack_require__(4454), __webpack_require__(3974), __webpack_require__(7407)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(6925), __webpack_require__(8055), __webpack_require__(3018), __webpack_require__(4227), __webpack_require__(1182), __webpack_require__(2857), __webpack_require__(6635), __webpack_require__(5386), __webpack_require__(3834), __webpack_require__(1113), __webpack_require__(5501), __webpack_require__(5618), __webpack_require__(1342), __webpack_require__(5574), __webpack_require__(631), __webpack_require__(842), __webpack_require__(3667), __webpack_require__(1767), __webpack_require__(5508), __webpack_require__(7198), __webpack_require__(452), __webpack_require__(6172), __webpack_require__(6930), __webpack_require__(7533), __webpack_require__(1322), __webpack_require__(4455), __webpack_require__(9167), __webpack_require__(7908), __webpack_require__(6244), __webpack_require__(199), __webpack_require__(92), __webpack_require__(4598), __webpack_require__(6173), __webpack_require__(2717)); } else {} }(this, function (CryptoJS) { @@ -3267,13 +3267,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 4433: +/***/ 8055: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249)); + module.exports = exports = factory(__webpack_require__(2034)); } else {} }(this, function (CryptoJS) { @@ -3342,13 +3342,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 8214: +/***/ 2857: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249)); + module.exports = exports = factory(__webpack_require__(2034)); } else {} }(this, function (CryptoJS) { @@ -3609,13 +3609,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 8568: +/***/ 1767: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -3688,13 +3688,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 9968: +/***/ 7198: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -3803,13 +3803,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 4242: +/***/ 5508: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -3860,13 +3860,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 1148: +/***/ 6172: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -3899,13 +3899,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 7660: +/***/ 452: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -3952,13 +3952,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 3615: +/***/ 6930: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -4000,13 +4000,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 2807: +/***/ 7533: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -4043,13 +4043,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 1077: +/***/ 1322: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -4082,13 +4082,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 6991: +/***/ 9167: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -4111,13 +4111,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 6475: +/***/ 4455: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -4157,13 +4157,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 2112: +/***/ 631: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(2153), __webpack_require__(9824)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(5386), __webpack_require__(5574)); } else {} }(this, function (CryptoJS) { @@ -4301,13 +4301,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 3974: +/***/ 6173: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(8214), __webpack_require__(888), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(4227), __webpack_require__(2857), __webpack_require__(842), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -4490,13 +4490,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 4454: +/***/ 4598: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(8214), __webpack_require__(888), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(4227), __webpack_require__(2857), __webpack_require__(842), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -4681,13 +4681,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 1857: +/***/ 92: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(8214), __webpack_require__(888), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(4227), __webpack_require__(2857), __webpack_require__(842), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -4819,13 +4819,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 706: +/***/ 1342: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249)); + module.exports = exports = factory(__webpack_require__(2034)); } else {} }(this, function (CryptoJS) { @@ -5085,13 +5085,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 2783: +/***/ 6635: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249)); + module.exports = exports = factory(__webpack_require__(2034)); } else {} }(this, function (CryptoJS) { @@ -5234,13 +5234,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 7792: +/***/ 3834: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(2153)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(5386)); } else {} }(this, function (CryptoJS) { @@ -5313,13 +5313,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 2153: +/***/ 5386: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249)); + module.exports = exports = factory(__webpack_require__(2034)); } else {} }(this, function (CryptoJS) { @@ -5511,13 +5511,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 3327: +/***/ 5618: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(4938)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(6925)); } else {} }(this, function (CryptoJS) { @@ -5836,13 +5836,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 7460: +/***/ 5501: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(4938), __webpack_require__(34)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(6925), __webpack_require__(1113)); } else {} }(this, function (CryptoJS) { @@ -5918,13 +5918,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 34: +/***/ 1113: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(4938)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(6925)); } else {} }(this, function (CryptoJS) { @@ -6243,13 +6243,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 4253: +/***/ 199: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(8214), __webpack_require__(888), __webpack_require__(5109)); + module.exports = exports = factory(__webpack_require__(2034), __webpack_require__(4227), __webpack_require__(2857), __webpack_require__(842), __webpack_require__(3667)); } else {} }(this, function (CryptoJS) { @@ -7021,13 +7021,13 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 4938: +/***/ 6925: /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(8249)); + module.exports = exports = factory(__webpack_require__(2034)); } else {} }(this, function (CryptoJS) { @@ -7324,7 +7324,7 @@ return /******/ (() => { // webpackBootstrap /***/ }), -/***/ 8925: +/***/ 8663: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -7344,10 +7344,10 @@ return /******/ (() => { // webpackBootstrap * * Copyright (c) 2010-2014 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(5649); -__webpack_require__(1967); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(4125); +__webpack_require__(5142); +__webpack_require__(9993); /* AES API */ module.exports = forge.aes = forge.aes || {}; @@ -8422,7 +8422,7 @@ function _createCipher(options) { /***/ }), -/***/ 6164: +/***/ 6608: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -8433,9 +8433,9 @@ function _createCipher(options) { * Copyright (c) 2009-2015 Digital Bazaar, Inc. * */ -var forge = __webpack_require__(3832); -__webpack_require__(8925); -__webpack_require__(4311); +var forge = __webpack_require__(4117); +__webpack_require__(8663); +__webpack_require__(3020); var tls = module.exports = forge.tls; @@ -8711,15 +8711,15 @@ function compareMacs(key, mac1, mac2) { /***/ }), -/***/ 9205: +/***/ 9425: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /** * Copyright (c) 2019 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(3068); +var forge = __webpack_require__(4117); +__webpack_require__(9319); var asn1 = forge.asn1; exports.privateKeyValidator = { @@ -8809,7 +8809,7 @@ exports.publicKeyValidator = { /***/ }), -/***/ 3068: +/***/ 9319: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -8947,9 +8947,9 @@ exports.publicKeyValidator = { * The full OID (including ASN.1 tag and length of 6 bytes) is: * 0x06062A864886F70D */ -var forge = __webpack_require__(3832); -__webpack_require__(7116); -__webpack_require__(6270); +var forge = __webpack_require__(4117); +__webpack_require__(9993); +__webpack_require__(1384); /* ASN.1 API */ var asn1 = module.exports = forge.asn1 = forge.asn1 || {}; @@ -10250,7 +10250,7 @@ asn1.prettyPrint = function(obj, level, indentation) { /***/ }), -/***/ 8807: +/***/ 1727: /***/ ((module) => { /** @@ -10443,7 +10443,7 @@ function _encodeWithByteBuffer(input, alphabet) { /***/ }), -/***/ 5649: +/***/ 4125: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -10453,8 +10453,8 @@ function _encodeWithByteBuffer(input, alphabet) { * * Copyright (c) 2010-2014 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(9993); module.exports = forge.cipher = forge.cipher || {}; @@ -10680,7 +10680,7 @@ BlockCipher.prototype.finish = function(pad) { /***/ }), -/***/ 1967: +/***/ 5142: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -10690,8 +10690,8 @@ BlockCipher.prototype.finish = function(pad) { * * Copyright (c) 2010-2014 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(9993); forge.cipher = forge.cipher || {}; @@ -11686,7 +11686,7 @@ function from64To32(num) { /***/ }), -/***/ 3480: +/***/ 2188: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -11720,10 +11720,10 @@ function from64To32(num) { * Copyright (c) 2012 Stefan Siegl * Copyright (c) 2012-2014 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(5649); -__webpack_require__(1967); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(4125); +__webpack_require__(5142); +__webpack_require__(9993); /* DES API */ module.exports = forge.des = forge.des || {}; @@ -12189,7 +12189,7 @@ function _createCipher(options) { /***/ }), -/***/ 69: +/***/ 3956: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -12202,12 +12202,12 @@ function _createCipher(options) { * * https://github.com/dchest/tweetnacl-js */ -var forge = __webpack_require__(3832); -__webpack_require__(5764); -__webpack_require__(9563); -__webpack_require__(3219); -__webpack_require__(7116); -var asn1Validator = __webpack_require__(9205); +var forge = __webpack_require__(4117); +__webpack_require__(1838); +__webpack_require__(7646); +__webpack_require__(501); +__webpack_require__(9993); +var asn1Validator = __webpack_require__(9425); var publicKeyValidator = asn1Validator.publicKeyValidator; var privateKeyValidator = asn1Validator.privateKeyValidator; @@ -13268,7 +13268,7 @@ function M(o, a, b) { /***/ }), -/***/ 3832: +/***/ 4117: /***/ ((module) => { /** @@ -13288,7 +13288,7 @@ module.exports = { /***/ }), -/***/ 6607: +/***/ 7637: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -13300,9 +13300,9 @@ module.exports = { * * Copyright (c) 2010-2012 Digital Bazaar, Inc. All rights reserved. */ -var forge = __webpack_require__(3832); -__webpack_require__(8991); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(7279); +__webpack_require__(9993); /* HMAC API */ var hmac = module.exports = forge.hmac = forge.hmac || {}; @@ -13441,7 +13441,7 @@ hmac.create = function() { /***/ }), -/***/ 2079: +/***/ 2795: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -13451,37 +13451,37 @@ hmac.create = function() { * * Copyright 2011-2016 Digital Bazaar, Inc. */ -module.exports = __webpack_require__(3832); -__webpack_require__(8925); -__webpack_require__(6164); -__webpack_require__(3068); -__webpack_require__(5649); -__webpack_require__(3480); -__webpack_require__(69); -__webpack_require__(6607); -__webpack_require__(6366); -__webpack_require__(4145); -__webpack_require__(3389); -__webpack_require__(3453); -__webpack_require__(8960); -__webpack_require__(6953); -__webpack_require__(8936); -__webpack_require__(5147); -__webpack_require__(9437); -__webpack_require__(4742); -__webpack_require__(9654); -__webpack_require__(4933); -__webpack_require__(6007); -__webpack_require__(9563); -__webpack_require__(9372); -__webpack_require__(7173); -__webpack_require__(4311); -__webpack_require__(7116); +module.exports = __webpack_require__(4117); +__webpack_require__(8663); +__webpack_require__(6608); +__webpack_require__(9319); +__webpack_require__(4125); +__webpack_require__(2188); +__webpack_require__(3956); +__webpack_require__(7637); +__webpack_require__(5427); +__webpack_require__(8512); +__webpack_require__(5835); +__webpack_require__(898); +__webpack_require__(3498); +__webpack_require__(624); +__webpack_require__(1504); +__webpack_require__(6433); +__webpack_require__(2292); +__webpack_require__(2696); +__webpack_require__(9293); +__webpack_require__(833); +__webpack_require__(3678); +__webpack_require__(7646); +__webpack_require__(6232); +__webpack_require__(6786); +__webpack_require__(3020); +__webpack_require__(9993); /***/ }), -/***/ 5764: +/***/ 1838: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright (c) 2005 Tom Wu @@ -13532,7 +13532,7 @@ Address all questions regarding this license to: Tom Wu tjw@cs.Stanford.EDU */ -var forge = __webpack_require__(3832); +var forge = __webpack_require__(4117); module.exports = forge.jsbn = forge.jsbn || {}; @@ -14752,7 +14752,7 @@ BigInteger.prototype.isProbablePrime = bnIsProbablePrime; /***/ }), -/***/ 6366: +/***/ 5427: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -14764,10 +14764,10 @@ BigInteger.prototype.isProbablePrime = bnIsProbablePrime; * Copyright (c) 2014 Lautaro Cozzani * Copyright (c) 2014 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(7116); -__webpack_require__(9563); -__webpack_require__(5764); +var forge = __webpack_require__(4117); +__webpack_require__(9993); +__webpack_require__(7646); +__webpack_require__(1838); module.exports = forge.kem = forge.kem || {}; @@ -14927,7 +14927,7 @@ function _createKDF(kdf, md, counterStart, digestLength) { /***/ }), -/***/ 4145: +/***/ 8512: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -14937,8 +14937,8 @@ function _createKDF(kdf, md, counterStart, digestLength) { * * Copyright (c) 2008-2013 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(9993); /* LOG API */ module.exports = forge.log = forge.log || {}; @@ -15253,7 +15253,7 @@ forge.log.consoleLogger = sConsoleLogger; /***/ }), -/***/ 3389: +/***/ 5835: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -15263,17 +15263,17 @@ forge.log.consoleLogger = sConsoleLogger; * * Copyright 2011-2017 Digital Bazaar, Inc. */ -module.exports = __webpack_require__(8991); +module.exports = __webpack_require__(7279); -__webpack_require__(5063); -__webpack_require__(137); -__webpack_require__(1668); -__webpack_require__(3219); +__webpack_require__(6383); +__webpack_require__(76); +__webpack_require__(4824); +__webpack_require__(501); /***/ }), -/***/ 8991: +/***/ 7279: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -15283,7 +15283,7 @@ __webpack_require__(3219); * * Copyright 2011-2017 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); +var forge = __webpack_require__(4117); module.exports = forge.md = forge.md || {}; forge.md.algorithms = forge.md.algorithms || {}; @@ -15291,7 +15291,7 @@ forge.md.algorithms = forge.md.algorithms || {}; /***/ }), -/***/ 5063: +/***/ 6383: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -15301,9 +15301,9 @@ forge.md.algorithms = forge.md.algorithms || {}; * * Copyright (c) 2010-2014 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(8991); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(7279); +__webpack_require__(9993); var md5 = module.exports = forge.md5 = forge.md5 || {}; forge.md.md5 = forge.md.algorithms.md5 = md5; @@ -15587,7 +15587,7 @@ function _update(s, w, bytes) { /***/ }), -/***/ 6971: +/***/ 3049: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -15597,8 +15597,8 @@ function _update(s, w, bytes) { * * Copyright 2012 Stefan Siegl */ -var forge = __webpack_require__(3832); -__webpack_require__(3453); +var forge = __webpack_require__(4117); +__webpack_require__(898); module.exports = forge.mgf = forge.mgf || {}; forge.mgf.mgf1 = forge.mgf1; @@ -15606,7 +15606,7 @@ forge.mgf.mgf1 = forge.mgf1; /***/ }), -/***/ 3453: +/***/ 898: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -15618,8 +15618,8 @@ forge.mgf.mgf1 = forge.mgf1; * Copyright (c) 2012 Stefan Siegl * Copyright (c) 2014 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(9993); forge.mgf = forge.mgf || {}; var mgf1 = module.exports = forge.mgf.mgf1 = forge.mgf1 = forge.mgf1 || {}; @@ -15670,7 +15670,7 @@ mgf1.create = function(md) { /***/ }), -/***/ 6270: +/***/ 1384: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -15680,7 +15680,7 @@ mgf1.create = function(md) { * * Copyright (c) 2010-2013 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); +var forge = __webpack_require__(4117); forge.pki = forge.pki || {}; var oids = module.exports = forge.pki.oids = forge.oids = forge.oids || {}; @@ -15856,7 +15856,7 @@ _IN('1.3.6.1.5.5.7.3.8', 'timeStamping'); /***/ }), -/***/ 7450: +/***/ 8788: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -15878,18 +15878,18 @@ _IN('1.3.6.1.5.5.7.3.8', 'timeStamping'); * * EncryptedData ::= OCTET STRING */ -var forge = __webpack_require__(3832); -__webpack_require__(8925); -__webpack_require__(3068); -__webpack_require__(3480); -__webpack_require__(8991); -__webpack_require__(6270); -__webpack_require__(8960); -__webpack_require__(6953); -__webpack_require__(9563); -__webpack_require__(9372); -__webpack_require__(8095); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(8663); +__webpack_require__(9319); +__webpack_require__(2188); +__webpack_require__(7279); +__webpack_require__(1384); +__webpack_require__(3498); +__webpack_require__(624); +__webpack_require__(7646); +__webpack_require__(6232); +__webpack_require__(8855); +__webpack_require__(9993); if(typeof BigInteger === 'undefined') { var BigInteger = forge.jsbn.BigInteger; @@ -16886,7 +16886,7 @@ function createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm) { /***/ }), -/***/ 8960: +/***/ 3498: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -16898,16 +16898,16 @@ function createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm) { * * Copyright (c) 2010-2013 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(6607); -__webpack_require__(8991); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(7637); +__webpack_require__(7279); +__webpack_require__(9993); var pkcs5 = forge.pkcs5 = forge.pkcs5 || {}; var crypto; if(forge.util.isNodejs && !forge.options.usePureJavaScript) { - crypto = __webpack_require__(5819); + crypto = __webpack_require__(289); } /** @@ -17104,7 +17104,7 @@ module.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function( /***/ }), -/***/ 6953: +/***/ 624: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -17135,8 +17135,8 @@ module.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function( * * body: the binary-encoded body. */ -var forge = __webpack_require__(3832); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(9993); // shortcut for pem API var pem = module.exports = forge.pem = forge.pem || {}; @@ -17348,7 +17348,7 @@ function ltrim(str) { /***/ }), -/***/ 8936: +/***/ 1504: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -17396,10 +17396,10 @@ function ltrim(str) { * * Copyright (c) 2013-2014 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(7116); -__webpack_require__(9563); -__webpack_require__(137); +var forge = __webpack_require__(4117); +__webpack_require__(9993); +__webpack_require__(7646); +__webpack_require__(76); // shortcut for PKCS#1 API var pkcs1 = module.exports = forge.pkcs1 = forge.pkcs1 || {}; @@ -17631,7 +17631,7 @@ function rsa_mgf1(seed, maskLength, hash) { /***/ }), -/***/ 5147: +/***/ 6433: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -17729,17 +17729,17 @@ function rsa_mgf1(seed, maskLength, hash) { * ... -- For future extensions * } */ -var forge = __webpack_require__(3832); -__webpack_require__(3068); -__webpack_require__(6607); -__webpack_require__(6270); -__webpack_require__(5496); -__webpack_require__(7450); -__webpack_require__(9563); -__webpack_require__(8095); -__webpack_require__(137); -__webpack_require__(7116); -__webpack_require__(5414); +var forge = __webpack_require__(4117); +__webpack_require__(9319); +__webpack_require__(7637); +__webpack_require__(1384); +__webpack_require__(8840); +__webpack_require__(8788); +__webpack_require__(7646); +__webpack_require__(8855); +__webpack_require__(76); +__webpack_require__(9993); +__webpack_require__(5200); // shortcut for asn.1 & PKI API var asn1 = forge.asn1; @@ -18712,7 +18712,7 @@ p12.generateKey = forge.pbe.generatePkcs12Key; /***/ }), -/***/ 9437: +/***/ 2292: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -18733,16 +18733,16 @@ p12.generateKey = forge.pbe.generatePkcs12Key; * a separate file pkcs7asn1.js, since those are referenced from other * PKCS standards like PKCS #12. */ -var forge = __webpack_require__(3832); -__webpack_require__(8925); -__webpack_require__(3068); -__webpack_require__(3480); -__webpack_require__(6270); -__webpack_require__(6953); -__webpack_require__(5496); -__webpack_require__(9563); -__webpack_require__(7116); -__webpack_require__(5414); +var forge = __webpack_require__(4117); +__webpack_require__(8663); +__webpack_require__(9319); +__webpack_require__(2188); +__webpack_require__(1384); +__webpack_require__(624); +__webpack_require__(8840); +__webpack_require__(7646); +__webpack_require__(9993); +__webpack_require__(5200); // shortcut for ASN.1 API var asn1 = forge.asn1; @@ -19979,7 +19979,7 @@ function _decryptContent(msg) { /***/ }), -/***/ 5496: +/***/ 8840: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -20091,9 +20091,9 @@ function _decryptContent(msg) { * * EncryptedKey ::= OCTET STRING */ -var forge = __webpack_require__(3832); -__webpack_require__(3068); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(9319); +__webpack_require__(9993); // shortcut for ASN.1 API var asn1 = forge.asn1; @@ -20396,7 +20396,7 @@ p7v.recipientInfoValidator = { /***/ }), -/***/ 4742: +/***/ 2696: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -20407,17 +20407,17 @@ p7v.recipientInfoValidator = { * * Copyright (c) 2010-2013 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(3068); -__webpack_require__(6270); -__webpack_require__(7450); -__webpack_require__(6953); -__webpack_require__(8960); -__webpack_require__(5147); -__webpack_require__(6007); -__webpack_require__(8095); -__webpack_require__(7116); -__webpack_require__(5414); +var forge = __webpack_require__(4117); +__webpack_require__(9319); +__webpack_require__(1384); +__webpack_require__(8788); +__webpack_require__(624); +__webpack_require__(3498); +__webpack_require__(6433); +__webpack_require__(3678); +__webpack_require__(8855); +__webpack_require__(9993); +__webpack_require__(5200); // shortcut for asn.1 API var asn1 = forge.asn1; @@ -20505,7 +20505,7 @@ pki.privateKeyInfoToPem = function(pki, maxline) { /***/ }), -/***/ 9654: +/***/ 9293: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -20515,10 +20515,10 @@ pki.privateKeyInfoToPem = function(pki, maxline) { * * Copyright (c) 2014 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(7116); -__webpack_require__(5764); -__webpack_require__(9563); +var forge = __webpack_require__(4117); +__webpack_require__(9993); +__webpack_require__(1838); +__webpack_require__(7646); (function() { @@ -20809,7 +20809,7 @@ function getMillerRabinTests(bits) { /***/ }), -/***/ 4933: +/***/ 833: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -20823,13 +20823,13 @@ function getMillerRabinTests(bits) { * * Copyright (c) 2010-2014 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(9993); var _crypto = null; if(forge.util.isNodejs && !forge.options.usePureJavaScript && !process.versions['node-webkit']) { - _crypto = __webpack_require__(5819); + _crypto = __webpack_require__(289); } /* PRNG API */ @@ -21235,7 +21235,7 @@ prng.create = function(plugin) { /***/ }), -/***/ 6007: +/***/ 3678: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -21245,9 +21245,9 @@ prng.create = function(plugin) { * * Copyright (c) 2012 Stefan Siegl */ -var forge = __webpack_require__(3832); -__webpack_require__(9563); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(7646); +__webpack_require__(9993); // shortcut for PSS API var pss = module.exports = forge.pss = forge.pss || {}; @@ -21483,7 +21483,7 @@ pss.create = function(options) { /***/ }), -/***/ 9563: +/***/ 7646: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -21501,11 +21501,11 @@ pss.create = function(options) { * * Copyright (c) 2009-2014 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(8925); -__webpack_require__(1668); -__webpack_require__(4933); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(8663); +__webpack_require__(4824); +__webpack_require__(833); +__webpack_require__(9993); (function() { @@ -21681,7 +21681,7 @@ module.exports = forge.random; /***/ }), -/***/ 9372: +/***/ 6232: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -21694,8 +21694,8 @@ module.exports = forge.random; * Information on the RC2 cipher is available from RFC #2268, * http://www.ietf.org/rfc/rfc2268.txt */ -var forge = __webpack_require__(3832); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(9993); var piTable = [ 0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d, @@ -22098,7 +22098,7 @@ forge.rc2.createDecryptionCipher = function(key, bits) { /***/ }), -/***/ 8095: +/***/ 8855: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -22164,20 +22164,20 @@ forge.rc2.createDecryptionCipher = function(key, bits) { * * The OID for the RSA key algorithm is: 1.2.840.113549.1.1.1 */ -var forge = __webpack_require__(3832); -__webpack_require__(3068); -__webpack_require__(5764); -__webpack_require__(6270); -__webpack_require__(8936); -__webpack_require__(9654); -__webpack_require__(9563); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(9319); +__webpack_require__(1838); +__webpack_require__(1384); +__webpack_require__(1504); +__webpack_require__(9293); +__webpack_require__(7646); +__webpack_require__(9993); if(typeof BigInteger === 'undefined') { var BigInteger = forge.jsbn.BigInteger; } -var _crypto = forge.util.isNodejs ? __webpack_require__(5819) : null; +var _crypto = forge.util.isNodejs ? __webpack_require__(289) : null; // shortcut for asn.1 API var asn1 = forge.asn1; @@ -24054,7 +24054,7 @@ function _base64ToBigInt(b64) { /***/ }), -/***/ 137: +/***/ 76: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -24064,9 +24064,9 @@ function _base64ToBigInt(b64) { * * Copyright (c) 2010-2015 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(8991); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(7279); +__webpack_require__(9993); var sha1 = module.exports = forge.sha1 = forge.sha1 || {}; forge.md.sha1 = forge.md.algorithms.sha1 = sha1; @@ -24380,7 +24380,7 @@ function _update(s, w, bytes) { /***/ }), -/***/ 1668: +/***/ 4824: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -24392,9 +24392,9 @@ function _update(s, w, bytes) { * * Copyright (c) 2010-2015 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(8991); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(7279); +__webpack_require__(9993); var sha256 = module.exports = forge.sha256 = forge.sha256 || {}; forge.md.sha256 = forge.md.algorithms.sha256 = sha256; @@ -24714,7 +24714,7 @@ function _update(s, w, bytes) { /***/ }), -/***/ 3219: +/***/ 501: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -24729,9 +24729,9 @@ function _update(s, w, bytes) { * * Copyright (c) 2014-2015 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -__webpack_require__(8991); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(7279); +__webpack_require__(9993); var sha512 = module.exports = forge.sha512 = forge.sha512 || {}; @@ -25282,7 +25282,7 @@ function _update(s, w, bytes) { /***/ }), -/***/ 7173: +/***/ 6786: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -25295,12 +25295,12 @@ function _update(s, w, bytes) { * * @author https://github.com/shellac */ -var forge = __webpack_require__(3832); -__webpack_require__(8925); -__webpack_require__(6607); -__webpack_require__(5063); -__webpack_require__(137); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(8663); +__webpack_require__(7637); +__webpack_require__(6383); +__webpack_require__(76); +__webpack_require__(9993); var ssh = module.exports = forge.ssh = forge.ssh || {}; @@ -25525,7 +25525,7 @@ function _sha1() { /***/ }), -/***/ 4311: +/***/ 3020: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -25760,15 +25760,15 @@ function _sha1() { * due to the large block size of existing MACs and the small size of the * timing signal. */ -var forge = __webpack_require__(3832); -__webpack_require__(3068); -__webpack_require__(6607); -__webpack_require__(5063); -__webpack_require__(6953); -__webpack_require__(4742); -__webpack_require__(9563); -__webpack_require__(137); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(9319); +__webpack_require__(7637); +__webpack_require__(6383); +__webpack_require__(624); +__webpack_require__(2696); +__webpack_require__(7646); +__webpack_require__(76); +__webpack_require__(9993); /** * Generates pseudo random bytes by mixing the result of two hash functions, @@ -29814,7 +29814,7 @@ forge.tls.createConnection = tls.createConnection; /***/ }), -/***/ 7116: +/***/ 9993: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -29824,8 +29824,8 @@ forge.tls.createConnection = tls.createConnection; * * Copyright (c) 2010-2018 Digital Bazaar, Inc. */ -var forge = __webpack_require__(3832); -var baseN = __webpack_require__(8807); +var forge = __webpack_require__(4117); +var baseN = __webpack_require__(1727); /* Utilities API */ var util = module.exports = forge.util = forge.util || {}; @@ -32473,7 +32473,7 @@ util.estimateCores = function(options, callback) { /***/ }), -/***/ 5414: +/***/ 5200: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** @@ -32585,17 +32585,17 @@ util.estimateCores = function(options, callback) { * signature BIT STRING * } */ -var forge = __webpack_require__(3832); -__webpack_require__(8925); -__webpack_require__(3068); -__webpack_require__(3480); -__webpack_require__(8991); -__webpack_require__(6971); -__webpack_require__(6270); -__webpack_require__(6953); -__webpack_require__(6007); -__webpack_require__(8095); -__webpack_require__(7116); +var forge = __webpack_require__(4117); +__webpack_require__(8663); +__webpack_require__(9319); +__webpack_require__(2188); +__webpack_require__(7279); +__webpack_require__(3049); +__webpack_require__(1384); +__webpack_require__(624); +__webpack_require__(3678); +__webpack_require__(8855); +__webpack_require__(9993); // shortcut for asn.1 API var asn1 = forge.asn1; @@ -35722,14 +35722,14 @@ pki.verifyCertificateChain = function(caStore, chain, options) { /***/ }), -/***/ 2480: +/***/ 2297: /***/ (() => { /* (ignored) */ /***/ }), -/***/ 5819: +/***/ 289: /***/ (() => { /* (ignored) */ @@ -37234,12 +37234,36 @@ function toBoolean (val) { } function cookieToJson(cookie) { + // python的requests模块返回的多个cookie会用','分隔但是set-cookie的值里面也有',' + // 先用';'分隔开,再用','分隔开 + // 如果分割结果里面有'=',那么就是一个完整的cookie。如果不包含等号 + // 那么这个部分应该与前一个部分合并,因为它是前一个cookie的一部分。 if (!cookie) return {} - let cookieArr = cookie.split(';') + + let cookies = []; + cookies = cookie.split(';') + + let cookieArr = [] + cookies.forEach((i) => { + let parts = i.split(',') + + parts.forEach((part, i) => { + if (part.includes('=')) { + cookieArr.push(part) + } else { + cookieArr[cookieArr.length - 1] += ',' + part + } + }) + }) + let obj = {} cookieArr.forEach((i) => { let arr = i.split('=') - obj[arr[0]] = arr[1] + if (arr.length === 2) { + obj[arr[0].trim()] = arr[1] + } else { + obj[arr[0].trim()] = "" + } }) return obj } @@ -37904,7 +37928,7 @@ const hug_comment_resourceTypeMap = config_namespaceObject.A; }); ;// CONCATENATED MODULE: ./package.json -const package_namespaceObject = {"i8":"0.1.0"}; +const package_namespaceObject = {"i8":"0.1.1"}; ;// CONCATENATED MODULE: ./module/inner_version.js /* harmony default export */ const inner_version = ((query, request) => { @@ -38196,8 +38220,8 @@ const package_namespaceObject = {"i8":"0.1.0"}; return result }); -// EXTERNAL MODULE: ./node_modules/crypto-js/index.js -var crypto_js = __webpack_require__(1354); +// EXTERNAL MODULE: ./node_modules/.store/crypto-js@4.2.0/node_modules/crypto-js/index.js +var crypto_js = __webpack_require__(1292); ;// CONCATENATED MODULE: ./module/login_cellphone.js // 手机登录 @@ -38341,33 +38365,21 @@ var crypto_js = __webpack_require__(1354); }); ;// CONCATENATED MODULE: ./module/login_status.js -/* harmony default export */ const login_status = (async (query, request) => { - const data = {} - let result = await request( - 'POST', - `https://music.163.com/weapi/w/nuser/account/get`, - data, - { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) - if (result.body.code === 200) { - result = { - status: 200, - body: { - data: { - ...result.body, - }, +/* harmony default export */ const login_status = ((query, request) => { + const data = {} + return request( + 'POST', + `https://music.163.com/weapi/w/nuser/account/get`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, }, - cookie: result.cookie, - } - } - return result -}); - + ) + }); + ;// CONCATENATED MODULE: ./module/logout.js // 退出登录 @@ -38743,7 +38755,8 @@ var crypto_js = __webpack_require__(1354); realIP: query.realIP, }, ) -}); +}); + ;// CONCATENATED MODULE: ./module/music_first_listen_info.js // 回忆坐标 @@ -42795,8 +42808,8 @@ const resource_like_resourceTypeMap = config_namespaceObject.A; 'yunbei_task_finish':yunbei_task_finish, 'yunbei_today':yunbei_today, }); -// EXTERNAL MODULE: ./node_modules/node-forge/lib/index.js -var lib = __webpack_require__(2079); +// EXTERNAL MODULE: ./node_modules/.store/node-forge@1.3.1/node_modules/node-forge/lib/index.js +var lib = __webpack_require__(2795); ;// CONCATENATED MODULE: ./util/crypto.js @@ -42958,7 +42971,7 @@ const createRequestParam = (method, url, data = {}, options) => { if (!options.cookie.MUSIC_U) { // 游客 if (!options.cookie.MUSIC_A) { - options.cookie.MUSIC_A = anonymous_token; + options.cookie.MUSIC_A = ""; options.cookie.os = options.cookie.os || "ios"; options.cookie.appver = options.cookie.appver || "8.10.90"; } @@ -43146,6 +43159,11 @@ function beforeRequest(name, query) { /* harmony default export */ const afterRequest_login_cellphone = ((response) => { response = JSON.parse(response); if (response.body.code === 200) { + let cookie = response.cookie; + if (Array.isArray(cookie)) { + cookie = cookie.join(';'); + } + response = { status: 200, body: { @@ -43155,9 +43173,26 @@ function beforeRequest(name, query) { "avatarImgIdStr" ) ), - cookie: response.cookie.join(";"), + cookie: cookie, }, - cookie: response.cookie, + cookie: cookie, + }; + } + return response; +}); + +;// CONCATENATED MODULE: ./afterRequest/login_status.js +/* harmony default export */ const afterRequest_login_status = ((response) => { + response = JSON.parse(response); + if (response.body.code === 200) { + response = { + status: 200, + body: { + data: { + ...response.body, + cookie: response.cookie, + }, + } }; } return response; @@ -43219,9 +43254,11 @@ function beforeRequest(name, query) { + /* harmony default export */ const afterRequestApi = ({ 'check_music':afterRequest_check_music, 'login_cellphone':afterRequest_login_cellphone, + 'login_status':afterRequest_login_status, 'related_playlist':afterRequest_related_playlist, 'top_playlist':afterRequest_top_playlist, 'user_detail':afterRequest_user_detail, @@ -43257,21 +43294,40 @@ const afterRequest = (result, crypto, apiName) => { const body = result.data; - let cookie = result.headers["set-cookie"]; + // let cookie = result.headers["Set-Cookie"]; + let cookie; + + for (let key in result.headers) { + if (key.toLowerCase() === 'set-cookie') { + cookie = result.headers[key]; + break; + } + } + // console.log("得到了set-cookie 的值:", cookie); // 处理字符串格式的 cookie 到一个对象 - if (typeof cookie === "string") { - cookie = cookieToJson(cookie); + // if (typeof cookie === "string") { + // console.log("cookie 是 string", cookie); + // cookie = cookieToJson(cookie); + // } + + // 处理数组格式的 cookie + if (Array.isArray(cookie)) { + cookie = cookie.join(';'); } // 对象转换为数组 - if(typeof cookie === 'object' && cookie !== null){ - cookie = Object.entries(cookie).map(([key, value]) => `${key}=${value}`); - } + // if(typeof cookie === 'object' && cookie !== null){ + // console.log("cookie 是 object", cookie); + // cookie = Object.entries(cookie).map(([key, value]) => `${key}=${value}`); + // } + + answer.cookie = cookie || ""; - answer.cookie = (cookie || []).map((x) => - x.replace(/\s*Domain=[^(;|$)]+;*/, "") - ); + // 不是浏览器Domain属性不重要 + // answer.cookie = (cookie || []).map((x) => + // x.replace(/\s*Domain=[^(;|$)]+;*/, "") + // ); try { if (crypto === "eapi") { diff --git a/package/NeteaseCloudMusic/config.json b/package/NeteaseCloudMusic/config.json index da3a66a..44674f3 100644 --- a/package/NeteaseCloudMusic/config.json +++ b/package/NeteaseCloudMusic/config.json @@ -3057,5 +3057,14 @@ } } ] - } + }, + "/login/status": { + "name": "登录状态", + "explain": "说明 : 调用此接口,可获取登录状态", + "example": [ + { + "query":{} + } + ] + } } \ No newline at end of file diff --git a/package/NeteaseCloudMusic/main.py b/package/NeteaseCloudMusic/main.py index 3f29b77..7f973ef 100644 --- a/package/NeteaseCloudMusic/main.py +++ b/package/NeteaseCloudMusic/main.py @@ -2,6 +2,8 @@ import json import os.path import socket from pprint import pprint +import http.cookies +import datetime import pkg_resources import requests @@ -17,6 +19,7 @@ class NeteaseCloudMusicApi: self.DEBUG = debug # 是否开启调试模式 self.special_api = {"/playlist/track/all": self.playlist_track_all, + "/login/cellphone": self.login_cellphone, "/inner/version": self.inner_version} # 载入js代码 @@ -57,7 +60,7 @@ class NeteaseCloudMusicApi: # 处理俩个云贝接口名称转换问题 if name in yubei_special.keys(): name = yubei_special[name] - print("转换了个麻烦的路由", name) + # print("转换了个麻烦的路由", name) if name not in api_list(): if name not in yubei_special.values(): @@ -79,6 +82,8 @@ class NeteaseCloudMusicApi: else: result = self.call_api(name, query) + # + return result @staticmethod @@ -100,7 +105,7 @@ class NeteaseCloudMusicApi: if self.__cookie is None: if os.path.isfile("cookie_storage"): with open("cookie_storage", "r", encoding='utf-8') as f: - self.__cookie = f.read() + self.cookie = f.read() else: self.__cookie = "" # 如果没有cookie文件,就设置为空 @@ -110,9 +115,36 @@ class NeteaseCloudMusicApi: def cookie(self, cookie): if cookie is None: cookie = "" - self.__cookie = cookie + + _cookie = cookie + + '''判断cookie是否过期''' + + # 创建一个Morsel对象,它可以解析cookie字符串 + morsel = http.cookies.SimpleCookie(cookie) + # 获取当前时间 + now = datetime.datetime.now() + + # 只判断 __csrf 是否过期 + if not morsel.get('__csrf'): + # __csrf 不存在,不是有效cookie + _cookie = "" + else: + # 将过期时间字符串转换为datetime对象 + expires = morsel.get('__csrf')['expires'] + expires_datetime = datetime.datetime.strptime(expires, "%a, %d %b %Y %H:%M:%S GMT") + + # 判断cookie是否过期 + if now > expires_datetime: + # 过期了 + _cookie = "" + else: + # 未过期 + pass + + self.__cookie = _cookie with open("cookie_storage", "w+", encoding='utf-8') as f: - f.write(cookie) + f.write(_cookie) @property def ip(self): @@ -147,6 +179,12 @@ class NeteaseCloudMusicApi: "status": response.status_code, } + # print("headers", response.headers) + # print("headers_dict", dict(response.headers)) + + # with open("response_result.json", "w+", encoding='utf-8') as f: + # f.write(json.dumps(response_result, indent=2, ensure_ascii=False)) + result = self.ctx.call('NeteaseCloudMusicApi.afterRequest', json.dumps(response_result), request_param.get('crypto', None), @@ -184,24 +222,16 @@ class NeteaseCloudMusicApi: result = self.ctx.call('NeteaseCloudMusicApi.inner_version') return result + def login_cellphone(self, query): + """ + 手机号登录 + :param query: + :return: + """ + result = self.call_api("/login/cellphone", query) -if __name__ == '__main__': - import json - import os - from pprint import pprint - import dotenv - - dotenv.load_dotenv("../../.env") # 从.env文件中加载环境变量 - - netease_cloud_music_api = NeteaseCloudMusicApi() # 初始化API - netease_cloud_music_api.cookie = os.getenv("COOKIE") # 设置cookie - netease_cloud_music_api.DEBUG = True # 开启调试模式 - - - def songv1_test(): - # 获取歌曲详情 - response = netease_cloud_music_api.request("song_url_v1", {"id": 33894312, "level": "exhigh"}) - pprint(response) - - - songv1_test() + # 自动 填充cookie + if result["code"] == 200: + if result.get("data").get("cookie"): + self.cookie = result.get("data").get("cookie") + return result diff --git a/package/README.md b/package/README.md new file mode 100644 index 0000000..ba1a8a1 --- /dev/null +++ b/package/README.md @@ -0,0 +1,90 @@ +# NeteaseCloudMusic_PythonSDK +> 基于 [ NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi) 封装的 Python SDK。 +> 网易云API Python版本。 +> 现已同步原项目接口且测试通过的有200多个 +> 已发布到PyPi,可直接使用pip安装 +> 项目地址:[GitHub](https://github.com/2061360308/NeteaseCloudMusic_PythonSDK) + +![](https://img.shields.io/badge/py_mini_racer-@0.6.0-red.svg) +![License](https://img.shields.io/badge/license-MIT-yellow) + +### 依赖于 +- [ NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi) +- [ NeteaseCloudMusicApi_V8 ](https://github.com/2061360308/NeteaseCloudMusicApi_V8) + +### 原理 +- 通过 `py_mini_racer` 调用 `NeteaseCloudMusicApi_V8` 的 `js` 方法。进一步进行了简单封装。 + +### 使用 +- 安装 `pip install NeteaseCloudMusic` +- 导入API进行使用(具体查看`test.py`中的示例) +```python +from NeteaseCloudMusic import NeteaseCloudMusicApi, api_help, api_list +import os + +netease_cloud_music_api = NeteaseCloudMusicApi() # 初始化API +netease_cloud_music_api.cookie = os.getenv("COOKIE") # 设置cookie +response = netease_cloud_music_api.request("song_url_v1", {"id": 33894312, "level": "exhigh"}) # 调用API + +# 获取帮助 +print(api_help()) +print(api_help('song_url_v1')) +# 获取API列表 +print(api_list()) +``` + +> 注意: request(self, name, query=None) 的第一个参数为API名称,第二个参数为API参数,具体API名称和参数请参考 [NeteaseCloudMusicApi文档](https://docs.neteasecloudmusicapi.binaryify.com),name支持`/song/url/v1`和`song_url_v1`两种写法。 + + +### 开发 +- 克隆项目 `git clone git@github.com:2061360308/NeteaseCloudMusic_PythonSDK.git` +- 安装依赖 `pip install -r requirements.txt` +- 目录/文件说明 +├── package 项目包根目录 +├── test_gender 生成测试代码的脚本 +├── test.py 手动测试/ 使用示例 + + +### 改进 +> 下列API未支持 +> +- apicache.js +- memory-cache.js +- request_reference.js +- avatar_upload.js +- cloud.js +- playlist_cover_update.js +- voice_upload.js +- register_anonimous.js +- verify_getQr.js + +> 以下api未测试(这些接口测试起来比较繁琐) +> +- /user/replacephone +- /audio/match +- /rebind +- /nickname/check +- /activate/init/profile +- /cellphone/existence/check +- /register/cellphone +- /captcha/verify +- /captcha/sent +- /login/refresh +- /logout +- /user/update +- /pl/count +- /playlist/update +- /playlist/desc/update +- /playlist/name/update +- /playlist/tags/update +- /event/forward +- /event/del +- /share/resource +- /send/text +- /send/playlist +- /playlist/create +- /playlist/tracks +- /daily_signin +- /fm_trash + +### 欢迎提交PR diff --git a/package/dist/NeteaseCloudMusic-0.1.3.tar.gz b/package/dist/NeteaseCloudMusic-0.1.3.tar.gz deleted file mode 100644 index 9860568..0000000 Binary files a/package/dist/NeteaseCloudMusic-0.1.3.tar.gz and /dev/null differ diff --git a/package/dist/NeteaseCloudMusic-0.1.3-py2.py3-none-any.whl b/package/dist/NeteaseCloudMusic-0.1.4-py2.py3-none-any.whl similarity index 98% rename from package/dist/NeteaseCloudMusic-0.1.3-py2.py3-none-any.whl rename to package/dist/NeteaseCloudMusic-0.1.4-py2.py3-none-any.whl index 4a5f76d..d20ad74 100644 Binary files a/package/dist/NeteaseCloudMusic-0.1.3-py2.py3-none-any.whl and b/package/dist/NeteaseCloudMusic-0.1.4-py2.py3-none-any.whl differ diff --git a/package/dist/NeteaseCloudMusic-0.1.4.tar.gz b/package/dist/NeteaseCloudMusic-0.1.4.tar.gz new file mode 100644 index 0000000..10d526c Binary files /dev/null and b/package/dist/NeteaseCloudMusic-0.1.4.tar.gz differ diff --git a/test.py b/test.py index 921cc1d..a8317f7 100644 --- a/test.py +++ b/test.py @@ -12,7 +12,7 @@ from package.NeteaseCloudMusic import NeteaseCloudMusicApi, api_help, api_list dotenv.load_dotenv() # 从.env文件中加载环境变量 netease_cloud_music_api = NeteaseCloudMusicApi() # 初始化API -netease_cloud_music_api.cookie = os.getenv("COOKIE") # 设置cookie +# netease_cloud_music_api.cookie = os.getenv("COOKIE") # 设置cookie netease_cloud_music_api.DEBUG = True # 开启调试模式 @@ -42,7 +42,6 @@ def user_account_test(): def comment_new_test(): - # 获取用户账号信息 response = netease_cloud_music_api.request("comment_new", { "type": "0", "id": "1407551413", @@ -73,16 +72,13 @@ def top_playlist_highquality_test(): def captcha_sent_test(): - response = netease_cloud_music_api.request("/captcha/sent", {"phone": "15234941791"}) + response = netease_cloud_music_api.request("/captcha/sent", {"phone": "15229954305"}) pprint(response) def login_cellphone_test(): - # 注意这里需要调用login_cellphone方法,而不是api方法,具体实现可以看main.py - # 有后续操作的api都需要自己实现一下 - pass - # response = netease_cloud_music_api.login_cellphone("15234941791", "9464") - # pprint(response) + response = netease_cloud_music_api.request("/login/cellphone",{"phone": "15229954305", "captcha": "4273"}) + pprint(response) def personalized_djprogram_test(): @@ -100,7 +96,7 @@ if __name__ == '__main__': # print(api_list()) # print(api_help()) # song_url_v1_test() - top_mv_test() + # top_mv_test() # search_test() # search_default_test() # user_account_test() @@ -109,4 +105,4 @@ if __name__ == '__main__': # playlist_detail_test() # top_playlist_highquality_test() # captcha_sent_test() - # login_cellphone_test() + login_cellphone_test() diff --git a/临时文件.py b/临时文件.py deleted file mode 100644 index 016c191..0000000 --- a/临时文件.py +++ /dev/null @@ -1,12 +0,0 @@ -from pprint import pprint - -others = { - -} - -ignore = [] - -for i in others.keys(): - ignore.append(i) - -pprint(ignore) \ No newline at end of file