diff options
| author | 2023-03-13 02:07:49 -0400 | |
|---|---|---|
| committer | 2023-03-13 02:07:49 -0400 | |
| commit | 10987f08f8b6c510ba64f4b42d95ba67eec6e5b0 (patch) | |
| tree | 1af82cad9ac859a70cafc976a980280b939cfcc7 /gallery_dl/extractor/telegraph.py | |
| parent | 919f8ba16a7b82ba1099bd25b2c61c7881a05aa2 (diff) | |
New upstream version 1.25.0.upstream/1.25.0
Diffstat (limited to 'gallery_dl/extractor/telegraph.py')
| -rw-r--r-- | gallery_dl/extractor/telegraph.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/gallery_dl/extractor/telegraph.py b/gallery_dl/extractor/telegraph.py index 5996268..116f3af 100644 --- a/gallery_dl/extractor/telegraph.py +++ b/gallery_dl/extractor/telegraph.py @@ -68,6 +68,21 @@ class TelegraphGalleryExtractor(GalleryExtractor): "title": "Всё о друзьях моей сестрицы", }, }), + ("https://telegra.ph/Disharmonica---Saber-Nero-02-21", { + "pattern": r"https://telegra\.ph/file/[0-9a-f]+\.(jpg|png)", + "keyword": { + "author": "cosmos", + "caption": "", + "count": 89, + "date": "dt:2022-02-21 05:57:39", + "description": "", + "num_formatted": r"re:^\d{2}$", + "post_url": "https://telegra.ph" + "/Disharmonica---Saber-Nero-02-21", + "slug": "Disharmonica---Saber-Nero-02-21", + "title": "Disharmonica - Saber Nero", + }, + }), ) def metadata(self, page): @@ -89,7 +104,8 @@ class TelegraphGalleryExtractor(GalleryExtractor): return data def images(self, page): - figures = tuple(text.extract_iter(page, "<figure>", "</figure>")) + figures = (tuple(text.extract_iter(page, "<figure>", "</figure>")) or + tuple(text.extract_iter(page, "<img", ">"))) num_zeroes = len(str(len(figures))) num = 0 @@ -105,7 +121,7 @@ class TelegraphGalleryExtractor(GalleryExtractor): result.append((url, { "url" : url, - "caption" : text.unescape(caption), + "caption" : text.unescape(caption) if caption else "", "num" : num, "num_formatted": str(num).zfill(num_zeroes), })) |
