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
+5
View File
@@ -3,3 +3,8 @@ PORT=3000
# Format: CHANNELS=id1:Name1,id2:Name2
# You can find the channel ID in the URL of the streamer's Chzzk channel (e.g., chzzk.naver.com/CHANNEL_ID)
CHANNELS=4df4756104a54e28e967bff6dc08e319:KBS2,8ecd602c251f30fd7f09463e9f55609f:JTBC
# Optional: Add your Naver login cookies to access 1080p and adult streams.
# To get these, log in to Chzzk/Naver in your browser, open Developer Tools -> Application -> Cookies.
# NID_AUT=
# NID_SES=
+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;