From ee18c0c8835e485f00777930d4fbc18fe2df8907 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 3 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 +++ b/dave/modules/youtube.py @@ -11,9 +11,9 @@ import isodate 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 @@ def youtubevideo(bot, args, sender, source): 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 @@ def youtubevideo(bot, args, sender, source): intcomma(resp["statistics"]["dislikeCount"]) ) ] - )) \ No newline at end of file + )) -- libgit2 1.7.2