From bef0fef16a14a4b2ca2d8328bd6a98b6abf52524 Mon Sep 17 00:00:00 2001 From: Listen 1 Date: Wed, 27 Nov 2019 18:39:25 +0800 Subject: [PATCH] Bump v0.7.5 (#15) * fix qq music can't play bug --- README.md | 6 +++++- package.json | 4 ++-- src/api/provider/qq.js | 7 ++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a8ceaf8..8ebc9df 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Listen1 Mobile V0.7.4 +# Listen1 Mobile V0.7.5 [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE) @@ -66,6 +66,10 @@ Apk 打包 ## 更新日志 +`2019-11-27` + +- 修复 qq 音乐因 user-agent 无法访问的 bug + `2019-08-09` - 修复网易云音乐无法访问的 bug diff --git a/package.json b/package.json index cb20bc7..d625309 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "listen1-mobile", - "version": "0.7.4", + "version": "0.7.5", "private": true, "scripts": { "start": "react-native start", @@ -60,4 +60,4 @@ "jest": { "preset": "react-native" } -} \ No newline at end of file +} diff --git a/src/api/provider/qq.js b/src/api/provider/qq.js index 43fb7b4..25c1645 100644 --- a/src/api/provider/qq.js +++ b/src/api/provider/qq.js @@ -49,9 +49,7 @@ function qqConvertSong(song) { album_id: `qqalbum_${song.albummid}`, img_url: qqGetImageUrl(song.albummid, 'album'), source: 'qq', - source_url: `http://y.qq.com/#type=song&mid=${ - song.songmid - }&tpl=yqq_song_detail`, + source_url: `http://y.qq.com/#type=song&mid=${song.songmid}&tpl=yqq_song_detail`, url: `qqtrack_${song.songmid}`, disabled: !qqIsPlayable(song), }; @@ -167,8 +165,11 @@ function bootstrapTrack(trackId) { 'format%22%3A%22json%22%2C%22ct%22%3A20%2C%22cv%22%3A0%7D%7D'; return fetch(targetUrl, { + method: 'GET', headers: { Referer: 'https://y.qq.com/', + 'User-Agent': + 'Mozilla/5.0 (Linux; U; Android 8.1.0; zh-cn; BLA-AL00 Build/HUAWEIBLA-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/8.9 Mobile Safari/537.36', }, }) .then(response => response.json())