mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Fix orphaned embedded video links from Tumblr. Fix #3177
This commit is contained in:
parent
2eeff62fd7
commit
deebda5596
2 changed files with 8 additions and 2 deletions
3
RELEASE.md
Normal file
3
RELEASE.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Release type: minor
|
||||
|
||||
Add exception to deal with broken embedded video links when importing from Tumblr.
|
||||
|
|
@ -499,8 +499,11 @@ def tumblr2fields(api_key, blogname):
|
|||
fmtstr = '<p><a href="%s">via</a></p>\n'
|
||||
source = fmtstr % post.get('source_url')
|
||||
caption = post.get('caption')
|
||||
players = '\n'.join(player.get('embed_code')
|
||||
for player in post.get('player'))
|
||||
try:
|
||||
players = '\n'.join(player.get('embed_code')
|
||||
for player in post.get('player'))
|
||||
except TypeError:
|
||||
players = '\n'
|
||||
content = source + caption + players
|
||||
elif type == 'answer':
|
||||
title = post.get('question')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue