mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-20 04:31:55 +02:00
Update regex pattern in getTag method
The regular expression pattern used to match tags in URLs in the DanbooruRipper class's getTag method has been updated. Handles both /posts?tags=rakeemspoon&z=2 and /posts?tags=rakeemspoon ([^&]*) -> anything but & (?:&z=([0-9]+))? -> optional regex -> if & exists, then we check z=numbers
This commit is contained in:
@@ -172,7 +172,7 @@ public class DanbooruRipper extends AbstractJSONRipper {
|
||||
}
|
||||
|
||||
private String getTag(URL url) throws MalformedURLException {
|
||||
gidPattern = Pattern.compile("https?://danbooru.donmai.us/(posts)?.*([?&]tags=([a-zA-Z0-9$_.+!*'(),%-]+))(&|(#.*)?$)");
|
||||
gidPattern = Pattern.compile("https?://danbooru.donmai.us/(posts)?.*([?&]tags=([^&]*)(?:&z=([0-9]+))?$)");
|
||||
Matcher m = gidPattern.matcher(url.toExternalForm());
|
||||
|
||||
if (m.matches()) {
|
||||
|
Reference in New Issue
Block a user