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

[furaffinity] add 'layout' option (#2277)

to be able to force gallery-dl to parse according to a specific layout
in case its auto-detect fails
This commit is contained in:
Mike Fährmann 2022-02-11 00:00:01 +01:00
parent 4e4cb40663
commit f1c853c6ef
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 22 additions and 2 deletions

View File

@ -1257,6 +1257,20 @@ Description
You can use ``"all"`` instead of listing all values separately.
extractor.furaffinity.layout
----------------------------
Type
``string``
Default
``"auto"``
Description
Selects which site layout to expect when parsing posts.
* ``"auto"``: Automatically differentiate between ``"old"`` and ``"new"``
* ``"old"``: Expect the *old* site layout
* ``"new"``: Expect the *new* site layout
extractor.generic.enabled
-------------------------
Type

View File

@ -102,7 +102,8 @@
{
"descriptions": "text",
"external": false,
"include": "gallery"
"include": "gallery",
"layout": "auto"
},
"gfycat":
{

View File

@ -28,11 +28,16 @@ class FuraffinityExtractor(Extractor):
Extractor.__init__(self, match)
self.user = match.group(1)
self.offset = 0
self._new_layout = None
if self.config("descriptions") == "html":
self._process_description = str.strip
layout = self.config("layout")
if layout and layout != "auto":
self._new_layout = False if layout == "old" else True
else:
self._new_layout = None
def items(self):
if self._warning: