23 lines
698 B
JavaScript
23 lines
698 B
JavaScript
const axios = require("axios");
|
|
const cheerio = require("cheerio");
|
|
|
|
module.exports = {
|
|
hostnames: ["social-unlock.com"],
|
|
get: async function(url) {
|
|
url = url.split("/").slice(0, 3).join("/") + "/redirect/" + url.split("/").slice(3).join("/");
|
|
let resp = await axios({
|
|
method: "GET",
|
|
url: url,
|
|
headers: {
|
|
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0",
|
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
|
|
},
|
|
validateStatus: function(stat) {
|
|
return true;
|
|
},
|
|
maxRedirects: 1
|
|
});
|
|
|
|
return resp.request.socket._httpMessage._redirectable._currentUrl;
|
|
}
|
|
} |