Skip to content

Commit

Permalink
Check for youtube id
Browse files Browse the repository at this point in the history
  • Loading branch information
adhityan authored May 27, 2024
1 parent 422af67 commit 85063cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/dynamic-loader-selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ async function unfurlLoader(loader: string): Promise<BaseLoader[]> {
return unfurlPathToLoader(loader);
} else if (isValidJson(loader)) {
return [new JsonLoader({ object: JSON.parse(loader) })];
}
else if(loader.length === 11) {
return [new YoutubeLoader({ videoIdOrUrl: loader })]
} else {
throw new SyntaxError(`Unknown loader ${loader}`);
}
Expand Down

0 comments on commit 85063cb

Please sign in to comment.