From 95d1df3530b26c6c64de64013d5a9e0f06b63ad8 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Mon, 29 Apr 2024 17:29:55 +0200 Subject: [PATCH] fix: not directly adding all sources --- music_kraken/objects/source.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/music_kraken/objects/source.py b/music_kraken/objects/source.py index 8680cde..66a012e 100644 --- a/music_kraken/objects/source.py +++ b/music_kraken/objects/source.py @@ -36,16 +36,16 @@ class Source: @classmethod def match_url(cls, url: str, referrer_page: SourcePages) -> Optional[Source]: """ - this shouldn't be used, unlesse you are not certain what the source is for + this shouldn't be used, unless you are not certain what the source is for the reason is that it is more inefficient """ - parsed = urlparse(url) - url = parsed.geturl() + parsed_url = urlparse(url) + url = parsed_url.geturl() - if "musify" in parsed.netloc: + if "musify" in parsed_url.netloc: return cls(SourcePages.MUSIFY, url, referrer_page=referrer_page) - if parsed.netloc in [_url.netloc for _url in youtube_settings['youtube_url']]: + if parsed_url.netloc in [_url.netloc for _url in youtube_settings['youtube_url']]: return cls(SourcePages.YOUTUBE, url, referrer_page=referrer_page) if url.startswith("https://www.deezer"): @@ -57,7 +57,7 @@ class Source: if "bandcamp" in url: return cls(SourcePages.BANDCAMP, url, referrer_page=referrer_page) - if "wikipedia" in parsed.netloc: + if "wikipedia" in parsed_url.netloc: return cls(SourcePages.WIKIPEDIA, url, referrer_page=referrer_page) if url.startswith("https://www.metal-archives.com/"):