SpiffyTitles: adds YouTube template variable yt_logo which shows a colored logo

This commit is contained in:
PrgmrBill 2015-06-13 14:25:23 -04:00
parent 580960c712
commit 98763522b0
2 changed files with 10 additions and 2 deletions

View File

@ -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:

View File

@ -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