update
This commit is contained in:
@@ -3,3 +3,8 @@ PORT=3000
|
|||||||
# Format: CHANNELS=id1:Name1,id2:Name2
|
# 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)
|
# 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
|
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=
|
||||||
|
|||||||
@@ -37,10 +37,19 @@ app.get('/stream/:channelId', async (req, res) => {
|
|||||||
const { channelId } = req.params;
|
const { channelId } = req.params;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`https://api.chzzk.naver.com/service/v3/channels/${channelId}/live-detail`, {
|
const headers = {
|
||||||
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'
|
'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
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user