Skip to content

Commit

Permalink
Throw out redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
paultag committed Jun 3, 2015
1 parent 8cb2512 commit ea0bf9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/unlock_bad_photos.py
Expand Up @@ -17,7 +17,9 @@ def unlock(person):

print("{_id} - {photo_url}".format(**person))

if requests.get(person['photo_url']).status_code // 100 == 2:
# Count redirects as 404s because their 404 page (which says 404 on it)
# is actually a 200. TOOT TOOT.
if requests.get(person['photo_url'], allow_redirects=False).status_code // 100 == 2:
return

# Right, we've got a photo_url, but it sucks. Let's go and unlock
Expand Down

0 comments on commit ea0bf9a

Please sign in to comment.