diff options
| author | 2019-01-11 12:03:23 +0000 | |
|---|---|---|
| committer | 2019-01-11 12:03:23 +0000 | |
| commit | e5a52416156619224cf529f2c65d81fe104d9aea (patch) | |
| tree | ee0c27e522c317978d9b7c50080398336da69582 /modules | |
| parent | Add youtube-safesearch channel setting, to allow channels to opt-in to turning (diff) | |
Only try to regex match a youtube url if we actually have a search string
(youtube.py)
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/youtube.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/youtube.py b/modules/youtube.py index 03674f87..f51e4217 100644 --- a/modules/youtube.py +++ b/modules/youtube.py @@ -90,9 +90,10 @@ class Module(ModuleManager.BaseModule): if last_youtube: search = last_youtube.message - url_match = re.search(REGEX_YOUTUBE, search) - if search and url_match: - video_id = url_match.group(1) + if search: + url_match = re.search(REGEX_YOUTUBE, search) + if url_match: + video_id = url_match.group(1) if search or video_id: safe_setting = event["target"].get_setting("youtube-safesearch", |
