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

pull/1740/head
Mike Fährmann 3 years ago
parent c37c2818fb
commit a316e44f8e
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -783,6 +783,19 @@ Description
* ``false``: Get posts from "Latest Updates" pages
extractor.bbc.width
-------------------
Type
``int``
Default
``1920``
Description
Specifies the requested image width.
This value must be divisble by 16 and gets rounded down otherwise.
The maximum possible value appears to be ``1920``.
extractor.blogger.videos
------------------------
Type

@ -41,6 +41,9 @@
"password": null,
"recursive": true
},
"bbc": {
"width": 1920
},
"blogger":
{
"videos": true

@ -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="', '"')
]

Loading…
Cancel
Save