Skip to content

Commit c6b02c2

Browse files
committed
BTTV API v2 -> v3
1 parent b429694 commit c6b02c2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

TwitchDownloaderWPF/PageChatRender.xaml.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ private SKBitmap DrawMessage(SKBitmap sectionImage, List<SKBitmap> imageList, Re
502502
SKRect emoteRect = new SKRect(imageLeft, imageTop, imageLeft + imageWidth, imageTop + imageHeight);
503503
sectionImageCanvas.DrawBitmap(emoteImage, emoteRect, imagePaint);
504504
}
505-
drawPos.X += emoteImage.Width;
505+
drawPos.X += (int)Math.Ceiling(imageWidth + (3 * renderOptions.image_scale));
506506
}
507507
else
508508
{
@@ -777,8 +777,8 @@ private void GetThirdPartyEmotes(List<ThirdPartyEmote> thirdPartyEmotes, Streame
777777
if (renderOptions.bttv_emotes)
778778
{
779779
//Global BTTV emotes
780-
JObject BBTV = JObject.Parse(client.DownloadString("https://api.betterttv.net/2/emotes"));
781-
foreach (var emote in BBTV["emotes"])
780+
JArray BBTV = JArray.Parse(client.DownloadString("https://api.betterttv.net/3/cached/emotes/global"));
781+
foreach (var emote in BBTV)
782782
{
783783
string id = emote["id"].ToString();
784784
byte[] bytes = client.DownloadData(String.Format("https://cdn.betterttv.net/emote/{0}/2x", id));
@@ -792,8 +792,8 @@ private void GetThirdPartyEmotes(List<ThirdPartyEmote> thirdPartyEmotes, Streame
792792
//Channel specific BTTV emotes
793793
try
794794
{
795-
JObject BBTV_channel = JObject.Parse(client.DownloadString("https://api.betterttv.net/2/channels/" + streamerInfo.name));
796-
foreach (var emote in BBTV_channel["emotes"])
795+
JObject BBTV_channel = JObject.Parse(client.DownloadString("https://api.betterttv.net/3/cached/users/twitch/" + streamerInfo.id));
796+
foreach (var emote in BBTV_channel["sharedEmotes"])
797797
{
798798
string id = emote["id"].ToString();
799799
byte[] bytes = client.DownloadData(String.Format("https://cdn.betterttv.net/emote/{0}/2x", id));
@@ -810,8 +810,8 @@ private void GetThirdPartyEmotes(List<ThirdPartyEmote> thirdPartyEmotes, Streame
810810
if (renderOptions.ffz_emotes)
811811
{
812812
//Global FFZ emotes
813-
JObject FFZ = JObject.Parse(client.DownloadString("https://api.betterttv.net/2/frankerfacez_emotes/global"));
814-
foreach (var emote in FFZ["emotes"])
813+
JArray FFZ = JArray.Parse(client.DownloadString("https://api.betterttv.net/3/cached/frankerfacez/emotes/global"));
814+
foreach (var emote in FFZ)
815815
{
816816
string id = emote["id"].ToString();
817817
byte[] bytes = client.DownloadData(String.Format("https://cdn.betterttv.net/frankerfacez_emote/{0}/1", id));
@@ -825,8 +825,8 @@ private void GetThirdPartyEmotes(List<ThirdPartyEmote> thirdPartyEmotes, Streame
825825
//Channel specific FFZ emotes
826826
try
827827
{
828-
JObject FFZ_channel = JObject.Parse(client.DownloadString("https://api.betterttv.net/2/frankerfacez_emotes/channels/" + streamerInfo.id));
829-
foreach (var emote in FFZ_channel["emotes"])
828+
JArray FFZ_channel = JArray.Parse(client.DownloadString("https://api.betterttv.net/3/cached/frankerfacez/users/twitch/" + streamerInfo.id));
829+
foreach (var emote in FFZ_channel)
830830
{
831831
string id = emote["id"].ToString();
832832
byte[] bytes;

0 commit comments

Comments
 (0)