| import axios from "axios" |
| import cheerio from "cheerio" |
| const Base_url = "https://220.158.234.46/" |
|
|
| async function igDownloader(Link) { |
| const hasil = [] |
| const Form = { |
| url: Link, |
| submit: "" |
| } |
| await axios(`https://downloadgram.org/`, { |
| method: "POST", |
| data: new URLSearchParams(Object.entries(Form)), |
| headers: { |
| "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", |
| "accept-language": "en-US,en;q=0.9,id;q=0.8", |
| "cache-control": "max-age=0", |
| "content-type": "application/x-www-form-urlencoded", |
| "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"90\", \"Google Chrome\";v=\"90\"", |
| "cookie": "_ga=GA1.2.1695343126.1621491858; _gid=GA1.2.28178724.1621491859; __gads=ID=8f9d3ef930e9a07b-2258e672bec80081:T=1621491859:RT=1621491859:S=ALNI_MbqLxhztDiYZttJFX2SkvYei6uGOw; __atuvc=3%7C20; __atuvs=60a6eb107a17dd75000; __atssc=google%3B2; _gat_gtag_UA_142480840_1=1" |
| }, |
| referrerPolicy: "strict-origin-when-cross-origin", |
| }).then(async res => { |
| const $ = cheerio.load(res.data) |
| let url = $('#downloadBox').find('a').attr('href'); |
| await axios(Link, { |
| method: "GET", |
| data: null, |
| headers: { |
| "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", |
| "accept-language": "en-US,en;q=0.9,id;q=0.8", |
| "cache-control": "max-age=0", |
| "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"90\", \"Google Chrome\";v=\"90\"", |
| "cookie": "ig_did=08A3C465-7D43-4D8A-806A-88F98384E63B; ig_nrcb=1; mid=X_ipMwALAAFgQ7AftbrkhIDIdXJ8; fbm_124024574287414=base_domain=.instagram.com; shbid=17905; ds_user_id=14221286336; csrftoken=fXHAj5U3mcJihQEyVXfyCzcg46lHx7QD; sessionid=14221286336%3A5n4czHpQ0GRzlq%3A28; shbts=1621491639.7673564; rur=FTW" |
| }, |
| referrerPolicy: "strict-origin-when-cross-origin" |
| }).then(respon => { |
| const ch = cheerio.load(respon.data) |
| let title = ch('title').text().trim() |
| const result = { |
| author: author, |
| result: { |
| link: url, |
| desc: title, |
| Link: Link |
| } |
| } |
| hasil.push(result) |
| }) |
| }) |
| return hasil[0] |
| } |
|
|
| export { igDownloader } |
|
|
| |