Revert "[flickr] restore image quality"
This reverts commit 3f513f1056.
Both live.staticflickr and farmN.staticflickr servers now produce the
same image file with a lower overall quality than before this change in
Flickr's end.
This commit is contained in:
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
from .common import Extractor, Message
|
from .common import Extractor, Message
|
||||||
from .. import text, oauth, util, exception
|
from .. import text, oauth, util, exception
|
||||||
import random
|
|
||||||
|
|
||||||
|
|
||||||
class FlickrExtractor(Extractor):
|
class FlickrExtractor(Extractor):
|
||||||
@@ -26,13 +25,12 @@ class FlickrExtractor(Extractor):
|
|||||||
self.load_extra = self.config("metadata", False)
|
self.load_extra = self.config("metadata", False)
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
farm = "//farm{}.".format(random.randint(1, 9))
|
|
||||||
info = self.data()
|
info = self.data()
|
||||||
yield Message.Version, 1
|
yield Message.Version, 1
|
||||||
yield Message.Directory, info
|
yield Message.Directory, info
|
||||||
for photo in self.photos():
|
for photo in self.photos():
|
||||||
photo.update(info)
|
photo.update(info)
|
||||||
url = photo["photo"]["source"].replace("//live.", farm)
|
url = photo["photo"]["source"]
|
||||||
yield Message.Url, url, text.nameext_from_url(url, photo)
|
yield Message.Url, url, text.nameext_from_url(url, photo)
|
||||||
|
|
||||||
def data(self):
|
def data(self):
|
||||||
@@ -96,8 +94,7 @@ class FlickrImageExtractor(FlickrExtractor):
|
|||||||
info = {"id": self.item_id}
|
info = {"id": self.item_id}
|
||||||
|
|
||||||
info["photo"] = size
|
info["photo"] = size
|
||||||
farm = "//farm{}.".format(random.randint(1, 9))
|
url = size["source"]
|
||||||
url = size["source"].replace("//live.", farm)
|
|
||||||
text.nameext_from_url(url, info)
|
text.nameext_from_url(url, info)
|
||||||
|
|
||||||
yield Message.Version, 1
|
yield Message.Version, 1
|
||||||
|
|||||||
Reference in New Issue
Block a user