mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 18:53:21 +01:00
[vk] transform image URLs to non-blurred versions (#5017)
apply the same filter from before d85e66bc
This commit is contained in:
parent
6e10260fb0
commit
db8de13537
@ -10,6 +10,7 @@
|
||||
|
||||
from .common import Extractor, Message
|
||||
from .. import text, exception
|
||||
import re
|
||||
|
||||
BASE_PATTERN = r"(?:https://)?(?:www\.|m\.)?vk\.com"
|
||||
|
||||
@ -24,6 +25,7 @@ class VkExtractor(Extractor):
|
||||
request_interval = (0.5, 1.5)
|
||||
|
||||
def items(self):
|
||||
sub = re.compile(r"/imp[fg]/").sub
|
||||
sizes = "wzyxrqpo"
|
||||
|
||||
data = self.metadata()
|
||||
@ -40,11 +42,15 @@ class VkExtractor(Extractor):
|
||||
continue
|
||||
|
||||
try:
|
||||
photo["url"] = photo[size + "src"]
|
||||
url = photo[size + "src"]
|
||||
except KeyError:
|
||||
self.log.warning("no photo URL found (%s)", photo.get("id"))
|
||||
continue
|
||||
|
||||
photo["url"] = sub("/", url.partition("?")[0])
|
||||
# photo["url"] = url
|
||||
photo["_fallback"] = (url,)
|
||||
|
||||
try:
|
||||
_, photo["width"], photo["height"] = photo[size]
|
||||
except ValueError:
|
||||
|
@ -6,4 +6,4 @@
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
__version__ = "1.26.6"
|
||||
__version__ = "1.26.7-dev"
|
||||
|
Loading…
Reference in New Issue
Block a user