Video verification fixes
This commit is contained in:
parent
9970e6164a
commit
dc209fbfbf
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
||||
node_modules/
|
||||
dist/
|
||||
play-dl/Stream/stream_final.ts
|
||||
.npmrc
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -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"
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user