mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-28 22:41:08 -05:00
IMDb: break on match, url in debug
This commit is contained in:
parent
dce6c05439
commit
d2118e773f
@ -86,6 +86,8 @@ class IMDb(callbacks.Plugin):
|
|||||||
query = "site:www.imdb.com/title/ %s" % text
|
query = "site:www.imdb.com/title/ %s" % text
|
||||||
pattern = re.compile(r"https?://www.imdb.com/title/tt\d+/$")
|
pattern = re.compile(r"https?://www.imdb.com/title/tt\d+/$")
|
||||||
for i in range(1, 3):
|
for i in range(1, 3):
|
||||||
|
if match:
|
||||||
|
break
|
||||||
if google and self.registryValue("google", channel) == i:
|
if google and self.registryValue("google", channel) == i:
|
||||||
try:
|
try:
|
||||||
results = google.decode(google.search(query, irc.network, channel))
|
results = google.decode(google.search(query, irc.network, channel))
|
||||||
@ -95,7 +97,10 @@ class IMDb(callbacks.Plugin):
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
match = re.search(pattern, r.link)
|
match = re.search(pattern, r.link)
|
||||||
if match:
|
if match:
|
||||||
log.debug("IMDb: found link using Google search")
|
log.debug(
|
||||||
|
"IMDb: found link using Google search: %s"
|
||||||
|
% match.group(0)
|
||||||
|
)
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -110,7 +115,9 @@ class IMDb(callbacks.Plugin):
|
|||||||
for r in results:
|
for r in results:
|
||||||
match = re.search(pattern, r[2])
|
match = re.search(pattern, r[2])
|
||||||
if match:
|
if match:
|
||||||
log.debug("IMDb: found link using DDG search")
|
log.debug(
|
||||||
|
"IMDb: found link using DDG search %s" % match.group(0)
|
||||||
|
)
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user