update
This commit is contained in:
@@ -37,10 +37,19 @@ app.get('/stream/:channelId', async (req, res) => {
|
||||
const { channelId } = req.params;
|
||||
|
||||
try {
|
||||
const headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
|
||||
};
|
||||
|
||||
const cookies = [];
|
||||
if (process.env.NID_AUT) cookies.push(`NID_AUT=${process.env.NID_AUT}`);
|
||||
if (process.env.NID_SES) cookies.push(`NID_SES=${process.env.NID_SES}`);
|
||||
if (cookies.length > 0) {
|
||||
headers['Cookie'] = cookies.join('; ');
|
||||
}
|
||||
|
||||
const response = await axios.get(`https://api.chzzk.naver.com/service/v3/channels/${channelId}/live-detail`, {
|
||||
headers: {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
|
||||
}
|
||||
headers
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
|
||||
Reference in New Issue
Block a user