get-redirect-url
v0.0.3
Published
获取302重定向后的Url地址
Downloads
4
Readme
get-redirect-url
拿到重定向后的Url地址。
Url重定向
举个例子。
-> http://short.58.com/zd_m/a74880fe-dd58-4ab1-88ac-465c1d9cb3ac/?target=k-16-xgk_eh_psfegvimob_32610440437446q-feykn&end=end&from=fcm2_new_hz
-> http://jing.58.com/adJump?adType=3&target=pZwY0jCfsvY8PH98mvqVsv6lsvRz0v6fIyu6Uh0fnWb3PH0knj0knWDknj63sMPCIAd_sjD3rj9YPW9kPHDOPH0zPjb1rjb3nWNknjNOrikdPHEkPHEvPBk_FhQfuvIGU-qd0vRzgv-b5HThuA-107qWmgw-5HDzFhwG0LKxUAqWmykqP1bhmvQGuyOYgLR1ugFxpyEqFhR8IA-YXy-b5HcOrjNLnjTLnjcQnjT3FMR1ugFGujYYPWTzPj0LPWNQnH0vPauGUyRG5iu-UMwGIZ-YXgK-5HThuyOYpgwOgvP6IANqFhR8IA-YXRq_UvP6UjYhuA-107qYpyd-5HDYrHnzPWcLP1bkPHmh0Aq1pgwGUv3qnWDhmvQGmvVGujd6P1E3rjKhuidbujN3sHw6mWDVrj66mzYYPWRWnyEOmvc1mynh0A7zmyYqnHTLP1CkFMK_mgwhULFV5HThUA-1IZGb5yQG0LwluaukmyI-gLwO0ANqnikQnk&end=end&from=fcm2_new_hz
-> http://m.58.com/hz/ershoufang/29857007021008x.shtml?from=fcm2_new_hz&adtype=3
安装
npm i get-redirect-url
使用
var Url = require('get-redirect-url')
new Url()
.get('http://short.58.com/zd_m/a74880fe-dd58-4ab1-88ac-465c1d9cb3ac/?target=k-16-xgk_eh_psfegvimob_32610440437446q-feykn&end=end&from=fcm2_new_hz')
.addRule(/http:\/\/short\.58\.com.*?/)
.addRule(/http:\/\/jxjump\.58\.com.*?/)
.addRule(/http:\/\/jing\.58\.com\/adJump.*?/)
.end(function(url) {
console.log(url);
});
License
MIT