Skip to content

2.2.16 #787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ updates:
timezone: "Europe/Paris"
pull-request-branch-name:
separator: "-"
- package-ecosystem: "npm"
directory: "/"
assignees:
- "Rakambda"
schedule:
interval: "weekly"
time: "05:00"
timezone: "Europe/Paris"
pull-request-branch-name:
separator: "-"
# - package-ecosystem: "npm"
# directory: "/"
# assignees:
# - "Rakambda"
# schedule:
# interval: "weekly"
# time: "05:00"
# timezone: "Europe/Paris"
# pull-request-branch-name:
# separator: "-"
- package-ecosystem: "nuget"
directory: "/"
assignees:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
with:
report_paths: 'miner/build/test-results/test/*.xml'
- name: Publish coverage on CodeCov
uses: codecov/codecov-action@v4.3.1
uses: codecov/codecov-action@v4.4.1
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
with:
report_paths: 'viewer/build/test-results/test/*.xml'
- name: Publish coverage on CodeCov
uses: codecov/codecov-action@v4.3.1
uses: codecov/codecov-action@v4.4.1
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2.2.15
version=2.2.16
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ awaitility-version = "4.2.1"
json-unit-version = "3.2.7"
kitteh-irc-version = "9.0.0"
hikari-cp-version = "5.1.0"
mariadb-version = "3.3.3"
mariadb-version = "3.4.0"
sqlite-version = "3.45.3.0"
mysql-version = "8.4.0"
rerunner-jupiter-version = "2.1.6"
flyway-version = "10.13.0"
selenide-version = "7.3.1"
selenide-version = "7.3.2"
lombok-version = "1.18.32"
jacocoVersion = "0.8.12"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
"const" : "mostTrusted"
}
},
"description" : "Choose the outcome that's backed by other users with the highest average return-on-investment. Requires analytics to be enabled and recordChatsPredictions to be activated.",
"description" : "Choose the outcome that's backed by other users with the highest average return-on-investment. Requires analytics to be enabled and recordUserPredictions to be activated.",
"required" : [
"type"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
"const" : "mostTrusted"
}
},
"description" : "Choose the outcome that's backed by other users with the highest average return-on-investment. Requires analytics to be enabled and recordChatsPredictions to be activated.",
"description" : "Choose the outcome that's backed by other users with the highest average return-on-investment. Requires analytics to be enabled and recordUserPredictions to be activated.",
"required" : [
"type"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ public List<User> allChannelFollows(){
String cursor = null;
do{
var response = channelFollows(100, ORDER_DESC, cursor);
if(response.isEmpty()){
log.error("Failed to load follows, response is empty");
break;
}

var followConnection = response.map(GQLResponse::getData).map(ChannelFollowsData::getUser).map(User::getFollows);

followConnection.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class DropsHighlightServiceAvailableDropsOperation extends IGQLOperation<DropsHighlightServiceAvailableDropsData>{
public DropsHighlightServiceAvailableDropsOperation(@NotNull String channelId){
super("DropsHighlightService_AvailableDrops");
addPersistedQueryExtension(new PersistedQueryExtension(1, "9a62a09bce5b53e26e64a671e530bc599cb6aab1e5ba3cbd5d85966d3940716f"));
addPersistedQueryExtension(new PersistedQueryExtension(1, "962510a535f25f33bbf85d7767982e3bb6d1b00f84dd3c7a06d8572323dfd010"));
addVariable("channelID", channelId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.jetbrains.annotations.Nullable;

@JsonTypeName("DropBenefitEdge")
@Getter
Expand All @@ -22,5 +23,6 @@ public class DropBenefitEdge extends GQLType{
@JsonProperty("entitlementLimit")
private int entitlementLimit;
@JsonProperty("claimCount")
private int claimCount;
@Nullable
private Integer claimCount;
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,7 @@ public class DropCampaign extends GQLType{
@JsonProperty("allow")
@Nullable
private DropCampaignACL allow;
@JsonProperty("summary")
@Nullable
private DropCampaignSummary summary;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package fr.rakambda.channelpointsminer.miner.api.gql.gql.data.types;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

@JsonTypeName("DropCampaignSummary")
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = true)
@ToString
public class DropCampaignSummary extends GQLType{
@JsonProperty("includesSubRequirement")
private boolean includesSubRequirement;
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
@JsonSubTypes.Type(value = CommunityMoment.class, name = "CommunityMoment"),
@JsonSubTypes.Type(value = CommunityPointsEmoteModifier.class, name = "CommunityPointsEmoteModifier"),
@JsonSubTypes.Type(value = StreamPlaybackAccessToken.class, name = "PlaybackAccessToken"),
@JsonSubTypes.Type(value = RewardCampaign.class, name = "RewardCampaign"),
@JsonSubTypes.Type(value = DropCampaignSummary.class, name = "DropCampaignSummary"),
})
@EqualsAndHashCode
public abstract class GQLType{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Inventory extends GQLType{
@JsonProperty("completedRewardCampaigns")
@NotNull
@Builder.Default
private List<DropCampaign> completedRewardCampaigns = new ArrayList<>();
private List<RewardCampaign> completedRewardCampaigns = new ArrayList<>();
@JsonProperty("gameEventDrops")
@NotNull
@Builder.Default
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package fr.rakambda.channelpointsminer.miner.api.gql.gql.data.types;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import fr.rakambda.channelpointsminer.miner.util.json.ISO8601ZonedDateTimeDeserializer;
import fr.rakambda.channelpointsminer.miner.util.json.URLDeserializer;
import fr.rakambda.channelpointsminer.miner.util.json.UnknownDeserializer;
import lombok.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.net.URL;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;

@JsonTypeName("RewardCampaign")
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = true)
@ToString
public class RewardCampaign extends GQLType{
@JsonProperty("id")
@NotNull
private String id;
@JsonProperty("name")
@Nullable
private String name;
@JsonProperty("brand")
@Nullable
private String brand;
@JsonProperty("externalURL")
@JsonDeserialize(using = URLDeserializer.class)
@Nullable
private URL externalUrl;
@JsonProperty("startAt")
@JsonDeserialize(using = ISO8601ZonedDateTimeDeserializer.class)
@Nullable
private ZonedDateTime startAt;
@JsonProperty("endAt")
@JsonDeserialize(using = ISO8601ZonedDateTimeDeserializer.class)
@Nullable
private ZonedDateTime endAt;
@JsonProperty("status")
@Nullable
private String status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.jetbrains.annotations.NotNull;
import org.openqa.selenium.devtools.v122.page.model.FrameId;
import org.openqa.selenium.devtools.v125.page.model.FrameId;
import java.io.IOException;
import java.time.Duration;
import java.util.Comparator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
public class TwitchApi{
private static final Pattern SETTINGS_URL_PATTERN = Pattern.compile("(https://static.twitchcdn.net/config/settings.*?js|https://assets.twitch.tv/config/settings.*?.js)");
private static final Pattern SPADE_URL_PATTERN = Pattern.compile("\"spade(Url|_url)\":\"(.*?)\"");
private static final Pattern M3U8_STREAM_PATTERN = Pattern.compile("(https://[/\\-.:\\\\,\"=\\w]*m3u8)", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
private static final Pattern M3U8_CHUNK_PATTERN = Pattern.compile("(https://(video-edge-|[.\\w\\-/]+\\.ttvnw.net)[.\\w\\-/]+\\.ts(\\?[.\\w\\-/=&]+)?)", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
private static final Pattern M3U8_STREAM_PATTERN = Pattern.compile("(https://[/\\-.:\\\\,\"=\\w]+\\.m3u8)", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
private static final Pattern M3U8_CHUNK_PATTERN = Pattern.compile("^(https://[/\\-.:\\\\,\"=\\w]+\\.ts(\\?[.\\w\\-/=&]+)?)", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);

private final UnirestInstance unirest;

Expand Down Expand Up @@ -138,6 +138,11 @@ public Optional<URL> getM3u8Url(@NotNull String login, @NotNull String signature
.asString();

if(!response.isSuccess()){
if(response.getStatus() == 403){
log.trace("Got 403 response for m3u8 playlist, is streamer region locked? (#783)");
return Optional.empty();
}

log.error("Failed to get streamer M3U8 content");
return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
@JsonSubTypes.Type(value = CommunityMomentStart.class, name = "active"),
@JsonSubTypes.Type(value = ActiveMultipliersUpdated.class, name = "active-multipliers-updated"),
@JsonSubTypes.Type(value = ReadNotifications.class, name = "read-notifications"),
@JsonSubTypes.Type(value = ReadAllNotifications.class, name = "read-all-notifications"),
@JsonSubTypes.Type(value = DropProgress.class, name = "drop-progress"),
@JsonSubTypes.Type(value = DropClaim.class, name = "drop-claim"),
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package fr.rakambda.channelpointsminer.miner.api.ws.data.message;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import fr.rakambda.channelpointsminer.miner.api.ws.data.message.readallnotifications.ReadAllNotificationsData;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.jetbrains.annotations.NotNull;

@JsonTypeName("read-all-notifications")
@Getter
@EqualsAndHashCode(callSuper = true)
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ReadAllNotifications extends IPubSubMessage{
@JsonProperty("data")
@NotNull
private ReadAllNotificationsData data;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package fr.rakambda.channelpointsminer.miner.api.ws.data.message.readallnotifications;

import com.fasterxml.jackson.annotation.JsonProperty;
import fr.rakambda.channelpointsminer.miner.api.ws.data.message.subtype.NotificationSummary;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.LinkedList;
import java.util.List;

@NoArgsConstructor
@AllArgsConstructor
@Getter
@EqualsAndHashCode
@ToString
@Builder
public class ReadAllNotificationsData{
@JsonProperty("notification_ids")
@Nullable
private List<String> notificationIds;
@JsonProperty("display_type")
@NotNull
private String displayType;
@JsonProperty("summary")
@NotNull
private NotificationSummary summary;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import org.openqa.selenium.devtools.Command;
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.HasDevTools;
import org.openqa.selenium.devtools.v122.network.Network;
import org.openqa.selenium.devtools.v122.network.model.RequestId;
import org.openqa.selenium.devtools.v122.network.model.RequestWillBeSent;
import org.openqa.selenium.devtools.v122.network.model.ResponseReceived;
import org.openqa.selenium.devtools.v125.network.Network;
import org.openqa.selenium.devtools.v125.network.model.RequestId;
import org.openqa.selenium.devtools.v125.network.model.RequestWillBeSent;
import org.openqa.selenium.devtools.v125.network.model.ResponseReceived;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.firefox.FirefoxProfile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@Log4j2
public class UnirestLogger implements Interceptor{
private static final String TOKEN_URL = "https://id.twitch.tv/oauth2/token";
private static final String M3U8_URL = "https://usher.ttvnw.net/api/channel/hls/";

@Override
public void onRequest(HttpRequest<?> request, Config config){
Expand Down Expand Up @@ -44,6 +45,10 @@ private static boolean shouldLogError(@NotNull HttpRequestSummary request, @NotN
return false;
}

if(request.getUrl().startsWith(M3U8_URL) && response.getStatus() == 403){
return false;
}

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@NoArgsConstructor
@AllArgsConstructor
@Log4j2
@JsonClassDescription("Choose the outcome that's backed by other users with the highest average return-on-investment. Requires analytics to be enabled and recordChatsPredictions to be activated.")
@JsonClassDescription("Choose the outcome that's backed by other users with the highest average return-on-investment. Requires analytics to be enabled and recordUserPredictions to be activated.")
public class MostTrustedPicker implements IOutcomePicker{

@JsonProperty("minTotalBetsPlacedByUser")
Expand Down
Loading
Loading