This commit is contained in:
Dongho Kim
2026-06-22 03:00:30 +02:00
parent 3dd505757d
commit 64f0d27468
2 changed files with 17 additions and 3 deletions
+12 -3
View File
@@ -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;