🐛 Disable eslint for youtube regex
This commit is contained in:
parent
08a8d0ff20
commit
8243539f3f
1 changed files with 4 additions and 2 deletions
|
@ -93,8 +93,10 @@ class Player {
|
|||
*/
|
||||
searchTracks (query) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
if (query.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/)) {
|
||||
query = query.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/)[1]
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
const matchURL = query.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/)
|
||||
if (matchURL) {
|
||||
query = matchURL[1]
|
||||
}
|
||||
ytsr(query, (err, results) => {
|
||||
if (err) return []
|
||||
|
|
Loading…
Reference in a new issue