From ed2d715019556c4072a71620ece45a421945b5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 3 Jan 2023 15:14:23 +0100 Subject: [PATCH] fix 'keywords' in extractor tests (#3491) --- gallery_dl/extractor/gelbooru.py | 4 ++-- gallery_dl/extractor/nitter.py | 4 ++-- gallery_dl/extractor/twitter.py | 4 ++-- gallery_dl/extractor/vk.py | 9 ++++----- gallery_dl/extractor/zerochan.py | 12 +++++++----- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/gallery_dl/extractor/gelbooru.py b/gallery_dl/extractor/gelbooru.py index d8109e12..8d73949b 100644 --- a/gallery_dl/extractor/gelbooru.py +++ b/gallery_dl/extractor/gelbooru.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2014-2022 Mike Fährmann +# Copyright 2014-2023 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 @@ -195,7 +195,7 @@ class GelbooruPostExtractor(GelbooruBase, # notes ("https://gelbooru.com/index.php?page=post&s=view&id=5997331", { "options": (("notes", True),), - "keywords": { + "keyword": { "notes": [ { "body": "Look over this way when you talk~", diff --git a/gallery_dl/extractor/nitter.py b/gallery_dl/extractor/nitter.py index dfe78ae4..f9c6abfc 100644 --- a/gallery_dl/extractor/nitter.py +++ b/gallery_dl/extractor/nitter.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Mike Fährmann +# Copyright 2022-2023 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 @@ -451,7 +451,7 @@ class NitterTweetExtractor(NitterExtractor): }), # age-restricted (#2354) ("https://nitter.unixfox.eu/mightbecurse/status/1492954264909479936", { - "keywords": {"date": "dt:2022-02-13 20:10:09"}, + "keyword": {"date": "dt:2022-02-13 20:10:00"}, "count": 1, }), ) diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index 22aa78e6..fb607b4e 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2016-2022 Mike Fährmann +# Copyright 2016-2023 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 @@ -772,7 +772,7 @@ class TwitterTweetExtractor(TwitterExtractor): # age-restricted (#2354) ("https://twitter.com/mightbecursed/status/1492954264909479936", { "options": (("syndication", True),), - "keywords": {"date": "dt:2022-02-13 20:10:09"}, + "keyword": {"date": "dt:2022-02-13 20:10:09"}, "count": 1, }), # media alt texts / descriptions (#2617) diff --git a/gallery_dl/extractor/vk.py b/gallery_dl/extractor/vk.py index 9b6831ba..56924521 100644 --- a/gallery_dl/extractor/vk.py +++ b/gallery_dl/extractor/vk.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2021-2022 Mike Fährmann +# Copyright 2021-2023 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 @@ -110,7 +110,7 @@ class VkPhotosExtractor(VkExtractor): "pattern": r"https://sun\d+-\d+\.userapi\.com/s/v1/if1" r"/[\w-]+\.jpg\?size=\d+x\d+&quality=96&type=album", "count": ">= 35", - "keywords": { + "keyword": { "id": r"re:\d+", "user": { "id": "398982326", @@ -122,12 +122,11 @@ class VkPhotosExtractor(VkExtractor): }), ("https://vk.com/cosplayinrussia", { "range": "15-25", - "keywords": { + "keyword": { "id": r"re:\d+", "user": { "id" : "-165740836", - "info": "Предложка открыта, кидайте ваши косплейчики. При " - "правильном оформлении они будут опубликованы", + "info": str, "name": "cosplayinrussia", "nick": "Косплей | Cosplay 18+", }, diff --git a/gallery_dl/extractor/zerochan.py b/gallery_dl/extractor/zerochan.py index 74da615d..03fd909f 100644 --- a/gallery_dl/extractor/zerochan.py +++ b/gallery_dl/extractor/zerochan.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Mike Fährmann +# Copyright 2022-2023 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 @@ -111,13 +111,15 @@ class ZerochanTagExtractor(ZerochanExtractor): test = ("https://www.zerochan.net/Perth+%28Kantai+Collection%29", { "pattern": r"https://static\.zerochan\.net/.+\.full\.\d+\.(jpg|png)", "count": "> 24", - "keywords": { + "keyword": { "extension": r"re:jpg|png", - "file_url": "", - "filename": r"re:Perth.\(Kantai.Collection\).full.\d+", + "file_url": r"re:https://static\.zerochan\.net" + r"/.+\.full\.\d+\.(jpg|png)", + "filename": r"re:(Perth\.\(Kantai\.Collection\)" + r"|Kantai\.Collection)\.full\.\d+", "height": r"re:^\d+$", "id": r"re:^\d+$", - "name": "Perth (Kantai Collection)", + "name": r"re:(Perth \(Kantai Collection\)|Kantai Collection)", "search_tags": "Perth (Kantai Collection)", "size": r"re:^\d+k$", "width": r"re:^\d+$",