offcourse 1.0.0 → 1.0.1
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/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/inspect.js +1 -1
- package/dist/cli/commands/inspect.js.map +1 -1
- package/dist/cli/commands/sync.d.ts +1 -2
- package/dist/cli/commands/sync.d.ts.map +1 -1
- package/dist/cli/commands/sync.js +13 -14
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/commands/syncHighLevel.d.ts +1 -2
- package/dist/cli/commands/syncHighLevel.d.ts.map +1 -1
- package/dist/cli/commands/syncHighLevel.js +4 -8
- package/dist/cli/commands/syncHighLevel.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/config/configManager.d.ts.map +1 -1
- package/dist/config/configManager.js +4 -0
- package/dist/config/configManager.js.map +1 -1
- package/dist/downloader/hlsDownloader.d.ts.map +1 -1
- package/dist/downloader/hlsDownloader.js +23 -14
- package/dist/downloader/hlsDownloader.js.map +1 -1
- package/dist/downloader/hlsValidator.d.ts.map +1 -1
- package/dist/downloader/hlsValidator.js +6 -2
- package/dist/downloader/hlsValidator.js.map +1 -1
- package/dist/downloader/index.d.ts +3 -0
- package/dist/downloader/index.d.ts.map +1 -1
- package/dist/downloader/index.js +3 -0
- package/dist/downloader/index.js.map +1 -1
- package/dist/downloader/loomDownloader.d.ts.map +1 -1
- package/dist/downloader/loomDownloader.js +23 -20
- package/dist/downloader/loomDownloader.js.map +1 -1
- package/dist/downloader/queue.d.ts +4 -4
- package/dist/downloader/queue.d.ts.map +1 -1
- package/dist/downloader/queue.js.map +1 -1
- package/dist/downloader/vimeoDownloader.d.ts.map +1 -1
- package/dist/downloader/vimeoDownloader.js +7 -3
- package/dist/downloader/vimeoDownloader.js.map +1 -1
- package/dist/scraper/extractor.d.ts +4 -0
- package/dist/scraper/extractor.d.ts.map +1 -1
- package/dist/scraper/extractor.js +79 -79
- package/dist/scraper/extractor.js.map +1 -1
- package/dist/scraper/highlevel/extractor.d.ts +11 -19
- package/dist/scraper/highlevel/extractor.d.ts.map +1 -1
- package/dist/scraper/highlevel/extractor.js +72 -85
- package/dist/scraper/highlevel/extractor.js.map +1 -1
- package/dist/scraper/highlevel/navigator.d.ts +3 -10
- package/dist/scraper/highlevel/navigator.d.ts.map +1 -1
- package/dist/scraper/highlevel/navigator.js +140 -127
- package/dist/scraper/highlevel/navigator.js.map +1 -1
- package/dist/scraper/highlevel/schemas.d.ts +188 -0
- package/dist/scraper/highlevel/schemas.d.ts.map +1 -0
- package/dist/scraper/highlevel/schemas.js +139 -0
- package/dist/scraper/highlevel/schemas.js.map +1 -0
- package/dist/scraper/navigator.d.ts +14 -11
- package/dist/scraper/navigator.d.ts.map +1 -1
- package/dist/scraper/navigator.js +61 -104
- package/dist/scraper/navigator.js.map +1 -1
- package/dist/scraper/schemas.d.ts +57 -0
- package/dist/scraper/schemas.d.ts.map +1 -0
- package/dist/scraper/schemas.js +135 -0
- package/dist/scraper/schemas.js.map +1 -0
- package/dist/scraper/videoInterceptor.d.ts +4 -0
- package/dist/scraper/videoInterceptor.d.ts.map +1 -1
- package/dist/scraper/videoInterceptor.js +66 -51
- package/dist/scraper/videoInterceptor.js.map +1 -1
- package/dist/shared/auth.d.ts +9 -9
- package/dist/shared/auth.d.ts.map +1 -1
- package/dist/shared/auth.js +24 -38
- package/dist/shared/auth.js.map +1 -1
- package/dist/shared/firebase.d.ts +60 -0
- package/dist/shared/firebase.d.ts.map +1 -0
- package/dist/shared/firebase.js +102 -0
- package/dist/shared/firebase.js.map +1 -0
- package/dist/shared/fs.d.ts.map +1 -1
- package/dist/shared/fs.js +4 -0
- package/dist/shared/fs.js.map +1 -1
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +3 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/slug.d.ts +11 -0
- package/dist/shared/slug.d.ts.map +1 -0
- package/{src/shared/slug.ts → dist/shared/slug.js} +10 -11
- package/dist/shared/slug.js.map +1 -0
- package/dist/shared/url.d.ts +43 -0
- package/dist/shared/url.d.ts.map +1 -0
- package/{src/shared/url.ts → dist/shared/url.js} +12 -15
- package/dist/shared/url.js.map +1 -0
- package/dist/state/database.d.ts +1 -0
- package/dist/state/database.d.ts.map +1 -1
- package/dist/state/database.js +3 -0
- package/dist/state/database.js.map +1 -1
- package/dist/storage/fileSystem.d.ts +17 -17
- package/dist/storage/fileSystem.d.ts.map +1 -1
- package/dist/storage/fileSystem.js +39 -31
- package/dist/storage/fileSystem.js.map +1 -1
- package/package.json +5 -2
- package/.github/workflows/ci.yml +0 -50
- package/.husky/commit-msg +0 -2
- package/.husky/pre-commit +0 -1
- package/.husky/pre-push +0 -3
- package/.prettierrc +0 -8
- package/.release-it.json +0 -23
- package/ARCHITECTURE.md +0 -233
- package/CHANGELOG.md +0 -78
- package/commitlint.config.js +0 -4
- package/dist/ai/openRouter.d.ts +0 -47
- package/dist/ai/openRouter.d.ts.map +0 -1
- package/dist/ai/openRouter.js +0 -116
- package/dist/ai/openRouter.js.map +0 -1
- package/dist/ai/transcriptPolisher.d.ts +0 -24
- package/dist/ai/transcriptPolisher.d.ts.map +0 -1
- package/dist/ai/transcriptPolisher.js +0 -89
- package/dist/ai/transcriptPolisher.js.map +0 -1
- package/dist/cli/commands/enrich.d.ts +0 -14
- package/dist/cli/commands/enrich.d.ts.map +0 -1
- package/dist/cli/commands/enrich.js +0 -271
- package/dist/cli/commands/enrich.js.map +0 -1
- package/dist/cli/commands/syncGhl.d.ts +0 -20
- package/dist/cli/commands/syncGhl.d.ts.map +0 -1
- package/dist/cli/commands/syncGhl.js +0 -483
- package/dist/cli/commands/syncGhl.js.map +0 -1
- package/dist/cli/commands/syncHighLevel.test.d.ts +0 -2
- package/dist/cli/commands/syncHighLevel.test.d.ts.map +0 -1
- package/dist/cli/commands/syncHighLevel.test.js +0 -102
- package/dist/cli/commands/syncHighLevel.test.js.map +0 -1
- package/dist/config/paths.test.d.ts +0 -2
- package/dist/config/paths.test.d.ts.map +0 -1
- package/dist/config/paths.test.js +0 -70
- package/dist/config/paths.test.js.map +0 -1
- package/dist/config/schema.test.d.ts +0 -2
- package/dist/config/schema.test.d.ts.map +0 -1
- package/dist/config/schema.test.js +0 -151
- package/dist/config/schema.test.js.map +0 -1
- package/dist/downloader/hlsDownloader.test.d.ts +0 -2
- package/dist/downloader/hlsDownloader.test.d.ts.map +0 -1
- package/dist/downloader/hlsDownloader.test.js +0 -116
- package/dist/downloader/hlsDownloader.test.js.map +0 -1
- package/dist/downloader/loomDownloader.test.d.ts +0 -2
- package/dist/downloader/loomDownloader.test.d.ts.map +0 -1
- package/dist/downloader/loomDownloader.test.js +0 -36
- package/dist/downloader/loomDownloader.test.js.map +0 -1
- package/dist/downloader/queue.test.d.ts +0 -2
- package/dist/downloader/queue.test.d.ts.map +0 -1
- package/dist/downloader/queue.test.js +0 -158
- package/dist/downloader/queue.test.js.map +0 -1
- package/dist/downloader/videoDownloader.d.ts +0 -32
- package/dist/downloader/videoDownloader.d.ts.map +0 -1
- package/dist/downloader/videoDownloader.js +0 -173
- package/dist/downloader/videoDownloader.js.map +0 -1
- package/dist/downloader/vimeoDownloader.test.d.ts +0 -2
- package/dist/downloader/vimeoDownloader.test.d.ts.map +0 -1
- package/dist/downloader/vimeoDownloader.test.js +0 -51
- package/dist/downloader/vimeoDownloader.test.js.map +0 -1
- package/dist/scraper/auth.d.ts +0 -29
- package/dist/scraper/auth.d.ts.map +0 -1
- package/dist/scraper/auth.js +0 -115
- package/dist/scraper/auth.js.map +0 -1
- package/dist/scraper/extractor.test.d.ts +0 -2
- package/dist/scraper/extractor.test.d.ts.map +0 -1
- package/dist/scraper/extractor.test.js +0 -65
- package/dist/scraper/extractor.test.js.map +0 -1
- package/dist/scraper/ghl/auth.d.ts +0 -25
- package/dist/scraper/ghl/auth.d.ts.map +0 -1
- package/dist/scraper/ghl/auth.js +0 -187
- package/dist/scraper/ghl/auth.js.map +0 -1
- package/dist/scraper/ghl/extractor.d.ts +0 -96
- package/dist/scraper/ghl/extractor.d.ts.map +0 -1
- package/dist/scraper/ghl/extractor.js +0 -345
- package/dist/scraper/ghl/extractor.js.map +0 -1
- package/dist/scraper/ghl/index.d.ts +0 -4
- package/dist/scraper/ghl/index.d.ts.map +0 -1
- package/dist/scraper/ghl/index.js +0 -4
- package/dist/scraper/ghl/index.js.map +0 -1
- package/dist/scraper/ghl/navigator.d.ts +0 -93
- package/dist/scraper/ghl/navigator.d.ts.map +0 -1
- package/dist/scraper/ghl/navigator.js +0 -447
- package/dist/scraper/ghl/navigator.js.map +0 -1
- package/dist/scraper/highlevel/auth.d.ts +0 -25
- package/dist/scraper/highlevel/auth.d.ts.map +0 -1
- package/dist/scraper/highlevel/auth.js +0 -189
- package/dist/scraper/highlevel/auth.js.map +0 -1
- package/dist/scraper/highlevel/extractor.test.d.ts +0 -2
- package/dist/scraper/highlevel/extractor.test.d.ts.map +0 -1
- package/dist/scraper/highlevel/extractor.test.js +0 -101
- package/dist/scraper/highlevel/extractor.test.js.map +0 -1
- package/dist/scraper/highlevel/navigator.test.d.ts +0 -2
- package/dist/scraper/highlevel/navigator.test.d.ts.map +0 -1
- package/dist/scraper/highlevel/navigator.test.js +0 -78
- package/dist/scraper/highlevel/navigator.test.js.map +0 -1
- package/dist/scraper/navigator.test.d.ts +0 -2
- package/dist/scraper/navigator.test.d.ts.map +0 -1
- package/dist/scraper/navigator.test.js +0 -63
- package/dist/scraper/navigator.test.js.map +0 -1
- package/dist/scraper/skoolApi.d.ts +0 -17
- package/dist/scraper/skoolApi.d.ts.map +0 -1
- package/dist/scraper/skoolApi.js +0 -72
- package/dist/scraper/skoolApi.js.map +0 -1
- package/dist/state/database.test.d.ts +0 -2
- package/dist/state/database.test.d.ts.map +0 -1
- package/dist/state/database.test.js +0 -34
- package/dist/state/database.test.js.map +0 -1
- package/dist/transcription/whisperService.d.ts +0 -27
- package/dist/transcription/whisperService.d.ts.map +0 -1
- package/dist/transcription/whisperService.js +0 -102
- package/dist/transcription/whisperService.js.map +0 -1
- package/eslint.config.js +0 -55
- package/src/__fixtures__/highlevel-post-response.json +0 -68
- package/src/__fixtures__/hls-master-playlist.m3u8 +0 -24
- package/src/cli/commands/__snapshots__/syncHighLevel.test.ts.snap +0 -38
- package/src/cli/commands/config.ts +0 -74
- package/src/cli/commands/inspect.ts +0 -441
- package/src/cli/commands/login.ts +0 -68
- package/src/cli/commands/status.ts +0 -147
- package/src/cli/commands/sync.ts +0 -1235
- package/src/cli/commands/syncHighLevel.test.ts +0 -144
- package/src/cli/commands/syncHighLevel.ts +0 -639
- package/src/cli/index.ts +0 -121
- package/src/config/configManager.ts +0 -75
- package/src/config/paths.test.ts +0 -83
- package/src/config/paths.ts +0 -36
- package/src/config/schema.test.ts +0 -173
- package/src/config/schema.ts +0 -65
- package/src/downloader/hlsDownloader.test.ts +0 -148
- package/src/downloader/hlsDownloader.ts +0 -327
- package/src/downloader/hlsValidator.ts +0 -196
- package/src/downloader/index.ts +0 -122
- package/src/downloader/loomDownloader.test.ts +0 -43
- package/src/downloader/loomDownloader.ts +0 -742
- package/src/downloader/queue.test.ts +0 -199
- package/src/downloader/queue.ts +0 -118
- package/src/downloader/vimeoDownloader.test.ts +0 -62
- package/src/downloader/vimeoDownloader.ts +0 -722
- package/src/scraper/extractor.test.ts +0 -124
- package/src/scraper/extractor.ts +0 -757
- package/src/scraper/highlevel/__snapshots__/extractor.test.ts.snap +0 -41
- package/src/scraper/highlevel/extractor.test.ts +0 -134
- package/src/scraper/highlevel/extractor.ts +0 -537
- package/src/scraper/highlevel/index.ts +0 -2
- package/src/scraper/highlevel/navigator.test.ts +0 -110
- package/src/scraper/highlevel/navigator.ts +0 -668
- package/src/scraper/highlevel/schemas.ts +0 -183
- package/src/scraper/navigator.test.ts +0 -122
- package/src/scraper/navigator.ts +0 -355
- package/src/scraper/schemas.ts +0 -177
- package/src/scraper/videoInterceptor.ts +0 -435
- package/src/shared/auth.test.ts +0 -58
- package/src/shared/auth.ts +0 -251
- package/src/shared/firebase.ts +0 -151
- package/src/shared/fs.ts +0 -80
- package/src/shared/http.ts +0 -34
- package/src/shared/index.ts +0 -6
- package/src/shared/url.test.ts +0 -122
- package/src/state/database.test.ts +0 -49
- package/src/state/database.ts +0 -919
- package/src/state/index.ts +0 -14
- package/src/storage/fileSystem.test.ts +0 -64
- package/src/storage/fileSystem.ts +0 -175
- package/tsconfig.json +0 -28
- package/vitest.config.ts +0 -29
package/src/downloader/index.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Video download coordination - delegates to type-specific downloaders.
|
|
3
|
-
*/
|
|
4
|
-
import { downloadFile, downloadLoomVideo, type DownloadProgress } from "./loomDownloader.js";
|
|
5
|
-
import { downloadVimeoVideo } from "./vimeoDownloader.js";
|
|
6
|
-
import { downloadHighLevelVideo, downloadHLSVideo } from "./hlsDownloader.js";
|
|
7
|
-
|
|
8
|
-
export interface VideoDownloadTask {
|
|
9
|
-
lessonId: number;
|
|
10
|
-
lessonName: string;
|
|
11
|
-
videoUrl: string;
|
|
12
|
-
videoType:
|
|
13
|
-
| "loom"
|
|
14
|
-
| "vimeo"
|
|
15
|
-
| "youtube"
|
|
16
|
-
| "wistia"
|
|
17
|
-
| "native"
|
|
18
|
-
| "hls"
|
|
19
|
-
| "highlevel"
|
|
20
|
-
| "unknown"
|
|
21
|
-
| null;
|
|
22
|
-
outputPath: string;
|
|
23
|
-
/** Optional preferred quality (e.g., "720p", "1080p") */
|
|
24
|
-
preferredQuality?: string | undefined;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface DownloadResult {
|
|
28
|
-
success: boolean;
|
|
29
|
-
error?: string | undefined;
|
|
30
|
-
errorCode?: string | undefined;
|
|
31
|
-
details?: string | undefined;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Downloads a video based on its type.
|
|
36
|
-
*/
|
|
37
|
-
export async function downloadVideo(
|
|
38
|
-
task: VideoDownloadTask,
|
|
39
|
-
onProgress?: (progress: DownloadProgress) => void
|
|
40
|
-
): Promise<DownloadResult> {
|
|
41
|
-
const { videoUrl, videoType, outputPath, preferredQuality } = task;
|
|
42
|
-
|
|
43
|
-
switch (videoType) {
|
|
44
|
-
case "loom":
|
|
45
|
-
return downloadLoomVideo(videoUrl, outputPath, onProgress);
|
|
46
|
-
|
|
47
|
-
case "vimeo":
|
|
48
|
-
return downloadVimeoVideo(videoUrl, outputPath, onProgress);
|
|
49
|
-
|
|
50
|
-
case "native":
|
|
51
|
-
// Direct MP4/WebM URL - download directly
|
|
52
|
-
return downloadFile(videoUrl, outputPath, onProgress);
|
|
53
|
-
|
|
54
|
-
case "hls":
|
|
55
|
-
// Generic HLS stream
|
|
56
|
-
return downloadHLSVideo(videoUrl, outputPath, onProgress);
|
|
57
|
-
|
|
58
|
-
case "highlevel":
|
|
59
|
-
// HighLevel HLS video with quality selection
|
|
60
|
-
return downloadHighLevelVideo(videoUrl, outputPath, preferredQuality, onProgress);
|
|
61
|
-
|
|
62
|
-
case "youtube":
|
|
63
|
-
case "wistia":
|
|
64
|
-
// These require yt-dlp or special handling
|
|
65
|
-
return {
|
|
66
|
-
success: false,
|
|
67
|
-
error: `${videoType} videos are not yet supported. Consider installing yt-dlp. Video URL: ${videoUrl}`,
|
|
68
|
-
errorCode: "UNSUPPORTED_TYPE",
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
case "unknown":
|
|
72
|
-
default:
|
|
73
|
-
// Try direct download as fallback
|
|
74
|
-
if (/\.(mp4|webm|mov)(\?|$)/i.exec(videoUrl)) {
|
|
75
|
-
return downloadFile(videoUrl, outputPath, onProgress);
|
|
76
|
-
}
|
|
77
|
-
// Try HLS if it looks like a playlist
|
|
78
|
-
if (/\.m3u8(\?|$)/i.exec(videoUrl)) {
|
|
79
|
-
return downloadHLSVideo(videoUrl, outputPath, onProgress);
|
|
80
|
-
}
|
|
81
|
-
return {
|
|
82
|
-
success: false,
|
|
83
|
-
error: `Unknown video type. URL: ${videoUrl}`,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export {
|
|
89
|
-
downloadFile,
|
|
90
|
-
downloadLoomVideo,
|
|
91
|
-
extractLoomId,
|
|
92
|
-
getLoomVideoInfoDetailed,
|
|
93
|
-
type DownloadProgress,
|
|
94
|
-
type LoomFetchResult,
|
|
95
|
-
} from "./loomDownloader.js";
|
|
96
|
-
export {
|
|
97
|
-
downloadVimeoVideo,
|
|
98
|
-
extractVimeoId,
|
|
99
|
-
getVimeoVideoInfo,
|
|
100
|
-
getVimeoVideoInfoFromBrowser,
|
|
101
|
-
type VimeoDownloadResult,
|
|
102
|
-
type VimeoFetchResult,
|
|
103
|
-
type VimeoVideoInfo,
|
|
104
|
-
} from "./vimeoDownloader.js";
|
|
105
|
-
export { AsyncQueue, type QueueItem, type QueueOptions } from "./queue.js";
|
|
106
|
-
export {
|
|
107
|
-
validateLoomHls,
|
|
108
|
-
validateVideoHls,
|
|
109
|
-
validateVimeoVideo,
|
|
110
|
-
type HlsValidationResult,
|
|
111
|
-
} from "./hlsValidator.js";
|
|
112
|
-
export {
|
|
113
|
-
checkFfmpeg,
|
|
114
|
-
downloadHighLevelVideo,
|
|
115
|
-
downloadHLSVideo,
|
|
116
|
-
fetchHLSQualities,
|
|
117
|
-
getBestQualityUrl,
|
|
118
|
-
parseHighLevelVideoUrl,
|
|
119
|
-
parseHLSPlaylist,
|
|
120
|
-
type HLSDownloadResult,
|
|
121
|
-
type HLSQuality,
|
|
122
|
-
} from "./hlsDownloader.js";
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { extractLoomId } from "./loomDownloader.js";
|
|
3
|
-
|
|
4
|
-
describe("extractLoomId", () => {
|
|
5
|
-
it("extracts ID from embed URL", () => {
|
|
6
|
-
const url = "https://www.loom.com/embed/a1b2c3d4e5f6";
|
|
7
|
-
expect(extractLoomId(url)).toBe("a1b2c3d4e5f6");
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it("extracts ID from share URL", () => {
|
|
11
|
-
const url = "https://www.loom.com/share/abcdef123456";
|
|
12
|
-
expect(extractLoomId(url)).toBe("abcdef123456");
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it("extracts ID from URL with query params", () => {
|
|
16
|
-
const url = "https://www.loom.com/embed/abc123?autoplay=1&t=10";
|
|
17
|
-
expect(extractLoomId(url)).toBe("abc123");
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it("handles URL without www", () => {
|
|
21
|
-
const url = "https://loom.com/embed/abc123def456";
|
|
22
|
-
expect(extractLoomId(url)).toBe("abc123def456");
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("returns null for invalid URL", () => {
|
|
26
|
-
expect(extractLoomId("https://youtube.com/watch?v=123")).toBeNull();
|
|
27
|
-
expect(extractLoomId("not-a-url")).toBeNull();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it("returns null for Loom homepage", () => {
|
|
31
|
-
expect(extractLoomId("https://loom.com")).toBeNull();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("returns null for empty string", () => {
|
|
35
|
-
expect(extractLoomId("")).toBeNull();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("handles very long IDs", () => {
|
|
39
|
-
const longId = "a".repeat(32);
|
|
40
|
-
const url = `https://loom.com/embed/${longId}`;
|
|
41
|
-
expect(extractLoomId(url)).toBe(longId);
|
|
42
|
-
});
|
|
43
|
-
});
|