Skip to content

Commit

Permalink
BTTV API v2 -> v3
Browse files Browse the repository at this point in the history
  • Loading branch information
lay295 committed Jan 3, 2020
1 parent b429694 commit c6b02c2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions TwitchDownloaderWPF/PageChatRender.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ private SKBitmap DrawMessage(SKBitmap sectionImage, List<SKBitmap> imageList, Re
SKRect emoteRect = new SKRect(imageLeft, imageTop, imageLeft + imageWidth, imageTop + imageHeight);
sectionImageCanvas.DrawBitmap(emoteImage, emoteRect, imagePaint);
}
drawPos.X += emoteImage.Width;
drawPos.X += (int)Math.Ceiling(imageWidth + (3 * renderOptions.image_scale));
}
else
{
Expand Down Expand Up @@ -777,8 +777,8 @@ private void GetThirdPartyEmotes(List<ThirdPartyEmote> thirdPartyEmotes, Streame
if (renderOptions.bttv_emotes)
{
//Global BTTV emotes
JObject BBTV = JObject.Parse(client.DownloadString("https://api.betterttv.net/2/emotes"));
foreach (var emote in BBTV["emotes"])
JArray BBTV = JArray.Parse(client.DownloadString("https://api.betterttv.net/3/cached/emotes/global"));
foreach (var emote in BBTV)
{
string id = emote["id"].ToString();
byte[] bytes = client.DownloadData(String.Format("https://cdn.betterttv.net/emote/{0}/2x", id));
Expand All @@ -792,8 +792,8 @@ private void GetThirdPartyEmotes(List<ThirdPartyEmote> thirdPartyEmotes, Streame
//Channel specific BTTV emotes
try
{
JObject BBTV_channel = JObject.Parse(client.DownloadString("https://api.betterttv.net/2/channels/" + streamerInfo.name));
foreach (var emote in BBTV_channel["emotes"])
JObject BBTV_channel = JObject.Parse(client.DownloadString("https://api.betterttv.net/3/cached/users/twitch/" + streamerInfo.id));
foreach (var emote in BBTV_channel["sharedEmotes"])
{
string id = emote["id"].ToString();
byte[] bytes = client.DownloadData(String.Format("https://cdn.betterttv.net/emote/{0}/2x", id));
Expand All @@ -810,8 +810,8 @@ private void GetThirdPartyEmotes(List<ThirdPartyEmote> thirdPartyEmotes, Streame
if (renderOptions.ffz_emotes)
{
//Global FFZ emotes
JObject FFZ = JObject.Parse(client.DownloadString("https://api.betterttv.net/2/frankerfacez_emotes/global"));
foreach (var emote in FFZ["emotes"])
JArray FFZ = JArray.Parse(client.DownloadString("https://api.betterttv.net/3/cached/frankerfacez/emotes/global"));
foreach (var emote in FFZ)
{
string id = emote["id"].ToString();
byte[] bytes = client.DownloadData(String.Format("https://cdn.betterttv.net/frankerfacez_emote/{0}/1", id));
Expand All @@ -825,8 +825,8 @@ private void GetThirdPartyEmotes(List<ThirdPartyEmote> thirdPartyEmotes, Streame
//Channel specific FFZ emotes
try
{
JObject FFZ_channel = JObject.Parse(client.DownloadString("https://api.betterttv.net/2/frankerfacez_emotes/channels/" + streamerInfo.id));
foreach (var emote in FFZ_channel["emotes"])
JArray FFZ_channel = JArray.Parse(client.DownloadString("https://api.betterttv.net/3/cached/frankerfacez/users/twitch/" + streamerInfo.id));
foreach (var emote in FFZ_channel)
{
string id = emote["id"].ToString();
byte[] bytes;
Expand Down

0 comments on commit c6b02c2

Please sign in to comment.