Closed ghost closed 1 month ago
I've tried to scrape that website, but it returned negative -- Response code 401 (Unauthorized). Here is my code
import got from 'got'
import { InstagramdlArgsSchema } from '../types/index.js'
import { DEFAULT_HEADERS } from './constant.js'
import { generateHash, parseCookies, stringifyCookies } from './util.js'
export default async function instagramdlv2 (url: string) {
InstagramdlArgsSchema.parse(arguments)
const response = await got.get('https://storiesig.info/en/', {
headers: {
...DEFAULT_HEADERS
}
})
const stringify = stringifyCookies(response.headers['set-cookie']!)
const parsed = parseCookies(stringify)
console.log(parsed)
const form = {
ts: Date.now(),
url,
_s: generateHash(url),
_ts: 1696501219803,
_tsc: 0
}
const data = await got.post('https://storiesig.info/api/convert', {
headers: {
...DEFAULT_HEADERS,
cookie: stringify,
origin: 'https://storiesig.info',
'X-Xsrf-Token': parsed['XSRF-TOKEN']
},
json: form
})
throw data
}
Feel free to make a pull request in @bochilteam/scraper-instagram if you successfully scrape that website
Try to use @bochilteam/scraper 5.0.1 version
To download post, story, reel from Instagram, I recommend you to parse this site: https://storiesig.info/en/ Please!