Skip to content

Commit cd7dcf7

Browse files
committed
Update dependencies - node v24.3, streamlink v7.4, and packages.
1 parent bb80def commit cd7dcf7

5 files changed

Lines changed: 445 additions & 215 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.9-alpine3.20
1+
FROM node:24.3-alpine3.22
22

33
RUN apk --no-cache add \
44
build-base \
@@ -8,7 +8,7 @@ RUN apk --no-cache add \
88
libxslt-dev \
99
cmd:pip3 \
1010
ffmpeg \
11-
&& pip3 install --break-system-packages wheel streamlink==6.11.* \
11+
&& pip3 install --break-system-packages wheel streamlink==7.4.* \
1212
&& apk --no-cache del build-base
1313

1414
WORKDIR /app/

package.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,31 @@
77
"license": "MIT",
88
"private": false,
99
"dependencies": {
10-
"@types/cookie": "^0.6.0",
1110
"@types/inquirer": "^8.2.10",
1211
"@types/js-yaml": "^4.0.9",
13-
"@types/lodash": "^4.17.9",
14-
"@types/luxon": "^3.4.2",
15-
"@types/node": "^22.7.4",
16-
"@types/shelljs": "^0.8.15",
17-
"@types/ws": "^8.5.12",
12+
"@types/lodash": "^4.17.19",
13+
"@types/luxon": "^3.6.2",
14+
"@types/node": "^24.0.8",
15+
"@types/shelljs": "^0.8.16",
16+
"@types/ws": "^8.18.1",
1817
"@types/yargs": "^17.0.33",
1918
"chalk": "^4.1.2",
20-
"cookie": "^0.7.2",
19+
"cookie": "^1.0.2",
2120
"inquirer": "^8.2.6",
2221
"js-yaml": "^4.1.0",
2322
"lodash": "^4.17.21",
24-
"luxon": "^3.5.0",
23+
"luxon": "^3.6.1",
2524
"m3u8-parser": "^7.2.0",
2625
"restyped-axios": "^2.0.0",
27-
"shelljs": "^0.8.5",
26+
"shelljs": "^0.10.0",
2827
"ts-node": "^10.9.2",
29-
"typescript": "^5.6.2",
30-
"ws": "^8.18.0",
28+
"typescript": "^5.8.3",
29+
"ws": "^8.18.3",
3130
"yargs": "^17.7.2"
3231
},
3332
"resolutions": {
3433
"follow-redirects": "^1.15.9",
35-
"restyped-axios/axios": "^1.7.7",
36-
"shelljs/rechoir": "^0.8.0"
34+
"restyped-axios/axios": "^1.10.0"
3735
},
3836
"scripts": {
3937
"start": "./node_modules/.bin/ts-node src/index.ts"

src/download.ts

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
} from './geekyStreamsApi';
1111

1212
const processName = "streamlink";
13+
const progressMarker = "[download]";
1314

1415
export const download = (
1516
filename: string,
@@ -45,32 +46,39 @@ export const download = (
4546
recordingOffset.recordingOffset
4647
);
4748
}
48-
console.log(`${processName}: ${data}`);
49+
50+
handleDownloadOutput(data as Buffer);
4951
});
5052

51-
const progressMarker = "[download]";
52-
5353
streamStart.stderr.on("data", data => {
54-
const dataAsString = (data as Buffer).toString();
55-
if (dataAsString.indexOf(progressMarker) === 1) {
56-
readline.clearLine(process.stdout, 0);
57-
readline.cursorTo(process.stdout, 0);
58-
process.stderr.write(
59-
// these magic substringing is based on streamlink version 0.14.2 output
60-
// and may/will definitely break for outdated/future streamlink versions
61-
dataAsString.substring(
62-
dataAsString.lastIndexOf("]") + 2,
63-
dataAsString.lastIndexOf(")") + 1
64-
)
65-
);
66-
} else if (/^\s+$/.test(dataAsString)) {
67-
// ignore
68-
} else {
69-
console.log(`\n${processName}`, dataAsString);
70-
}
54+
handleDownloadOutput(data as Buffer);
7155
});
7256

7357
streamStart.on("close", code => {
7458
console.log(`${processName} exited with code ${code}`);
7559
});
7660
};
61+
62+
const handleDownloadOutput = (
63+
data: Buffer
64+
) => {
65+
const dataAsString = (data as Buffer).toString();
66+
const progressMarkerIndex = dataAsString.indexOf(progressMarker);
67+
if (progressMarkerIndex > -1 && progressMarkerIndex < 2) {
68+
readline.clearLine(process.stdout, 0);
69+
readline.cursorTo(process.stdout, 0);
70+
71+
// these magic substringing is based on streamlink version 0.14.2 output
72+
// and may/will definitely break for outdated/future streamlink versions
73+
const progressString = dataAsString.substring(
74+
dataAsString.lastIndexOf("]") + 2,
75+
dataAsString.lastIndexOf(")") + 1
76+
);
77+
78+
process.stderr.write(progressString);
79+
} else if (/^\s+$/.test(dataAsString)) {
80+
// ignore
81+
} else {
82+
console.log(`\n${processName} ${dataAsString}`);
83+
}
84+
}

src/nhltvCleengAuth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class NhltvCleengAuthenticationSession implements INhltvCleengAuthenticationSess
105105
const authorizationCookie = setCookieValues.map(x => cookie.parse(x))
106106
.find(ck => ck.token);
107107

108-
if (!authorizationCookie) {
108+
if (!authorizationCookie || !authorizationCookie.token) {
109109
throw new Error("NHL.TV Authorization cookie was not found.");
110110
}
111111

@@ -136,7 +136,7 @@ class NhltvCleengAuthenticationSession implements INhltvCleengAuthenticationSess
136136
const authorizationCookie = setCookieValues.map(x => cookie.parse(x))
137137
.find(ck => ck.token);
138138

139-
if (authorizationCookie) {
139+
if (authorizationCookie && authorizationCookie.token) {
140140
const sessionData: NhltvCleengAuthenticationSessionData = {
141141
token: authorizationCookie.token,
142142
};

0 commit comments

Comments
 (0)