[booru] add 'url' option

pull/3531/head
Mike Fährmann 2 years ago
parent c87bd1a752
commit 512abeb4ae
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -3245,6 +3245,18 @@ Description
Note: This requires 1 additional HTTP request per post. Note: This requires 1 additional HTTP request per post.
extractor.[booru].url
---------------------
Type
``string``
Default
``"file_url"``
Example
``"preview_url"``
Description
Alternate field name to retrieve download URLs from.
extractor.[manga-extractor].chapter-reverse extractor.[manga-extractor].chapter-reverse
------------------------------------------- -------------------------------------------
Type Type

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2015-2022 Mike Fährmann # Copyright 2015-2023 Mike Fährmann
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License version 2 as
@ -27,6 +27,10 @@ class BooruExtractor(BaseExtractor):
notes = self.config("notes", False) notes = self.config("notes", False)
fetch_html = tags or notes fetch_html = tags or notes
url_key = self.config("url")
if url_key:
self._file_url = operator.itemgetter(url_key)
for post in self.posts(): for post in self.posts():
try: try:
url = self._file_url(post) url = self._file_url(post)

Loading…
Cancel
Save