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
Migrate to 7TV v3 api #412
Conversation
I just tried it on my end and it didn't work, throws the |
The one time I don't test... Working on it. Thank you for testing it |
Found the problem! The old api was structured: [
{
},
{
},
] where each {
...data...
"emotes": [
{
},
{
}
]
...data...
} where each The key difference is that the new API isn't wrapped in |
The old and new APIs looked close enough to me when I initially checked their outputs, but I should've looked further. If the JArray exception hadn't happened then it would've failed in other ways. They completely restructured the API, it wasn't just a renaming like last time. |
It should still be valid (its an array of json objects).
Should be able to first create a JSON object and get its value for the
"emotes" which is then the json array you expect.
…On Sun, Nov 6, 2022 at 10:58 PM Scrub ***@***.***> wrote:
The old and new APIs looked close enough to me when I initially checked
their outputs, but I should've looked further. If this hadn't happened then
it would've failed in other ways. They completely restructured the API, it
wasn't just a renaming like last time.
—
Reply to this email directly, view it on GitHub
<#412 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ6TYUWX3PJBUSCCZ525BLWHBV55ANCNFSM6AAAAAARYRDEKM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Yes, that was more or less the plan. But many properties were renamed or moved, for example the |
To get the file you need to get it from the "host"
You might be able to just assume there is always there is a webp there (I would put a check that goes through "files" and ensures there is a webp). For example chatterino only uses webp versions currently. {
"id": "6185d97a8d50b5f26ee802fb",
"name": "PartyParrot",
"flags": 0,
"timestamp": 1657657262073,
"actor_id": null,
"data": {
"id": "6185d97a8d50b5f26ee802fb",
"name": "PartyParrot",
"flags": 0,
"lifecycle": 3,
"listed": true,
"animated": true,
"host": {
"url": "//cdn.7tv.app/emote/6185d97a8d50b5f26ee802fb",
"files": [
{
"name": "1x.webp",
"static_name": "1x",
"width": 32,
"height": 32,
"size": 7540,
"format": "WEBP"
},
....
]
}
}
} |
Here are the definitions: There are actually a few extra checks that need to be made that is not currently checked.
If you want good examples see sodapoppin's channel:
|
My adaptation is complete. If you test it for yourself, odds are you'll end up with a slightly smaller output json because the streamer has unlisted emotes. I used Mizkif and he has an unlisted emote that the v2 parser did not ignore. Please let me know if you have any critiques of my code, this is my first time properly working with Newtonsoft.Json |
Does SkiaSharp not support AVIF? IMO, it'd be better if it was preferred
instead of WEBP, as it features better compression and weighs less.
|
Looks like SkiaSharp does support AVIF as of 2.88.1. I just figured may as well prefer webp since Chatterino does |
Also currently master is on SkiaSharp 2.80.2. In #407 I updated the SkiaSharp packages to 2.88.3, so that would need to be merged first before prioritizing AVIF. |
Fixes #410