[inkbunny] fix extraction (closes #1816)

'digitalsales', 'forsale', and 'printsales'
are no longer included in the data returned from the API.
This commit is contained in:
Mike Fährmann
2021-09-02 18:41:08 +02:00
parent 3e36543c98
commit 7645cdfb88

View File

@@ -30,9 +30,8 @@ class InkbunnyExtractor(Extractor):
def items(self): def items(self):
self.api.authenticate() self.api.authenticate()
to_bool = ("deleted", "digitalsales", "favorite", "forsale", to_bool = ("deleted", "favorite", "friends_only", "guest_block",
"friends_only", "guest_block", "hidden", "printsales", "hidden", "public", "scraps")
"public", "scraps")
for post in self.posts(): for post in self.posts():
post["date"] = text.parse_datetime( post["date"] = text.parse_datetime(
@@ -42,7 +41,8 @@ class InkbunnyExtractor(Extractor):
files = post["files"] files = post["files"]
for key in to_bool: for key in to_bool:
post[key] = (post[key] == "t") if key in post:
post[key] = (post[key] == "t")
del post["keywords"] del post["keywords"]
del post["files"] del post["files"]
@@ -81,17 +81,14 @@ class InkbunnyUserExtractor(InkbunnyExtractor):
"user_id" : "20969", "user_id" : "20969",
"comments_count" : "re:[0-9]+", "comments_count" : "re:[0-9]+",
"deleted" : bool, "deleted" : bool,
"digitalsales" : bool,
"favorite" : bool, "favorite" : bool,
"favorites_count": "re:[0-9]+", "favorites_count": "re:[0-9]+",
"forsale" : bool,
"friends_only" : bool, "friends_only" : bool,
"guest_block" : bool, "guest_block" : bool,
"hidden" : bool, "hidden" : bool,
"pagecount" : "re:[0-9]+", "pagecount" : "re:[0-9]+",
"pools" : list, "pools" : list,
"pools_count" : int, "pools_count" : int,
"printsales" : bool,
"public" : bool, "public" : bool,
"rating_id" : "re:[0-9]+", "rating_id" : "re:[0-9]+",
"rating_name" : str, "rating_name" : str,