[(中文版)NTU COOL 字幕產生器 使用說明](https://hackmd.io/@leyunn/rk3-htZu2)
**[2023-12-8 Update] Version 2.1 is now available, featuring a new 'Download .txt Transcription’ feature. Simply click 'Download Subtitles’ to use.**
**[\*\*2023-10-14 Update\*\*] Install the [environment setup executable](https://hackmd.io/@leyunn/HJefKDEGa) (available for Mac, Windows). After installation, you can simply click to open and configure your browser, skipping the first installation step.**
NTU COOL Subtitle Generator (Beta) is a Chrome extension that serves as a beta version for the NTU COOL speech recognition subtitle feature.
By simply installing this extension on your Chrome browser, you can experience the subtitle feature on the NTU COOL website.
Currently, the extension supports transcription of videos in Chinese or English. Also, it automatically translates the generated subtitles into English.
This extension is not developed by the NTU COOL team. If you encounter any issues while using it, please utilize the [Issue Report Form](#0.-Issue-Report) provided below.
[toc]
## 0. Issue Report
[Issue Report Form](https://docs.google.com/forms/d/e/1FAIpQLSfWal6ARE6XyXn0_LSICwhVEocFpMH_Z7bZ_FO4T9_rJFWP0w/viewform?usp=sf_link)
## 1. How to Install the Extension?
### Step 1: Disable Browser Security Checks
**[Important] Before starting, please read [Risks and Suggesitons after Disabling Browser Security Checks](#Risks-and-Suggesitons-after-Disabling-Browser-Security-Checks).**
Here are the methods for opening a "Chrome browser window with security checks disabled" on different systems:
#### Mac OS
1. Open Terminal. ([How to open Terminal on Mac?](https://support.apple.com/en-us/guide/terminal/apd5265185d-f365-44cb-8b09-71a064a42125/mac))
2. Enter the command in Terminal: `open -na Google\ Chrome --args --user-data-dir=/Applications/Chrome-CoolExtension --disable-web-security --disable-site-isolation-trials`
3. Press Enter, and a Chrome window will pop up, indicating successful opening.
**(Due to the higher security risks associated with this window, please refrain from browsing other websites in it.)**
After successful opening, you can right-click on the newly opened Chrome and pin it to the Dock for future direct access.
<!--  -->

#### Windows
1. Open Command Prompt. ([How to open Command Prompt on Windows?](https://support.kaspersky.com/common/windows/14637#block0))
2. Enter the command in Command Prompt: `"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --disable-site-isolation-trials --user-data-dir=%LOCALAPPDATA%\Google\Chrome-CoolExtension`
3. Press Enter, and a Chrome window will pop up, indicating successful opening.
**(Due to the higher security risks associated with this window, please refrain from browsing other websites in it.)**
After successful opening, you can right-click on the newly opened Chrome and pin it to the taskbar for future direct access.

(Additional steps for opening the browser)
> If you encounter the error "The system cannot find the specified path," please change `C:\Program Files\` to `C:\Program Files (x86)\` and try again.
> If you still can't find the file, you can go to `Chrome://version` to check the "Executable file Path" and modify the command to match the correct Chrome path.
#### Linux
1. Open the Terminal.
2. Enter the command in the Terminal: `google-chrome --disable-web-security --user-data-dir=/tmp/Chrome-CoolExtension`
3. Press Enter, and a Chrome window will pop up, indicating successful opening.
**(Due to the higher security risks associated with this window, please refrain from browsing other websites in it.)**
Once successfully opened, you should see a notification at the top of the window stating that the security check feature has been disabled.

### Step 2: Download the Extension from the Chrome Web Store
1. In the previously opened Chrome window, go to this URL: https://chrome.google.com/webstore/detail/ntu-cool-%E5%AD%97%E5%B9%95%E7%94%A2%E7%94%9F%E5%99%A8/docghmaodkaieihebenpieblmcfcoppo
2. Click on "Add to Chrome".

3. Click on "Add Extension".

4. Once added, click on the extension icon in the top-right corner and click the pin icon to pin "NTU COOL Subtitle Generator".

If you see an NTU COOL icon on the left side, it means the installation was successful.

## 2. How to Open the Extension?
> Note: This generator currently does not support videos from YouTube as a source.
1. In the window where the extension is installed, open an NTU COOL video page that you want to have subtitles for.

2. Click on the NTU COOL icon in the top-right corner, and a window will pop up:

3. Once the pop-up window finishes loading, if you see one of the following screens, it means the extension is successfully activated:
1. The "Start Subtitle Recognition" button is displayed, indicating that the subtitles for this video have not been generated yet.

2. The subtitle toggle switch is displayed, indicating that the video already has subtitles available, and they will appear automatically when playing the video.

3. If you see the "Waiting for Processing" or "Processing" screens, as showed in the "[How to Generate Video Subtitles?](#3.-How-to-Generate-Video-Subtitles?)" section, it means that someone else has requested the recognition for this video. Just wait patiently for the recognition to complete, and then you can use the subtitles.
> If you encounter an error screen, possible reasons include: the video source is YouTube (which is not supported for subtitles), or the browser was not opened according to the instructions in the [above tutorial](#1.-How-to-Install-the-Extension?).
## 3. How to Generate Video Subtitles?
1. Click on "Start Subtitle Recognition".

2. If you see the "Waiting for Processing" or "Processing" screens, it means the submission was successful.

> The processing time for videos is approximately **one-third** of the video's length.
> If you encounter an error screen, possible reasons include: the video was recently published today, there have been recent changes to the video, or you have submitted too many recognition requests within one minute. The screen will provide instructions on what to do next.
## 4. How to Determine if the Recognition is Completed?
After clicking on the NTU COOL icon in the top-right corner, if you see the subtitle toggle switch, it means the recognition has been completed and you can use the subtitles. They will appear automatically when playing the video.

## 5. How to Download the Generated Subtitles?
On the page of any video with generated subtitles, open NTU COOL Subtitle Generator, and click on “Download Subtitle.”
After downloading, unzip the file to access the original subtitles and the English translation in SRT format.

## 6. How to Switch Subtitle Languages?
On the page of any video with generated subtitles, open NTU COOL Subtitle Generator, and click on the “Language” dropdown menu. You can choose between “Video Language” or “English (auto-translated)” subtitles.

> The translation subtitle is expected to be generated within the __ after the original video subtitle.
## 7. Common FAQs
### a. What should I do if the pop-up window shows "Browser Security Settings Not Disabled"?
Please refer to the steps described in the ["Disable Browser Security Checks Tutorial"](#step-1-disable-browser-security-checks) to open Chrome.
### b. What should I do if a pop-up window keeps showing "waiting..."?
Due to the limited resources of the subtitle recognition service, when there are more requests, you may need to wait for over an hour (the processing time for a video is approximately one-third of its length).
### c. How can I reload the extension?
If the window keeps showing "Load Error" or if you have any other reason to restart the extension, follow these steps:
1. Go to the URL `chrome://extensions` and find "NTU COOL Subtitle Generator" inside.
2. Turn off the toggle switch and then turn it back on.

### d. How do I switch the language of this extension's interface?
Currently, this extension only supports English and Chinese interfaces. It will switch based on your browser's language, with English being the default. [How to change your browser's language?](https://support.google.com/chrome/answer/173424?hl=en&co=GENIE.Platform%3DDesktop#zippy=)
### e. On which browsers can I use this subtitle generator?
Currently, this extension only supports the Chrome browser.
### f. On which devices can I use this subtitle generator?
This extension supports the Chrome web version, including Mac OS, Windows, Linux, etc. However, it cannot be used on mobile devices such as Android, iOS, etc.
### g. Can I use NTU COOL Subtitle Generator in NTU COOL Video Manager?
No, due to permission restrictions in the Video Manager page, this extension can only be used with videos added to the “Modules” page.
### h. If there are errors in subtitle recognition, can I edit the subtitles?
No, the downloaded subtitle files are for archival purposes and cannot be edited and re-uploaded. If instructors want accurate subtitles in their videos, we recommend downloading the .srt file, making corrections, and then using video editing software to add the subtitles to the video file.
### i. Can I use NTU COOL Subtitle Generator on other websites or videos?
No, this generator is designed to assist NTU students in their video-based learning and is only available for NTU course videos. Due to limited computing resources, it cannot be used for non-NTU courses. We apologize for any inconvenience.
## 8. Risks and Suggesitons after Disabling Browser Security Checks
[Back to Installation Tutorial](#1.-How-to-Install-the-Extension?)
### a. Our Suggesiton
To ensure user safety, our suggesiton is to **open a dedicated Chrome browser window for using this extension and avoid browsing other websites in this window**.
### b. What is Browser Security Checks?
The "Browser Security Checks" are enabled by default in the Chrome browser. The main purpose is to enforce the **Same Origin Policy**, which restricts the code from different origins/websites from interfering with or manipulating each other's data. This prevents malicious websites from accessing sensitive information from other sources through scripts and protects user privacy and security.
### c. Why is it necessary to disable it to use this extension?
In NTU COOL, the "videos" are not directly hosted on the NTU COOL website but embedded with a "video player feature" from a different source (Cross Origin). Therefore, when adding an extension to NTU COOL, it is not possible to manipulate the video (due to the same-origin policy) unless the video source allows such operations.
Since this extension is only a test version for NTU COOL's speech recognition subtitle feature, **in order to make minimal changes to the COOL system**, this approach is used.
### d. Risks after disabling it
Browsing websites from unknown sources without enabling the "security check feature" in your browser can lead to the following risks:
1. **Cross-Site Scripting (XSS)**: You may encounter a malicious website while browsing, which can execute scripts on your browser and steal your personal data such as passwords, credit card numbers, etc. Additionally, it can modify the content of the website, making you believe you are interacting with a legitimate site when it is actually a malicious one.
2. **Cross-Site Request Forgery (CSRF)**: You may receive an email that appears to be legitimate or click on a seemingly secure link, but it redirects you to a malicious website. This website can exploit your identity to perform illegal actions, such as changing your password, initiating fund transfers, etc.
3. **Sensitive Data Leakage**: Website A may have direct access to sensitive data on Website B, such as your personal information, account details, etc. This increases the risk of your sensitive data being exposed because a compromised website may lead to the attacker obtaining data from other related websites.
4. **Website Tampering**: Malicious websites can modify the content of other websites. When you visit a compromised website, the malicious site can change the content of that website, including replacing images, modifying text, inserting ads, etc. As a result, you may be redirected to other malicious websites or be misled by false information.
Considering the risks mentioned above, our suggesiton is to **open a dedicated Chrome browser window for using this extension and avoid browsing other websites in this window**.