Also check robots.txt on image downloads.
We DO want to honour if images are blocked by robots.txt
This commit is contained in:
parent
5affd8af68
commit
7c15ea50d8
1 changed files with 1 additions and 0 deletions
|
@ -205,6 +205,7 @@ def getPageContent(url, session, max_content_bytes=MaxContentBytes):
|
||||||
|
|
||||||
def getImageObject(url, referrer, session, max_content_bytes=MaxImageBytes):
|
def getImageObject(url, referrer, session, max_content_bytes=MaxImageBytes):
|
||||||
"""Get response object for given image URL."""
|
"""Get response object for given image URL."""
|
||||||
|
check_robotstxt(url, session)
|
||||||
return urlopen(url, session, referrer=referrer, max_content_bytes=max_content_bytes, stream=True)
|
return urlopen(url, session, referrer=referrer, max_content_bytes=max_content_bytes, stream=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue