feat(packages.core#ttDownloaderOneProvider): return error when "json.error" exists

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
Hanif Dwy Putra S
2022-05-23 10:47:07 +00:00
committed by GitHub
parent 85b7bc84b3
commit 1825791c08
2 changed files with 7 additions and 1 deletions

View File

@@ -56,6 +56,11 @@ export class DownloadOne extends BaseProvider {
*/
extract(html: string): ExtractedInfo {
const json = JSON.parse(html);
if (json.error) {
return {
error: json.error,
};
}
return {
video: {

View File

@@ -13,7 +13,8 @@
"esModuleInterop": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node"
},
"exclude": ["node_modules", "dist"]
}