fix youtube dupe regex
This commit is contained in:
parent
9c0ead308b
commit
71e61e51e8
@ -496,7 +496,7 @@ export default {
|
|||||||
} else if (youtube.includes(urlObj.hostname)) {
|
} else if (youtube.includes(urlObj.hostname)) {
|
||||||
// extract id and create both links
|
// extract id and create both links
|
||||||
const matches = url.match(/(https?:\/\/)?((www\.)?(youtube(-nocookie)?|youtube.googleapis)\.com.*(v\/|v=|vi=|vi\/|e\/|embed\/|user\/.*\/u\/\d+\/)|youtu\.be\/)(?<id>[_0-9a-z-]+)/i)
|
const matches = url.match(/(https?:\/\/)?((www\.)?(youtube(-nocookie)?|youtube.googleapis)\.com.*(v\/|v=|vi=|vi\/|e\/|embed\/|user\/.*\/u\/\d+\/)|youtu\.be\/)(?<id>[_0-9a-z-]+)/i)
|
||||||
similar = `(http(s)?://)?((www.|m.)?youtube.com/(watch\\?v=|v/)${matches?.groups?.id}|youtu.be/${matches?.groups?.id})((\\?|#)%)?`
|
similar = `(http(s)?://)?((www.|m.)?youtube.com/(watch\\?v=|v/)${matches?.groups?.id}|youtu.be/${matches?.groups?.id})((\\?|&|#)%)?`
|
||||||
} else {
|
} else {
|
||||||
similar += '((\\?|#)%)?'
|
similar += '((\\?|#)%)?'
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user