Fix orphaned embedded video links from Tumblr. Fix #3177

This commit is contained in:
Will Thong 2023-08-21 16:45:25 +01:00
commit deebda5596
2 changed files with 8 additions and 2 deletions

3
RELEASE.md Normal file
View file

@ -0,0 +1,3 @@
Release type: minor
Add exception to deal with broken embedded video links when importing from Tumblr.

View file

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