diff options
| author | 2017-12-26 10:32:36 +0000 | |
|---|---|---|
| committer | 2017-12-26 10:32:36 +0000 | |
| commit | 0cc72d5d66bc3a6abf7757c7202905bd656ddf1d (patch) | |
| tree | a2591a46c4e25f359b7ed6990f31d91be22d4d1d /modules/youtube.py | |
| parent | NR: Indicate interesting activity at locations (diff) | |
Added a "replay" system to EventManager hooks, to replay missed .calls
Diffstat (limited to 'modules/youtube.py')
| -rw-r--r-- | modules/youtube.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/youtube.py b/modules/youtube.py index d4567a34..cf2a56f4 100644 --- a/modules/youtube.py +++ b/modules/youtube.py @@ -24,14 +24,13 @@ class Module(object): help="Find a video on youtube", usage="[query]") bot.events.on("received").on("message").on("channel").hook( self.channel_message) - bot.events.on("boot").on("done").hook(self.boot_done) - def boot_done(self, event): - self.bot.events.on("postboot").on("configure").on( + bot.events.on("postboot").on("configure").on( "channelset").call(setting="auto-youtube", help="Disable/Enable automatically getting info from youtube URLs", validate=Utils.bool_or_none) + def get_video_page(self, video_id, part): return Utils.get_url(URL_YOUTUBEVIDEO, get_params={"part": part, "id": video_id, "key": self.bot.config["google-api-key"]}, @@ -65,7 +64,8 @@ class Module(object): ) if match.group(3) else "00" return "%s (%s) uploaded by %s, %s views%s %s" % ( video_title, video_duration, video_uploader, "{:,}".format( - int(video_views)), video_opinions, URL_YOUTUBESHORT % video_id) + int(video_views)), video_opinions, #URL_YOUTUBESHORT % video_id + "https://youtu.be/dQw4w9WgXcQ") def yt(self, event): video_id = None |
