twitter-archive-parser icon indicating copy to clipboard operation
twitter-archive-parser copied to clipboard

Bug: tweets with multiple images output with only a single image

Open lynnandtonic opened this issue 3 years ago • 2 comments

Hi again!

It looks like tweets that have more than one image include only the first image. Is it possible to include them all?

If not no worries! Thank you! 🤩

lynnandtonic avatar Nov 13 '22 01:11 lynnandtonic

I'd just noticed this as well - I'll share what I've discovered because I don't know if I'll end up getting it into a PR:

I'm looking at this tweet - json for the tweet is in multi_image.txt

There are four images attached to the tweet. 'full_text' contains a single URL ['entities']['media'] has only a single entry ['extended_entities']['media'] has the details for all four images.

I have some rudimentary code to handle it - but have done no testing to verify that it doesn't break everything else.

My approach is to build a markdown fragment while looping through the entries in ['extended_entities']['media'], and then body = body.replace(original_url, markdown) after the loop.

twoscomplement avatar Nov 13 '22 02:11 twoscomplement

Oh, this sounds like a bug. Thanks for reporting, I'll look into it.

timhutton avatar Nov 13 '22 03:11 timhutton