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

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
node_modules/
dist/
play-dl/Stream/stream_final.ts
.npmrc

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "play-dl",
"version": "0.2.1",
"version": "0.2.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "play-dl",
"version": "0.2.1",
"version": "0.2.4",
"license": "MIT",
"dependencies": {
"got": "^11.8.2"

View File

@ -1,6 +1,6 @@
{
"name": "play-dl",
"version": "0.2.1",
"version": "0.2.4",
"description": "YouTube, SoundCloud, Spotify downloader",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
@ -10,7 +10,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/play-dl/play-dl"
"url": "https://github.com/play-dl/play-dl"
},
"keywords": [
"node-youtube-dl",

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')