csbot.plugins.youtube module

csbot.plugins.youtube.get_yt_id(url)[source]

Gets the video ID from a urllib ParseResult object.

exception csbot.plugins.youtube.YoutubeError(http_error)[source]

Bases: Exception

Signifies some error occurred accessing the Youtube API.

This is only used for actual errors, e.g. invalid API key, not failure to find any data matching a query.

Pass the HttpError from the API call as an argument.

class csbot.plugins.youtube.Youtube(bot)[source]

Bases: csbot.plugin.Plugin

A plugin that does some youtube things. Based on williebot youtube plugin.

CONFIG_DEFAULTS = {'api_key': ''}
CONFIG_ENVVARS = {'api_key': ['YOUTUBE_DATA_API_KEY']}
RESPONSE = '"{title}" [{duration}] (by {uploader} at {uploaded}) | Views: {views}'
CMD_RESPONSE = '"{title}" [{duration}] (by {uploader} at {uploaded}) | Views: {views} | {link}'
all_hail_our_google_overlords(e)[source]

I for one, welcome our Google overlords.

get_video_json(id)[source]
linkinfo_integrate(linkinfo)[source]

Handle recognised youtube urls.