Skip to content

Commit

Permalink
update protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
zephyrzoom committed Aug 30, 2016
1 parent 62e25ba commit dc33761
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/config.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"music":"true","desktopDanmu":"true"}
{"music":"true","desktopDanmu":"false"}
3 changes: 2 additions & 1 deletion app/danmu/danmu.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const http = require('http');
const net = require('net');

const CHATROOM = 'http://riven.panda.tv/chatroom/getinfo?roomid=';

exports.getChatInfo = function getChatInfo(roomid, callback) {
http.get('http://www.panda.tv/ajax_chatinfo?roomid=' + roomid, function(res) {
http.get(CHATROOM + roomid, function(res) {
res.on('data', function(chunk) {
const json = JSON.parse(chunk);
const jsonData = json.data;
Expand Down
2 changes: 1 addition & 1 deletion app/player/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports.search = function search(name, callback) {
};

exports.select = function select(num) {
id = JSON.parse(searchList).result.songs[num - 1].id;
id = JSON.parse(searchList)[num - 1].id;
console.log(id);
if (id) {
getMusicUrl();
Expand Down
1 change: 1 addition & 0 deletions app/player/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function getDanmu(danmu) {
const diange = danmuParse(danmu[2]);
if (diange && diange[0] === 'diange') {
player.search(diange[1], () => {
// 默认选择第一首歌
player.select(1);
});
}
Expand Down
3 changes: 3 additions & 0 deletions log/log.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
8/30/2016, 10:52:12 PM 点歌成功
8/30/2016, 10:52:56 PM 切歌成功
8/30/2016, 10:53:06 PM 点歌成功
1 change: 1 addition & 0 deletions log/playlist.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
播放列表
1. 理想三旬
9 changes: 5 additions & 4 deletions test/netease.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const {api} = require('NeteaseCloudMusicApi');
// api.search('理想三旬', (data) => {
// console.log(JSON.parse(data).result.songs[0].id);
// }, 10);
api.song('31445772', (data) => {
api.search('玫瑰', (data) => {
console.log(JSON.parse(data)[0].id);
// console.log(JSON.parse(data).result.songs[0].id);
}, 10);
api.song('28053533', (data) => {
console.log(data);
console.log(JSON.parse(data).songs[0].mp3Url);
});
Expand Down

0 comments on commit dc33761

Please sign in to comment.