mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-29 16:07:40 +01:00
remove old subtitle code
This commit is contained in:
parent
4c782b0c47
commit
24e4cc3970
1 changed files with 0 additions and 28 deletions
|
@ -93,34 +93,6 @@ export function languageIdToName(langId: string): string | null {
|
|||
return languageMap[langId]?.nativeName ?? null;
|
||||
}
|
||||
|
||||
// export async function downloadSrt(subId: string): Promise<string> {
|
||||
// const downloadScript = await proxiedFetch<string>(
|
||||
// `https://www.opensubtitles.com/nocache/download/${subId}/subreq.js`,
|
||||
// {
|
||||
// query: {
|
||||
// file_name: "sub",
|
||||
// locale: "en", // locale is ignored
|
||||
// np: "true",
|
||||
// sub_frmt: "srt",
|
||||
// ext_installed: "false",
|
||||
// },
|
||||
// }
|
||||
// );
|
||||
|
||||
// // extract url from script
|
||||
// // example: https://www.opensubtitles.com/download/<LONG_HASH_OF_UPPERCASE_HEX>/subfile/sub.srt
|
||||
// const downloadUrlRegex =
|
||||
// /https:\/\/www.opensubtitles.com\/download\/[A-Fa-f0-9]+\/subfile\/sub\.srt/g;
|
||||
// const matchedUrl = downloadScript.match(downloadUrlRegex);
|
||||
// if (!matchedUrl) throw new Error("No download found");
|
||||
// const downloadUrl = matchedUrl[0];
|
||||
|
||||
// // download
|
||||
// const srtRequest = await fetch(downloadUrl);
|
||||
// const srtData = await srtRequest.text();
|
||||
// return srtData;
|
||||
// }
|
||||
|
||||
export async function downloadSrt(legacySubId: string): Promise<string> {
|
||||
// TODO there is cloudflare protection so this may not always work. what to do about that?
|
||||
// language code is hardcoded here, it does nothing
|
||||
|
|
Loading…
Reference in a new issue