soop-chat-client
Version:
SOOP Live Chat Client
30 lines (29 loc) • 891 B
JavaScript
const headers = {
'User-Agent': 'Mozilla/5.0',
'Content-Type': 'application/x-www-form-urlencoded',
};
export const getPlayerLiveInfo = async (userId) => {
const res = await fetch(`https://live.sooplive.co.kr/afreeca/player_live_api.php?bjid=${userId}`, {
method: 'POST',
headers,
body: new URLSearchParams({
bid: userId,
type: 'live',
pwd: '',
player_type: 'html5',
stream_type: 'common',
mode: 'landing',
from_api: '0',
}),
});
const data = await res.json();
return data;
};
export const getChannelEmotes = async (userId) => {
const res = await fetch(`https://live.sooplive.co.kr/api/signature_emoticon_api.php?work=list&szBjId=${userId}`, {
method: 'GET',
headers,
});
const data = await res.json();
return data;
};