Disable google service
This commit is contained in:
parent
d1a87622fb
commit
6d9d32d347
2 changed files with 2 additions and 72 deletions
|
@ -1,29 +1,6 @@
|
|||
import { parse } from 'url';
|
||||
|
||||
export default function match(url) {
|
||||
const parsed = parse(url.replace(/\+/g, '%20'));
|
||||
if (!parsed.host.match(/play\.google\.com$/)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const path = parsed.path;
|
||||
const hash = parsed.hash;
|
||||
|
||||
if (hash) {
|
||||
const parts = hash.split('/');
|
||||
const id = parts[2];
|
||||
const artist = parts[3];
|
||||
|
||||
if (id.length > 0) {
|
||||
return true;
|
||||
} else if (artist.length > 0) {
|
||||
return true;
|
||||
}
|
||||
} else if (path) {
|
||||
const matches = path.match(/\/music\/m\/([\w]+)/);
|
||||
if (matches[1]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Disable google since it doesn't respond anymore
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue