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

Implement a check to determine if the script is being blocked as a bot before attempting to process all APID's #3

Open neRok00 opened 5 years ago

neRok00 commented 5 years ago

Suggest to check a known APID page, to ensure the script is getting the information it needs before pointlessly accessing all APID record pages.

alexbird commented 5 years ago

Here's a blocked response in case it's any use:

<html style="height:100%"><head><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><meta name="format-detection" content="telephone=no"><meta name="viewport" content="initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></head><body style="margin:0px;height:100%"><iframe id="main-iframe" src="/_Incapsula_Resource?SWUDNSAI=9&xinfo=2-10425461-0%200NNN%20RT%281567181974825%200%29%20q%280%20-1%20-1%20-1%29%20r%280%20-1%29%20B12%2811%2c56174%2c0%29%20U5&incident_id=1177000440050992195-30352920505025218&edet=12&cinfo=0b000000" frameborder=0 width="100%" height="100%" marginheight="0px" marginwidth="0px">Request unsuccessful. Incapsula incident ID: 1177000440012345678-30352920512345678</iframe></body></html>

I have changed the incident number but the length is correct