Skip to content

Commit

Permalink
[newgrounds] set suitabilities filter before starting a search
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 11, 2022
1 parent 58a7921 commit 4acc31b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
8 changes: 7 additions & 1 deletion gallery_dl/extractor/newgrounds.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -529,6 +529,12 @@ def __init__(self, match):
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):
Expand Down
4 changes: 2 additions & 2 deletions gallery_dl/version.py
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 4acc31b

Please sign in to comment.