From c885b52820bfe8cfd13456ed9b909b13782e2e30 Mon Sep 17 00:00:00 2001 From: Slyyxp <11709831+Slyyxp@users.noreply.github.com> Date: Mon, 20 Jun 2022 06:39:26 +0100 Subject: [PATCH] Bandaid the regex --- rsack/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rsack/utils.py b/rsack/utils.py index c603c9b..43d18ea 100644 --- a/rsack/utils.py +++ b/rsack/utils.py @@ -148,8 +148,12 @@ def genie_id(url): :param url: Genie url :return: Album ID """ - expression = "genie.co.kr/detail/(artistInfo|albumInfo)......([0-9]*)" + expression = r"https://genie.co.kr/detail/(artistInfo|albumInfo)......([0-9]*)" result = match(expression, url) + # This shouldn't be needed, regex needs to be fixed. + if not result: + expression = r"https://www.genie.co.kr/detail/(artistInfo|albumInfo)......([0-9]*)" + result = match(expression, url) if result: return result logger.critical("Invalid URL: {}".format(url))