diff --git a/gallery_dl/extractor/flickr.py b/gallery_dl/extractor/flickr.py index a7df86b8..c6a75096 100644 --- a/gallery_dl/extractor/flickr.py +++ b/gallery_dl/extractor/flickr.py @@ -10,6 +10,7 @@ from .common import Extractor, Message from .. import text, oauth, util, exception +import random class FlickrExtractor(Extractor): @@ -25,12 +26,13 @@ class FlickrExtractor(Extractor): self.load_extra = self.config("metadata", False) def items(self): + farm = "//farm{}.".format(random.randint(1, 9)) info = self.data() yield Message.Version, 1 yield Message.Directory, info for photo in self.photos(): photo.update(info) - url = photo["photo"]["source"] + url = photo["photo"]["source"].replace("//live.", farm) yield Message.Url, url, text.nameext_from_url(url, photo) def data(self): @@ -94,7 +96,8 @@ class FlickrImageExtractor(FlickrExtractor): info = {"id": self.item_id} info["photo"] = size - url = size["source"] + farm = "//farm{}.".format(random.randint(1, 9)) + url = size["source"].replace("//live.", farm) text.nameext_from_url(url, info) yield Message.Version, 1