1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[lolisafe] implement 'domain' option (#2575)

This commit is contained in:
Mike Fährmann 2022-05-10 12:17:59 +02:00
parent f3408a9d92
commit 6b6eb0b8f6
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 39 additions and 0 deletions

View File

@ -877,6 +877,21 @@ Description
Download embedded videos hosted on https://www.blogger.com/
extractor.cyberdrop.domain
--------------------------
Type
``string``
Default
``"auto"``
Example
``"cyberdrop.to"``
Description
Specifies the domain used by ``cyberdrop`` regardless of input URL.
Setting this option to ``"auto"``
uses the same domain as a given input URL.
extractor.danbooru.external
---------------------------
Type
@ -1531,6 +1546,20 @@ Description
the first in the list gets chosen (usually `mp3`).
extractor.lolisafe.domain
-------------------------
Type
``string``
Default
``"auto"``
Description
Specifies the domain used by a ``lolisafe`` extractor
regardless of input URL.
Setting this option to ``"auto"``
uses the same domain as a given input URL.
extractor.luscious.gif
----------------------
Type

View File

@ -50,6 +50,10 @@
{
"videos": true
},
"cyberdrop":
{
"domain": "auto"
},
"danbooru":
{
"username": null,

View File

@ -63,6 +63,12 @@ class LolisafeAlbumExtractor(LolisafeExtractor):
LolisafeExtractor.__init__(self, match)
self.album_id = match.group(match.lastindex)
domain = self.config("domain")
if domain is None or domain == "auto":
self.root = text.root_from_url(match.group(0))
else:
self.root = text.ensure_http_scheme(domain)
def items(self):
files, data = self.fetch_album(self.album_id)