Fixed "Could not get list of DLCs!" error in relation to SteamDB

This commit is contained in:
Jeddunk 2020-05-13 07:16:54 +02:00
parent cdcfe02cc4
commit 4fa7d72930
3 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="EntryPointsManager">
<pattern value="util.env.Default" method="Default" />
</component>
<component name="MavenProjectsManager"> <component name="MavenProjectsManager">
<option name="originalFiles"> <option name="originalFiles">
<list> <list>

View File

@ -223,6 +223,9 @@ public class Controller {
} catch (HttpStatusException e) { } catch (HttpStatusException e) {
if (e.getStatusCode() == 404) { if (e.getStatusCode() == 404) {
System.err.println("App ID empty or not found! (HTTP Status Code: 404)"); System.err.println("App ID empty or not found! (HTTP Status Code: 404)");
} else {
// e.printStackTrace();
System.err.println("STATUS CODE: " + e.getStatusCode());
} }
cancel(); cancel();
} catch (IOException e) { } catch (IOException e) {

View File

@ -146,6 +146,7 @@ public class SteamAppsListCache {
// SteamDB // SteamDB
Document steamDbDoc = Jsoup Document steamDbDoc = Jsoup
.connect("https://steamdb.info/app/" + appId + "/dlc/") .connect("https://steamdb.info/app/" + appId + "/dlc/")
.userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0")
.get(); .get();
Element steamDbDlcSection = steamDbDoc.getElementById("dlc"); Element steamDbDlcSection = steamDbDoc.getElementById("dlc");
Elements steamDbDLCElements = steamDbDlcSection.getElementsByClass("app"); Elements steamDbDLCElements = steamDbDlcSection.getElementsByClass("app");