combine.fm/lib/services/deezer/url.js

10 lines
256 B
JavaScript

import { parse } from 'url';
export function* match(url) {
const parsed = parse(url);
if (!parsed.host.match(/deezer\.com$/)) {
return false;
}
const matches = parsed.path.match(/\/(album|track)[\/]+([^\/]+)/);
return matches.length > 1;
};