neRok00 / ancestry-image-downloader

A Python script that downloads images from Ancestry.com that are related to records in your family tree.
20 stars 3 forks source link

JSONDecodeError #6

Closed Jordanski86 closed 4 years ago

Jordanski86 commented 4 years ago

I get a JSONDecodeError when calling the image_page.json() function on line 289. I'm guessing perhaps ancestry have changed the API address (line 280) that this script uses?

neRok00 commented 4 years ago

You could be right. Try change the URL on line 280 to http://www.ancestry.com/interactive/api/v2/Media/GetMediaInfo/{0}/{1}/{2} and see if it works.

Jordanski86 commented 4 years ago

You could be right. Try change the URL on line 280 to http://www.ancestry.com/interactive/api/v2/Media/GetMediaInfo/{0}/{1}/{2} and see if it works.

Thanks a lot that worked! It doesn't get all images though and gives, "An image ID could not be found. Either the record does not have an image, or the record page was in an unexpected format." for most. It downloads a different number of images each time I run it, the first run being the best. I can't figure it out why. Thanks for the script though - I have now got a fair few of them.

neRok00 commented 4 years ago

Cool.

Ancestry website might have implemented checks to make sure you aren't viewing/downloading images at an unnatural rate, which could be why it isn't downloading the same images each time. This is something I will have to investigate in the future.