From 98763522b0bc4c16df9a08f21daec645f64a0df9 Mon Sep 17 00:00:00 2001 From: PrgmrBill Date: Sat, 13 Jun 2015 14:25:23 -0400 Subject: [PATCH] SpiffyTitles: adds YouTube template variable yt_logo which shows a colored logo --- README.md | 2 +- plugin.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ce9f856..0847630 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ requires a [developer key](https://code.google.com/apis/youtube/dashboard/gwt/in `youtubeTitleTemplate` - This is the template used when showing the title of a YouTube video -Default value: `^ {{title}} uploaded by {{channel_title}} :: Duration: {{duration}} :: {{view_count}} views :: {{like_count}} likes :: {{dislike_count}} dislikes :: {{favorite_count}} favorites :: {{comment_count}} comments` +Default value: `^ {{yt_logo}} {{title}} uploaded by {{channel_title}} :: Duration: {{duration}} :: {{view_count}} views :: {{like_count}} likes :: {{dislike_count}} dislikes :: {{favorite_count}} favorites :: {{comment_count}} comments` Example output: diff --git a/plugin.py b/plugin.py index e02c257..6b6e495 100644 --- a/plugin.py +++ b/plugin.py @@ -444,6 +444,13 @@ class SpiffyTitles(callbacks.Plugin): else: duration = "LIVE" + colored_letters = [ + "%s" % ircutils.mircColor("You", fg="red", bg="white"), + "%s" % ircutils.mircColor("Tube", fg="white", bg="red") + ] + + yt_logo = "".join(colored_letters) + compiled_template = yt_template.render({ "title": title, "duration": duration, @@ -452,7 +459,8 @@ class SpiffyTitles(callbacks.Plugin): "dislike_count": dislike_count, "comment_count": comment_count, "favorite_count": favorite_count, - "channel_title": channel_title + "channel_title": channel_title, + "yt_logo": yt_logo }) title = compiled_template