🐛 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) {
|
searchTracks (query) {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
if (query.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/)) {
|
// eslint-disable-next-line no-useless-escape
|
||||||
query = query.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/)[1]
|
const matchURL = query.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/)
|
||||||
|
if (matchURL) {
|
||||||
|
query = matchURL[1]
|
||||||
}
|
}
|
||||||
ytsr(query, (err, results) => {
|
ytsr(query, (err, results) => {
|
||||||
if (err) return []
|
if (err) return []
|
||||||
|
|
Loading…
Reference in a new issue