From cdc4a303af3313541183686770e9911fcc2b8e8b Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Fri, 3 Nov 2023 01:07:03 -0400 Subject: fix build number fetch (again) i think we might need to fetch every script until we find the one with build number (i.e. the "main script" is no longer fixed in the html) --- src/startup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/startup.cpp') diff --git a/src/startup.cpp b/src/startup.cpp index 89e29a5..130ba9b 100644 --- a/src/startup.cpp +++ b/src/startup.cpp @@ -43,8 +43,8 @@ std::optional GetJavascriptFileFromAppPage(const Glib::ustring &c start_position += str.size(); } - if (matches.size() >= 6) { - return matches[matches.size() - 6]; + if (matches.size() >= 7) { + return matches[matches.size() - 7]; } return {}; -- cgit v1.2.3 From 25aadd4181b5f82f0315931b2b15953746d33af3 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 4 Nov 2023 21:15:36 -0400 Subject: use a slightly different way of getting build number --- src/startup.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/startup.cpp') diff --git a/src/startup.cpp b/src/startup.cpp index 130ba9b..1bfd9a4 100644 --- a/src/startup.cpp +++ b/src/startup.cpp @@ -43,8 +43,8 @@ std::optional GetJavascriptFileFromAppPage(const Glib::ustring &c start_position += str.size(); } - if (matches.size() >= 7) { - return matches[matches.size() - 7]; + if (matches.size() >= 2) { + return matches[matches.size() - 2]; } return {}; @@ -64,7 +64,7 @@ std::optional GetBuildNumberFromJSURL(const Glib::ustring &url, const auto res = req.execute(); if (res.error) return {}; - auto regex = Glib::Regex::create("buildNumber:\"(\\d+)\""); + auto regex = Glib::Regex::create(R"(Build Number: "\).concat\("(\d+))"); Glib::MatchInfo match; Glib::ustring string = res.text; if (regex->match(string, match)) { -- cgit v1.2.3 From 8fc83f6a54e8ac811d12dd9b4ddb3f9419ebf314 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 2 Dec 2023 21:51:30 -0500 Subject: fix build number fetch again :DDD --- src/startup.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/startup.cpp') diff --git a/src/startup.cpp b/src/startup.cpp index 1bfd9a4..b6d09a3 100644 --- a/src/startup.cpp +++ b/src/startup.cpp @@ -29,7 +29,7 @@ std::optional> ParseCookie(const Glib::ustri } std::optional GetJavascriptFileFromAppPage(const Glib::ustring &contents) { - auto regex = Glib::Regex::create(R"(/assets/\w{20}.js)"); + auto regex = Glib::Regex::create(R"(/assets/\w+\.?\w{20}\.js)"); std::vector matches; // regex->match_all doesnt work for some reason @@ -43,8 +43,8 @@ std::optional GetJavascriptFileFromAppPage(const Glib::ustring &c start_position += str.size(); } - if (matches.size() >= 2) { - return matches[matches.size() - 2]; + if (matches.size() >= 10) { + return matches[matches.size() - 10]; } return {}; -- cgit v1.2.3