diff --git a/mod-director-core/src/main/java/net/jan/moddirector/core/manage/check/StopModReposts.java b/mod-director-core/src/main/java/net/jan/moddirector/core/manage/check/StopModReposts.java index 94ff3c4..d1e9775 100644 --- a/mod-director-core/src/main/java/net/jan/moddirector/core/manage/check/StopModReposts.java +++ b/mod-director-core/src/main/java/net/jan/moddirector/core/manage/check/StopModReposts.java @@ -33,18 +33,14 @@ public static void check(ModDirector director, URL url) throws ModDirectorExcept director.getLogger().log(ModDirectorSeverityLevel.DEBUG, "StopModReposts", "CORE", "Checking %s against StopModReposts database", url.toExternalForm()); for(StopModRepostsEntry entry : ENTRIES) { - if(entry.pattern().matcher(url.toExternalForm()).matches()) { + if(url.toExternalForm().contains(entry.domain()) ) { director.getLogger().log(ModDirectorSeverityLevel.ERROR, "StopModReposts", "CORE", "STOP! Download URL %s is flagged in StopModReposts database, ABORTING!", url.toExternalForm()); director.getLogger().log(ModDirectorSeverityLevel.ERROR, "StopModReposts", "CORE", "Domain %s is flagged", entry.domain()); director.getLogger().log(ModDirectorSeverityLevel.ERROR, "StopModReposts", "CORE", - "Advertising score: %d", entry.advertising()); - director.getLogger().log(ModDirectorSeverityLevel.ERROR, "StopModReposts", "CORE", - "Redistribution score: %d", entry.redistribution()); - director.getLogger().log(ModDirectorSeverityLevel.ERROR, "StopModReposts", "CORE", - "Miscellaneous: ", entry.miscellaneous()); + "Reason: ", entry.reason()); if(!entry.notes().isEmpty()) { director.getLogger().log(ModDirectorSeverityLevel.ERROR, "StopModReposts", "CORE", "Notes: ", entry.notes()); @@ -64,14 +60,14 @@ private static void initialize(ModDirector director) throws ModDirectorException "Initializing StopModReposts module"); try(WebGetResponse response = - WebClient.get(new URL("https://api.varden.info/smr/sitelist.php?format=json"))) { + WebClient.get(new URL("https://api.stopmodreposts.org/sites.json"))) { JavaType targetType = ConfigurationController.OBJECT_MAPPER.getTypeFactory(). constructCollectionType(List.class, StopModRepostsEntry.class); ENTRIES.addAll(ConfigurationController.OBJECT_MAPPER.readValue(response.getInputStream(), targetType)); } catch(MalformedURLException e) { throw new RuntimeException( - "https://api.varden.info/smr/sitelist.php?format=json seems to be an invalid URL?", e); + "https://api.stopmodreposts.org/sites.json seems to be an invalid URL?", e); } catch(IOException e) { throw new ModDirectorException("Failed to retrieve StopModReposts database", e); } diff --git a/mod-director-core/src/main/java/net/jan/moddirector/core/manage/check/StopModRepostsEntry.java b/mod-director-core/src/main/java/net/jan/moddirector/core/manage/check/StopModRepostsEntry.java index b1b948b..4db3183 100644 --- a/mod-director-core/src/main/java/net/jan/moddirector/core/manage/check/StopModRepostsEntry.java +++ b/mod-director-core/src/main/java/net/jan/moddirector/core/manage/check/StopModRepostsEntry.java @@ -8,28 +8,19 @@ public class StopModRepostsEntry { private final String domain; private final String path; - private final Pattern pattern; - private final int advertising; - private final int redistribution; - private final int miscellaneous; + private final String reason; private final String notes; @JsonCreator public StopModRepostsEntry( @JsonProperty(value = "domain", required = true) String domain, @JsonProperty(value = "path", required = true) String path, - @JsonProperty(value = "pattern", required = true) Pattern pattern, - @JsonProperty(value = "advertising", required = true) int advertising, - @JsonProperty(value = "redistribution", required = true) int redistribution, - @JsonProperty(value = "miscellaneous", required = true) int miscellaneous, + @JsonProperty(value = "reason", required = true) String reason, @JsonProperty(value = "notes", required = true) String notes ) { this.domain = domain; this.path = path; - this.pattern = pattern; - this.advertising = advertising; - this.redistribution = redistribution; - this.miscellaneous = miscellaneous; + this.reason = reason; this.notes = notes; } @@ -40,21 +31,9 @@ public String domain() { public String path() { return path; } - - public Pattern pattern() { - return pattern; - } - - public int advertising() { - return advertising; - } - - public int redistribution() { - return redistribution; - } - - public int miscellaneous() { - return miscellaneous; + + public int reason() { + return reason; } public String notes() {