-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.html
88 lines (76 loc) · 3.84 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Video2Srt</title>
<link rel="manifest" href="/manifest.json">
<!-- Primary Meta Tags -->
<meta name="title" content="Video2SRT - Generate subtitles for your video files privately on your device" />
<meta name="description" content="Video2SRT uses machine learning to generate subtitle files for your video files all on your own machine without needing an internet connection" />
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" name="url" content="https://video2srt.ccextractor.org" />
<meta property="og:title" content="Video2SRT - Generate subtitles for your video files privately on your device" />
<meta property="og:description" content="Video2SRT uses machine learning to generate subtitle files for your video files all on your own machine without needing an internet connection" />
<meta property="og:image" name="image" content="https://video2srt.ccextractor.org/images/icons/icon-512x512.png" />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" name="url" content="https://video2srt.ccextractor.org" />
<meta property="twitter:title" content="Video2SRT - Generate subtitles for your video files privately on your device" />
<meta property="twitter:description" content="Video2SRT uses machine learning to generate subtitle files for your video files all on your own machine without needing an internet connection" />
<meta property="twitter:image" name="image" content="https://video2srt.ccextractor.org/images/icons/icon-512x512.png" />
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/ffmpeg/0.11.6/ffmpeg.min.js"></script> -->
</head>
<script>
window.SUB_DATA = [];
const printWhisper = (function() {
/*
* Hijacks the Output from Whisper.cpp in order to separate the subtitle blocks
*/
return function text(args){
if (arguments.length > 1) args = Array.prototype.slice.call(arguments).join(' ');
if(args.includes('-->')){
window.SUB_DATA = [...SUB_DATA, args]
console.log("HELLOOOO!")
console.log(SUB_DATA)
const event = new CustomEvent('newSubsAdded', { subs: window.SUB_DATA });
window.dispatchEvent(event);
}
console.log('hello: ' + args)
};
})();
const printWhisperErr = (function(){
/*
* Hijack the Debug output whisper prints related to the model.
*/
return function text(args){
if(args.includes('whisper_print_timings')) {
const event = new CustomEvent('whisperFinished', { subs: window.SUB_DATA });
window.dispatchEvent(event);
}
console.log('other hello: ' + args)
}
})();
var Module = {
print: printWhisper,
printErr: printWhisperErr
}
// Sets all the URL's to the current URL
// AUTHORS NOTE: I could not get this to work. When scrapers fetch this, the JS Code doesn't execute obviously.
document.querySelectorAll('meta[name="url"]').forEach((elem) =>{
elem.setAttribute("content", window.location.href);
})
// Sets all the URL's to the logo ATM
document.querySelectorAll('meta[name="image"]').forEach((elem) =>{
elem.setAttribute("content", window.location.href + 'images/icons/icon-512x512.png');
})
</script>
<body class="flex items-center justify-center min-h-screen">
<div id="app"></div>
<!--- <script src="/src/assets/js/libmain.js" defer></script> --->
<script type="module" src="/src/main.ts"></script>
<script src="js/main.js"></script>
</body>
</html>