Fix Google Play Music and Spotify
This commit is contained in:
parent
688ec0f2f9
commit
6c29d50f1e
21 changed files with 566 additions and 559 deletions
|
@ -1,7 +1,7 @@
|
|||
import { parse } from 'url';
|
||||
|
||||
export function* match(url) {
|
||||
var parsed = parse(url.replace(/\+/g, "%20"));
|
||||
export default function match(url) {
|
||||
const parsed = parse(url.replace(/\+/g, '%20'));
|
||||
if (!parsed.host.match(/play\.google\.com$/)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ export function* match(url) {
|
|||
const hash = parsed.hash;
|
||||
|
||||
if (hash) {
|
||||
const parts = hash.split("/");
|
||||
const parts = hash.split('/');
|
||||
const id = parts[2];
|
||||
const artist = parts[3];
|
||||
|
||||
|
@ -19,11 +19,11 @@ export function* match(url) {
|
|||
} else if (artist.length > 0) {
|
||||
return true;
|
||||
}
|
||||
} else if(path) {
|
||||
} else if (path) {
|
||||
const matches = path.match(/\/music\/m\/([\w]+)/);
|
||||
if (matches[1]) {
|
||||
return true
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false
|
||||
};
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue