If you cant download X images, try changing the code from line 923 to this
if (typeof medias === 'undefined') { try { // Verify if the tweet has media if (json.quoted_status_result && json.quoted_status_result.result && json.quoted_status_result.result.legacy && json.quoted_status_result.result.legacy.extended_entities && json.quoted_status_result.result.legacy.extended_entities.media) { let mediaEntities = json.quoted_status_result.result.legacy.extended_entities.media; medias = Object.values(mediaEntities); console.log("Medias:", medias);
// Extract image's URL let imageUrls = medias.map(media => media.media_url_https); console.log("Image URLs:", imageUrls); } else { console.warn("No media found in the quoted tweet."); medias = []; } } catch (e) { console.error("Error parsing media entities: ", e); medias = []; } }
If you cant download X images, try changing the code from line 923 to this
if (typeof medias === 'undefined') {
try {
// Verify if the tweet has media
if (json.quoted_status_result && json.quoted_status_result.result && json.quoted_status_result.result.legacy && json.quoted_status_result.result.legacy.extended_entities && json.quoted_status_result.result.legacy.extended_entities.media) {
let mediaEntities = json.quoted_status_result.result.legacy.extended_entities.media;
medias = Object.values(mediaEntities);
console.log("Medias:", medias);
// Extract image's URL
let imageUrls = medias.map(media => media.media_url_https);
console.log("Image URLs:", imageUrls);
} else {
console.warn("No media found in the quoted tweet.");
medias = [];
}
} catch (e) {
console.error("Error parsing media entities: ", e);
medias = [];
}
}