fix tests for turboimagehost and pinterest

pull/13/head
Mike Fährmann 8 years ago
parent 3434c5a026
commit d82508f245
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -304,7 +304,7 @@ class TurboimagehostImageExtractor(ImagehostImageExtractor):
pattern = [(r"(?:https?://)?((?:www\.)?turboimagehost\.com/p/(\d+)"
r"/[^/]+\.html)")]
test = [("http://www.turboimagehost.com/p/29690902/test--.png.html", {
"url": "c624dc7784de515342117a2678fee6ecf1032d79",
"url": "ada27a4e04f9ffd5ab7cd787f4559d5b3744520b",
"keyword": "a4527f14675e4512ef317ee0401940c711fbe012",
"content": "0c8768055e4e20e7c7259608b67799171b691140",
})]

@ -124,7 +124,8 @@ class PinterestPinitExtractor(PinterestExtractor):
def items(self):
response = self.session.head(self.url)
location = response.headers.get("Location")
if not location or location == "https://www.pinterest.com":
if not location or location in ("https://api.pinterest.com/None",
"https://www.pinterest.com"):
raise exception.NotFoundError("pin")
yield Message.Queue, location

Loading…
Cancel
Save