mirror of
https://github.com/hansputera/tiktok-dl.git
synced 2026-04-05 19:51:57 +02:00
fix(untest-core.utils): fix cannot read properties of null (reading 0)
Signed-off-by: Hanif Dwy Putra S <hanifdwyputrasembiring@gmail.com>
This commit is contained in:
@@ -47,7 +47,8 @@ export const deObfuscate = (html: string): string => {
|
||||
throw new Error('Cannot download the video!');
|
||||
} else {
|
||||
return runObfuscatedScript(
|
||||
obfuscatedScripts[0]
|
||||
obfuscatedScripts
|
||||
.find((x) => x.length)!
|
||||
.replace(/<(\/)?script( type=".+")?>/g, '')
|
||||
.trim(),
|
||||
);
|
||||
@@ -76,7 +77,7 @@ export const matchCustomDownload = (
|
||||
.slice(0, -1) + url.slice(0, -3),
|
||||
);
|
||||
|
||||
return [links[0]].concat(urls as string[]);
|
||||
return [links.find((x) => x)!].concat(urls as string[]);
|
||||
};
|
||||
|
||||
export const deObfuscateSaveFromScript = (scriptContent: string): string => {
|
||||
|
||||
Reference in New Issue
Block a user