From ee18c0c8835e485f00777930d4fbc18fe2df8907 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 03 Mar 2019 23:50:35 +0000 Subject: [PATCH] youtube has upgraded their api or something --- dave/modules/youtube.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dave/modules/youtube.py b/dave/modules/youtube.py index ec39881..b1c3531 100644 --- a/dave/modules/youtube.py +++ a/dave/modules/youtube.py @@ -11,9 +11,9 @@ BASE_URL = "https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet," \ "statistics&key={}".format(dave.config.config["api_keys"]["youtube"]) -@dave.module.match(r'.*https?://(?:www\.)?youtu(?:be\.com/watch\?v=|\.be/)([\w\-\_]*)(&(amp;)?[\w\=]*)?.*') -@dave.module.dont_always_run_if_run() -@dave.module.ratelimit(1, 1) +# @dave.module.match(r'.*https?://(?:www\.)?youtu(?:be\.com/watch\?v=|\.be/)([\w\-\_]*)(&(amp;)?[\w\=]*)?.*') +# @dave.module.dont_always_run_if_run() +# @dave.module.ratelimit(1, 1) def youtubevideo(bot, args, sender, source): """Ran whenever a YouTube video is sent""" if not dave.config.redis.exists("youtube:{}".format(args[0])): @@ -21,7 +21,7 @@ headers={'user-agent': 'irc bot (https://github.com/w4)'}) if req.status_code != 200: - bot.msg(source, "Bad response from YouTube API: {}".format(req.status_code)) + print("{} from YouTube API: {}", req.status_code, req.json()) return req = req.json() @@ -52,4 +52,4 @@ intcomma(resp["statistics"]["dislikeCount"]) ) ] - ))+ )) -- rgit 0.1.3