summaryrefslogtreecommitdiff
path: root/src/startup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/startup.cpp')
-rw-r--r--src/startup.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/startup.cpp b/src/startup.cpp
index 89e29a5..b6d09a3 100644
--- a/src/startup.cpp
+++ b/src/startup.cpp
@@ -29,7 +29,7 @@ std::optional<std::pair<std::string, std::string>> ParseCookie(const Glib::ustri
}
std::optional<Glib::ustring> 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<Glib::ustring> matches;
// regex->match_all doesnt work for some reason
@@ -43,8 +43,8 @@ std::optional<Glib::ustring> GetJavascriptFileFromAppPage(const Glib::ustring &c
start_position += str.size();
}
- if (matches.size() >= 6) {
- return matches[matches.size() - 6];
+ if (matches.size() >= 10) {
+ return matches[matches.size() - 10];
}
return {};
@@ -64,7 +64,7 @@ std::optional<uint32_t> 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)) {