diff options
| author | 2022-02-14 17:17:07 -0500 | |
|---|---|---|
| committer | 2022-02-14 17:17:07 -0500 | |
| commit | 7900ee4e3692dbd8056c3e47c81bb22eda030b65 (patch) | |
| tree | 54d10ca35e4b8538d2c61470490642b660e2ae77 /gallery_dl/extractor/wallpapercave.py | |
| parent | 99bc014c924c755f10a4a930b1a83efabd84fde1 (diff) | |
New upstream version 1.20.5.upstream/1.20.5
Diffstat (limited to 'gallery_dl/extractor/wallpapercave.py')
| -rw-r--r-- | gallery_dl/extractor/wallpapercave.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gallery_dl/extractor/wallpapercave.py b/gallery_dl/extractor/wallpapercave.py new file mode 100644 index 0000000..6c3af76 --- /dev/null +++ b/gallery_dl/extractor/wallpapercave.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- + +# Copyright 2021 David Hoppenbrouwers +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. + +"""Extractors for https://wallpapercave.com/""" + +from .common import Extractor, Message +from .. import text + + +class WallpapercaveImageExtractor(Extractor): + """Extractor for images on wallpapercave.com""" + category = "wallpapercave" + subcategory = "image" + root = "https://wallpapercave.com" + pattern = r"(?:https?://)?(?:www\.)?wallpapercave\.com" + test = ("https://wallpapercave.com/w/wp10270355", { + "content": "58b088aaa1cf1a60e347015019eb0c5a22b263a6", + }) + + def items(self): + page = self.request(text.ensure_http_scheme(self.url)).text + for path in text.extract_iter(page, 'class="download" href="', '"'): + image = text.nameext_from_url(path) + yield Message.Directory, image + yield Message.Url, self.root + path, image |
