1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[imgbox] use text.extract_all

This commit is contained in:
Mike Fährmann 2015-11-03 00:19:04 +01:00
parent 1352187758
commit e3e754eed7
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -55,9 +55,11 @@ class ImgboxExtractor(AsynchronousExtractor):
def get_file_metadata(self, page):
"""Collect metadata for a downloadable file"""
data = self.metadata.copy()
data["num"] , pos = text.extract(page, '</a> &nbsp; ', ' of ')
data["image-key"], pos = text.extract(page, '/i.imgbox.com/', '?download', pos)
data["name"] , pos = text.extract(page, ' title="', '"', pos)
data, _ = text.extract_all(page, (
("num" , '</a> &nbsp; ', ' of '),
("image-key", '/i.imgbox.com/', '?download'),
("name" , ' title="', '"'),
), values=data)
return data
def get_file_url(self, page):