mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 11:18:28 +00:00
Fix instagram reels download
This commit is contained in:
parent
afa33c4043
commit
cfc0d5b672
@ -142,25 +142,23 @@ export default function(obj) {
|
|||||||
if (cookie) {
|
if (cookie) {
|
||||||
dtsgId = await findDtsgId(cookie);
|
dtsgId = await findDtsgId(cookie);
|
||||||
}
|
}
|
||||||
const url = new URL('https://www.instagram.com/api/graphql/');
|
const url = new URL('https://www.instagram.com/graphql/query');
|
||||||
|
|
||||||
const requestData = {
|
const requestData = {
|
||||||
jazoest: '26406',
|
jazoest: '2947',
|
||||||
variables: JSON.stringify({
|
variables: JSON.stringify({
|
||||||
shortcode: id,
|
shortcode: id,
|
||||||
__relay_internal__pv__PolarisShareMenurelayprovider: false
|
__relay_internal__pv__PolarisShareMenurelayprovider: false
|
||||||
}),
|
}),
|
||||||
doc_id: '7153618348081770'
|
doc_id: '25531498899829322'
|
||||||
};
|
};
|
||||||
if (dtsgId) {
|
if (dtsgId) {
|
||||||
requestData.fb_dtsg = dtsgId;
|
requestData.fb_dtsg = dtsgId;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (await request(url, cookie, 'POST', requestData))
|
return (await request(url, cookie, 'POST', requestData))
|
||||||
.data
|
.data
|
||||||
?.xdt_api__v1__media__shortcode__web_info
|
?.xdt_shortcode_media;
|
||||||
?.items
|
|
||||||
?.[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function extractOldPost(data, id) {
|
function extractOldPost(data, id) {
|
||||||
@ -239,6 +237,10 @@ export default function(obj) {
|
|||||||
urls: data.image_versions2.candidates[0].url,
|
urls: data.image_versions2.candidates[0].url,
|
||||||
isPhoto: true
|
isPhoto: true
|
||||||
}
|
}
|
||||||
|
} else if(data.video_url) {
|
||||||
|
return {
|
||||||
|
urls: data.video_url,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,6 +268,7 @@ export default function(obj) {
|
|||||||
if (!data) data = await requestHTML(id);
|
if (!data) data = await requestHTML(id);
|
||||||
if (!data && cookie) data = await requestHTML(id, cookie);
|
if (!data && cookie) data = await requestHTML(id, cookie);
|
||||||
|
|
||||||
|
if(Object.keys(data).length == 2 && !data.gql_data && data.context) data = false;
|
||||||
// web app graphql api (no cookie, cookie)
|
// web app graphql api (no cookie, cookie)
|
||||||
if (!data) data = await requestGQL(id);
|
if (!data) data = await requestGQL(id);
|
||||||
if (!data && cookie) data = await requestGQL(id, cookie);
|
if (!data && cookie) data = await requestGQL(id, cookie);
|
||||||
|
Loading…
Reference in New Issue
Block a user