diff --git a/lib/routes/weibo/keyword.js b/lib/routes/weibo/keyword.js index d1cc0238b..7bfce7aa4 100644 --- a/lib/routes/weibo/keyword.js +++ b/lib/routes/weibo/keyword.js @@ -10,6 +10,9 @@ module.exports = async (ctx) => { url: `https://m.weibo.cn/api/container/getIndex?containerid=100103type%3D61%26q%3D${encodeURIComponent(keyword)}%26t%3D0`, headers: { Referer: `https://m.weibo.cn/p/searchall?containerid=100103type%3D1%26q%3D${encodeURIComponent(keyword)}`, + 'MWeibo-Pwa': 1, + 'X-Requested-With': 'XMLHttpRequest', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', }, }); const data = response.data.data.cards[0].card_group; diff --git a/lib/routes/weibo/search/hot.js b/lib/routes/weibo/search/hot.js index 49453089d..471b23431 100644 --- a/lib/routes/weibo/search/hot.js +++ b/lib/routes/weibo/search/hot.js @@ -7,6 +7,12 @@ module.exports = async (ctx) => { method: 'get', url: 'https://m.weibo.cn/api/container/getIndex?containerid=106003type%3D25%26t%3D3%26disable_hot%3D1%26filter_type%3Drealtimehot&title=%E5%BE%AE%E5%8D%9A%E7%83%AD%E6%90%9C&extparam=filter_type%3Drealtimehot%26mi_cid%3D100103%26pos%3D0_0%26c_type%3D30%26display_time%3D1540538388&luicode=10000011&lfid=231583', + headers: { + Referer: 'https://s.weibo.com/top/summary?cate=realtimehot', + 'MWeibo-Pwa': 1, + 'X-Requested-With': 'XMLHttpRequest', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', + }, }); ctx.state.data = { diff --git a/lib/routes/weibo/user.js b/lib/routes/weibo/user.js index 85e8d108f..c2f47589e 100644 --- a/lib/routes/weibo/user.js +++ b/lib/routes/weibo/user.js @@ -20,6 +20,9 @@ module.exports = async (ctx) => { url: `https://m.weibo.cn/api/container/getIndex?type=uid&value=${uid}&containerid=${containerid}`, headers: { Referer: `https://m.weibo.cn/u/${uid}`, + 'MWeibo-Pwa': 1, + 'X-Requested-With': 'XMLHttpRequest', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', }, });