File size: 1,039 Bytes
a2b2aac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import axios from "axios"
import cheerio from "cheerio"

async function pindl(url) {
  try {
    const { data } = await axios.get(`https://www.savepin.app/download.php?url=${url}&lang=en&type=redirect`)
    const $ = cheerio.load(data)
    if ($(".download-link > div:nth-child(2) > div > table > tbody >  tr:nth-child(1) > td:nth-child(3) > a").attr("href").includes("force-save.php")) {
      var urll = decodeURIComponent($(".download-link > div:nth-child(2) > div > table > tbody > tr:nth-child(1) > td:nth-child(3) > a").attr("href").split("url=")[1])
    } else {
      var urll = $(".download-link > div:nth-child(2) > div > table > tbody > tr:nth-child(1) > td:nth-child(3) > a").attr("href")
    }
    const result = {
      status: true,
      url: urll
    }
    console.log(result)
    return result
  } catch (err) {
    result = {
      status: false,
      msg: "Error: Invalid URL!"
    }
    console.log(result)
    return result
  }
}
export { pindl }

//module.exports = { Getongoing, Getdownload, Getdetail, Getsearch }