Skip to content

Commit

Permalink
Use stream preview thumbnail instead of channel icon (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 authored Nov 27, 2023
1 parent 54eea40 commit f2fd260
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.net.URI;
import java.util.Locale;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -81,7 +82,11 @@ public AudioItem loadItem(AudioPlayerManager manager, AudioReference reference)
} else {
String title = channelInfo.get("lastBroadcast").get("title").text();

final String thumbnail = channelInfo.get("profileImageURL").text().replaceFirst("-70x70", "-300x300");
final String thumbnail = String.format(
"https://static-cdn.jtvnw.net/previews-ttv/live_user_%s-440x248.jpg",
// Using root because the turkish lowercase "i" does not have the little dot above the letter when defaulted
streamName.toLowerCase(Locale.ROOT)
);

return new TwitchStreamAudioTrack(new AudioTrackInfo(
title,
Expand Down

0 comments on commit f2fd260

Please sign in to comment.