[newgrounds] set suitabilities filter before starting a search

pull/2197/head
Mike Fährmann 3 years ago
parent 58a7921b5c
commit 4acc31bd9f
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -1,5 +1,7 @@
# Changelog
## Unreleased
## 1.20.1 - 2022-01-08
### Additions
- [newgrounds] add `search` extractor ([#2161](https://github.com/mikf/gallery-dl/issues/2161))

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2021 Mike Fährmann
# Copyright 2018-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
@ -529,6 +529,12 @@ class NewgroundsSearchExtractor(NewgroundsExtractor):
self.query = text.parse_query(query)
def posts(self):
suitabilities = self.query.get("suitabilities")
if suitabilities:
data = {"view_suitability_" + s: "on"
for s in suitabilities.split(",")}
self.request(self.root + "/suitabilities",
method="POST", data=data)
return self._pagination("/search/conduct/" + self._path, self.query)
def metadata(self):

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
# Copyright 2016-2021 Mike Fährmann
# Copyright 2016-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
# published by the Free Software Foundation.
__version__ = "1.20.1"
__version__ = "1.20.2-dev"

Loading…
Cancel
Save