Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ private String getTerm(URL url) throws MalformedURLException {
@Override
public String getGID(URL url) throws MalformedURLException {
try {
return Utils.filesystemSafe(new URI(getTerm(url).replaceAll("&tags=", "")).getPath());
} catch (URISyntaxException ex) {
logger.error(ex);
// Get the search term and make it filesystem safe
String term = getTerm(url).replaceAll("&tags=", "");
return Utils.filesystemSafe(term);
} catch (Exception ex) {
logger.error("Error getting GID from URL: " + url, ex);
}

throw new MalformedURLException("Expected xbooru.com URL format: " + getHost() + ".com/index.php?tags=searchterm - got " + url + " instead");
Expand Down