Download head-dump/heads.json from GitHub Pages instead of head-db.com

Details explained in 1ea1e06431
This commit is contained in:
Christian Koop 2023-04-06 10:40:50 +02:00
parent 1ea1e06431
commit aadf55fc0a
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
1 changed files with 2 additions and 2 deletions

View File

@ -221,13 +221,13 @@ public class EpicHeads extends SongodaPlugin {
private void downloadHeads() {
try {
InputStream is = new URL("http://www.head-db.com/dump").openStream();
InputStream is = new URL("https://songoda.github.io/EpicHeads/heads.json").openStream();
BufferedReader rd = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
String jsonText = readAll(rd);
JSONParser parser = new JSONParser();
JSONArray json = (JSONArray) parser.parse(jsonText);
try (FileWriter file = new FileWriter(getDataFolder() + "/heads.json")) {
try (FileWriter file = new FileWriter(new File(getDataFolder(), "heads.json"))) {
file.write(json.toJSONString());
}
} catch (Exception ex) {