From 0db8c4931af8c9bc7c483c7557c9092a9525861f Mon Sep 17 00:00:00 2001 From: Jesse Zhu Date: Tue, 5 Sep 2017 03:05:20 +0900 Subject: [PATCH] build & bump version --- dist/app.js | 29 ++++++++++++++++++++--------- dist/modules/utils/netease/index.js | 14 ++++++++++++++ package.json | 2 +- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/dist/app.js b/dist/app.js index 692b9b8..f7ca86a 100644 --- a/dist/app.js +++ b/dist/app.js @@ -38,6 +38,10 @@ var _modify = require('./modules/modify'); var modify = _interopRequireWildcard(_modify); +var _netease = require('./modules/utils/netease'); + +var _netease2 = _interopRequireDefault(_netease); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -70,19 +74,26 @@ app.use(function () { return _context.abrupt('return'); case 11: - _context.prev = 11; + if (Array.isArray(json.data)) { + json.data = json.data.map(function (e) { + return _netease2.default.fixJsonData(e); + }); + } else { + json.data = _netease2.default.fixJsonData(json.data); + } + _context.prev = 12; ctx.body = json; - _context.next = 15; + _context.next = 16; return next(); - case 15: - _context.next = 22; + case 16: + _context.next = 23; break; - case 17: - _context.prev = 17; - _context.t1 = _context['catch'](11); + case 18: + _context.prev = 18; + _context.t1 = _context['catch'](12); if (_config2.default.verbose) { console.log(_context.t1); @@ -90,12 +101,12 @@ app.use(function () { ctx.body = json; console.log('Modify failed.'.red); - case 22: + case 23: case 'end': return _context.stop(); } } - }, _callee, undefined, [[2, 6], [11, 17]]); + }, _callee, undefined, [[2, 6], [12, 18]]); })); return function (_x, _x2) { diff --git a/dist/modules/utils/netease/index.js b/dist/modules/utils/netease/index.js index 1e1e8ce..b10debc 100644 --- a/dist/modules/utils/netease/index.js +++ b/dist/modules/utils/netease/index.js @@ -8,6 +8,10 @@ var _getIterator2 = require('babel-runtime/core-js/get-iterator'); var _getIterator3 = _interopRequireDefault(_getIterator2); +var _assign = require('babel-runtime/core-js/object/assign'); + +var _assign2 = _interopRequireDefault(_assign); + var _promise = require('babel-runtime/core-js/promise'); var _promise2 = _interopRequireDefault(_promise); @@ -176,6 +180,16 @@ var Netease = function () { }); }); } + }, { + key: 'fixJsonData', + value: function fixJsonData(body) { + return (0, _assign2.default)({}, body, { + url: null, + type: null, + md5: null, + uf: null + }); + } }, { key: 'modifyPlayerApiCustom', value: function () { diff --git a/package.json b/package.json index c7f4bfc..63df627 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "unblock-netease-music", - "version": "2.5.4", + "version": "2.5.5", "scripts": { "start": "babel-node -- src/bin/unblockneteasemusic -p 8123 -v", "build": "rm -rf dist && babel src --out-dir dist"