youtube_parser: fix reading titles while sleeping

This commit is contained in:
dece 2022-05-16 11:09:55 +02:00
parent bec9ff4d76
commit 6841b01e8d
2 changed files with 3 additions and 0 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ resources/*
!resources/.gitkeep !resources/.gitkeep
venv/ venv/
.vim/ .vim/
__pycache__/

View file

@ -33,6 +33,8 @@ class YoutubeParserPlugin(Plugin):
self.is_ready = False self.is_ready = False
def on_pubmsg(self, event): def on_pubmsg(self, event):
if not self.respects_handling_conditions():
return False
words = event.arguments[0].split() words = event.arguments[0].split()
for word in words: for word in words:
match = self.VIDEO_URL_RE.match(word) match = self.VIDEO_URL_RE.match(word)