diff options
Diffstat (limited to 'gallery_dl/extractor/furaffinity.py')
| -rw-r--r-- | gallery_dl/extractor/furaffinity.py | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/gallery_dl/extractor/furaffinity.py b/gallery_dl/extractor/furaffinity.py index 891e0c1..6a8744a 100644 --- a/gallery_dl/extractor/furaffinity.py +++ b/gallery_dl/extractor/furaffinity.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2020-2021 Mike Fährmann +# Copyright 2020-2022 Mike Fährmann # # 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 @@ -32,6 +32,12 @@ class FuraffinityExtractor(Extractor): 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: @@ -64,8 +70,11 @@ class FuraffinityExtractor(Extractor): def _parse_post(self, post_id): url = "{}/view/{}/".format(self.root, post_id) extr = text.extract_from(self.request(url).text) - path = extr('href="//d', '"') + if self._new_layout is None: + self._new_layout = ("http-equiv=" not in extr("<meta ", ">")) + + path = extr('href="//d', '"') if not path: self.log.warning( "Unable to download post %s (\"%s\")", @@ -84,10 +93,9 @@ class FuraffinityExtractor(Extractor): "url": "https://d" + path, }) - tags = extr('class="tags-row">', '</section>') - if tags: - # new site layout - data["tags"] = text.split_html(tags) + if self._new_layout: + data["tags"] = text.split_html(extr( + 'class="tags-row">', '</section>')) data["title"] = text.unescape(extr("<h2><p>", "</p></h2>")) data["artist"] = extr("<strong>", "<") data["_description"] = extr('class="section-body">', '</div>') @@ -306,6 +314,25 @@ class FuraffinityPostExtractor(FuraffinityExtractor): r"|http://www\.postybirb\.com", "count": 2, }), + # no tags (#2277) + ("https://www.furaffinity.net/view/45331225/", { + "keyword": { + "artist": "Kota_Remminders", + "artist_url": "kotaremminders", + "date": "dt:2022-01-03 17:49:33", + "fa_category": "Adoptables", + "filename": "1641232173.kotaremminders_chidopts1", + "gender": "Any", + "height": 905, + "id": 45331225, + "rating": "General", + "species": "Unspecified / Any", + "tags": [], + "theme": "All", + "title": "REMINDER", + "width": 1280, + }, + }), ("https://furaffinity.net/view/21835115/"), ("https://sfw.furaffinity.net/view/21835115/"), ("https://www.furaffinity.net/full/21835115/"), |
