SpiffyTites: add description to imgur.albumTemplate

This commit is contained in:
oddluck 2020-06-13 00:18:05 +00:00
parent 2ac00bdb40
commit 4a7e9912c0
3 changed files with 9 additions and 5 deletions

View File

@ -218,7 +218,7 @@ Example output:
Default value
`^ {%if section %}[{{section}}] {% endif -%}{%- if title -%}{{title}} :: {% endif %}{{image_count}} images :: {{view_count}} views :: {%if nsfw == None %}not sure if safe for work{% elif nsfw == True %}not safe for work!{% else %}safe for work{% endif %}`
`^ {%if section %}[{{section}}] {% endif -%}{%- if title -%}{{title}} :: {% endif %}{%- if description -%}{{description}} :: {% endif %}{{image_count}} images :: {{view_count}} views :: {%if nsfw == None %}not sure if safe for work{% elif nsfw == True %}not safe for work!{% else %}safe for work{% endif %}`
Example output:

View File

@ -463,9 +463,9 @@ conf.registerChannelValue(
"albumTemplate",
registry.String(
"^ {%if section %}[{{section}}] {% endif %}{% if title %}{{title}} :: {% endif"
" %}{{image_count}} images :: {{view_count}} views :: {%if nsfw == None %}not"
" sure if safe for work{% elif nsfw == True %}not safe for work!{% else %}safe"
" for work{% endif %}",
" %}{%- if description -%}{{description}} :: {% endif %}{{image_count}} images"
" :: {{view_count}} views :: {%if nsfw == None %}not sure if safe for work{%"
" elif nsfw == True %}not safe for work!{% else %}safe for work{% endif %}",
_("""imgur album template"""),
),
)

View File

@ -408,7 +408,10 @@ class SpiffyTitles(callbacks.Plugin):
log.debug("SpiffyTitles: attempt #%s for %s" % (retries, url))
is_redirect = False
try:
headers = self.get_headers(channel)
if retries > 1:
headers = self.get_headers(channel)
else:
headers = {}
log.debug("SpiffyTitles: requesting %s" % (url))
with requests.get(
url,
@ -1587,6 +1590,7 @@ class SpiffyTitles(callbacks.Plugin):
"view_count": "{:,}".format(album["views"]),
"image_count": "{:,}".format(album["images_count"]),
"nsfw": album.get("nsfw"),
"description": album.get("description"),
}
)
return compiled_template