This commit is contained in:
Cadence Ember 2020-06-21 01:05:36 +12:00
parent cb2359f8b5
commit 6615b5a964
No known key found for this signature in database
GPG Key ID: 128B99B1B74A6412
1 changed files with 4 additions and 4 deletions

View File

@ -65,20 +65,20 @@ const actions = {
const extractors = [
// anything with /watch?v=
function() {
if (urlObject.pathname === "/watch" && urlObject.searchParams.has("v")) {
return urlObject.searchParams.get("v")
if (urlObject.pathname === '/watch' && urlObject.searchParams.has('v')) {
return urlObject.searchParams.get('v')
}
},
// youtu.be
function() {
if (urlObject.host === "youtu.be" && urlObject.pathname.match(/^\/[A-Za-z0-9_-]+$/)) {
if (urlObject.host === 'youtu.be' && urlObject.pathname.match(/^\/[A-Za-z0-9_-]+$/)) {
return urlObject.pathname.slice(1)
}
},
// cloudtube
function() {
if (urlObject.host.match(/^cadence\.(gq|moe)$/) && urlObject.pathname.match(/^\/cloudtube\/video\/[A-Za-z0-9_-]+$/)) {
return urlObject.pathname.slice("/cloudtube/video/".length)
return urlObject.pathname.slice('/cloudtube/video/'.length)
}
}
]