cursedbelt-server 4.70.0 → 4.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/ctgrTunnel.d.ts +1 -1
- package/dist/server/ctgrTunnel.js +12 -59
- package/dist/server/ctgrTwin.d.ts +8 -0
- package/dist/server/ctgrTwin.js +79 -0
- package/dist/server/master-lock/accountsPage.js +3 -7
- package/dist/server/master-lock/guard.js +44 -24
- package/dist/server/master-lock/lockPage.d.ts +12 -0
- package/dist/server/master-lock/lockPage.js +66 -15
- package/dist/server/youtube/youtubeApi.d.ts +5 -0
- package/dist/server/youtube/youtubeApi.js +10 -0
- package/package.json +2 -2
- package/src/server/ctgrTunnel.spec.ts +12 -0
- package/src/server/ctgrTunnel.ts +12 -71
- package/src/server/ctgrTwin.ts +98 -0
- package/src/server/master-lock/accountsPage.ts +3 -7
- package/src/server/master-lock/ctgrLockTwin.spec.ts +151 -0
- package/src/server/master-lock/guard.ts +45 -22
- package/src/server/master-lock/lockPage.ts +67 -15
- package/src/server/middleware/requestLogger.spec.ts +95 -0
- package/src/server/youtube/youtubeApi.spec.ts +27 -3
- package/src/server/youtube/youtubeApi.ts +15 -0
|
@@ -36,8 +36,20 @@ export interface TubeApiVideo {
|
|
|
36
36
|
channelTitle: string;
|
|
37
37
|
thumbnail: string;
|
|
38
38
|
url: string;
|
|
39
|
+
/**
|
|
40
|
+
* When the VIDEO went up (`contentDetails.videoPublishedAt`), epoch ms — not `snippet.publishedAt`,
|
|
41
|
+
* which is when it was added to the playlist. `null` when the reply carries none (a private video).
|
|
42
|
+
*/
|
|
43
|
+
publishedAt: number | null;
|
|
39
44
|
}
|
|
40
45
|
|
|
46
|
+
/** An RFC 3339 stamp as epoch ms, or `null` for anything absent or unparseable. */
|
|
47
|
+
const epochMs = (stamp: unknown): number | null => {
|
|
48
|
+
if (typeof stamp !== "string" || !stamp) return null;
|
|
49
|
+
const ms = Date.parse(stamp);
|
|
50
|
+
return Number.isFinite(ms) ? ms : null;
|
|
51
|
+
};
|
|
52
|
+
|
|
41
53
|
export interface TubeApiPlaylist {
|
|
42
54
|
id: string;
|
|
43
55
|
title: string;
|
|
@@ -224,6 +236,7 @@ export function createYouTubeApi(fetchImpl: FetchLike = fetch) {
|
|
|
224
236
|
channelTitle: String(snippet.videoOwnerChannelTitle ?? ""),
|
|
225
237
|
thumbnail: pickThumb(snippet.thumbnails as Thumbs) || youtubeThumbnailUrl(videoId),
|
|
226
238
|
url: watchUrl(videoId),
|
|
239
|
+
publishedAt: epochMs(details.videoPublishedAt),
|
|
227
240
|
};
|
|
228
241
|
})
|
|
229
242
|
.filter((v) => v.videoId && !UNPLAYABLE_TITLES.has(v.title)),
|
|
@@ -289,6 +302,8 @@ export function createYouTubeApi(fetchImpl: FetchLike = fetch) {
|
|
|
289
302
|
channelTitle: String(snippet.channelTitle ?? ""),
|
|
290
303
|
thumbnail: pickThumb(snippet.thumbnails as Thumbs) || youtubeThumbnailUrl(videoId),
|
|
291
304
|
url: watchUrl(videoId),
|
|
305
|
+
// On a `videos` row the snippet IS the video's, so its publishedAt is the upload.
|
|
306
|
+
publishedAt: epochMs(snippet.publishedAt),
|
|
292
307
|
};
|
|
293
308
|
})
|
|
294
309
|
.filter((v) => v.videoId),
|