Only try to regex match a youtube url if we actually have a search string
(youtube.py)
This commit is contained in:
parent
59094568e0
commit
e5a5241615
1 changed files with 4 additions and 3 deletions
|
@ -90,9 +90,10 @@ class Module(ModuleManager.BaseModule):
|
||||||
if last_youtube:
|
if last_youtube:
|
||||||
search = last_youtube.message
|
search = last_youtube.message
|
||||||
|
|
||||||
url_match = re.search(REGEX_YOUTUBE, search)
|
if search:
|
||||||
if search and url_match:
|
url_match = re.search(REGEX_YOUTUBE, search)
|
||||||
video_id = url_match.group(1)
|
if url_match:
|
||||||
|
video_id = url_match.group(1)
|
||||||
|
|
||||||
if search or video_id:
|
if search or video_id:
|
||||||
safe_setting = event["target"].get_setting("youtube-safesearch",
|
safe_setting = event["target"].get_setting("youtube-safesearch",
|
||||||
|
|
Loading…
Reference in a new issue