Skip to content

Commit

Permalink
add User-Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Dec 9, 2016
1 parent b5b8334 commit 80ce022
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nodejs/routes/video-bilibili.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ function getData(cid, res, type) {
res.send(api);
}
else {
fetch(api, { agent:new HttpProxyAgent('http://183.61.236.54:3128/')}).then(
fetch(api, {
headers: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36'},
agent: new HttpProxyAgent('http://183.61.236.54:3128/')
}).then(
response => response.text()
).then((data) => {
parseString(data, {explicitArray: false}, function (err, result) {
Expand Down

0 comments on commit 80ce022

Please sign in to comment.