From d2118e773f9aa42b8a8d3d56f548f726679dbe3f Mon Sep 17 00:00:00 2001 From: oddluck <39967334+oddluck@users.noreply.github.com> Date: Sun, 5 Jul 2020 23:31:57 +0000 Subject: [PATCH] IMDb: break on match, url in debug --- IMDb/plugin.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/IMDb/plugin.py b/IMDb/plugin.py index 5a3f819..bad7970 100644 --- a/IMDb/plugin.py +++ b/IMDb/plugin.py @@ -86,6 +86,8 @@ class IMDb(callbacks.Plugin): query = "site:www.imdb.com/title/ %s" % text pattern = re.compile(r"https?://www.imdb.com/title/tt\d+/$") for i in range(1, 3): + if match: + break if google and self.registryValue("google", channel) == i: try: results = google.decode(google.search(query, irc.network, channel)) @@ -95,7 +97,10 @@ class IMDb(callbacks.Plugin): except TypeError: match = re.search(pattern, r.link) if match: - log.debug("IMDb: found link using Google search") + log.debug( + "IMDb: found link using Google search: %s" + % match.group(0) + ) break except: pass @@ -110,7 +115,9 @@ class IMDb(callbacks.Plugin): for r in results: match = re.search(pattern, r[2]) if match: - log.debug("IMDb: found link using DDG search") + log.debug( + "IMDb: found link using DDG search %s" % match.group(0) + ) break except: pass