1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

[imgur] unescape image titles

This commit is contained in:
Mike Fährmann 2019-11-28 22:13:24 +01:00
parent bca2222559
commit e9aed62c91
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -116,8 +116,8 @@ class ImgurImageExtractor(ImgurExtractor):
image = self.api.image(self.key)
if not image["title"]:
page = self.request(self.root + "/" + self.key, fatal=False).text
title = text.extract(page, "<title>", "<")[0]
image["title"] = (title or "").rpartition(" - ")[0].strip()
title = text.extract(page, "<title>", "<")[0] or ""
image["title"] = text.unescape(title.rpartition(" - ")[0].strip())
url = self._prepare(image)
yield Message.Version, 1
yield Message.Directory, image