Video verification fixes

This commit is contained in:
killer069
2021-08-20 17:31:57 +05:30
parent 9970e6164a
commit dc209fbfbf
4 changed files with 6 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ import { Video } from '../classes/Video'
import { PlayList } from '../classes/Playlist'
const DEFAULT_API_KEY = "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8";
const video_pattern = /^((?:https?:)?\/\/)?:(?:(?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?$/;
const video_pattern = /^((?:https?:)?\/\/)?(?:(?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?$/;
export async function video_basic_info(url : string){
if(!url.match(video_pattern)) throw new Error('This is not a YouTube URL')