Fix yt_validate stack overflow issue
https://github.com/play-dl/play-dl/issues/304 yt_validate was recursing forever because the regex for removing the 'list=xxxx' parameter was looking for one or more characters after list=, rather than 0 or more, so removed nothing if no value was provided. e.g https://www.youtube.com/playlist?list= Have tested this locally but would appreciate a second look before merging.
This commit is contained in:
parent
8d71600624
commit
7ae5bc3e13
@ -61,7 +61,7 @@ export function yt_validate(url: string): 'playlist' | 'video' | 'search' | fals
|
||||
else return 'search';
|
||||
}
|
||||
} else {
|
||||
if (!url_.match(playlist_pattern)) return yt_validate(url_.replace(/(\?|\&)list=[^&]+/, ''));
|
||||
if (!url_.match(playlist_pattern)) return yt_validate(url_.replace(/(\?|\&)list=[^&]*/, ''));
|
||||
else return 'playlist';
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user