[bbc] add 'width' option (#1706)

This commit is contained in:
Mike Fährmann
2021-07-30 01:09:32 +02:00
parent c37c2818fb
commit a316e44f8e
3 changed files with 21 additions and 1 deletions

View File

@@ -49,8 +49,12 @@ class BbcGalleryExtractor(GalleryExtractor):
}
def images(self, page):
width = self.config("width")
width = width - width % 16 if width else 1920
dimensions = "/{}xn/".format(width)
return [
(src.replace("/320x180_b/", "/1920xn/"), None)
(src.replace("/320x180_b/", dimensions), None)
for src in text.extract_iter(page, 'data-image-src="', '"')
]