-
Notifications
You must be signed in to change notification settings - Fork 22
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
[Research] Upload directly to BTTV #30
Comments
bad solution, but it could help alert user id and token: (function() {
t = localStorage.getItem('USER_TOKEN').slice(1, -1);
fetch('https://api.betterttv.net/3/account', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'authorization': `Bearer ${t}`
}
}).then(r => r.json()).then(j => j.id).then(i => prompt('', `${i} ${t}`));
})(); upload from emoteJAM: function upload(user_id, token, data) {
// data: {
// "code": <str - emote name>,
// "image: <str - base64 png or gif>,
// "justification": <str - approval notes>,
// "sharing": <bool>
// }
fetch(`https://api.betterttv.net/3/users/${user_id}/emotes`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'authorization': `Bearer ${token}`
},
body: JSON.stringify(data)
}).then(r => console.log(`success: ${r.ok}`));
} |
@Ciremun is there any convenient way for the user to get the token? Or does that require some hackerman skills with DevTools console? |
I searched bttv issues page |
@l4zygreed thank you for checking it out! |
We need to research if it's even possible to have something like a button that uploads the final emote directly to BTTV.
The text was updated successfully, but these errors were encountered: