Skip to content

Commit

Permalink
[lolisafe] implement 'domain' option (#2575)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed May 10, 2022
1 parent f3408a9 commit 6b6eb0b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions docs/gallery-dl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
{
"videos": true
},
"cyberdrop":
{
"domain": "auto"
},
"danbooru":
{
"username": null,
Expand Down
6 changes: 6 additions & 0 deletions gallery_dl/extractor/lolisafe.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ def __init__(self, match):
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)

Expand Down

0 comments on commit 6b6eb0b

Please sign in to comment.