Fix crash when there is no author
This commit is contained in:
parent
346704bae5
commit
a38958bf09
1 changed files with 2 additions and 1 deletions
|
|
@ -66,7 +66,8 @@ class YoutubeBackend(BaseBackend, ICapVideo):
|
||||||
duration=to_unicode(datetime.timedelta(seconds=int(entry.media.duration.seconds.strip()))),
|
duration=to_unicode(datetime.timedelta(seconds=int(entry.media.duration.seconds.strip()))),
|
||||||
thumbnail_url=to_unicode(entry.media.thumbnail[0].url.strip()),
|
thumbnail_url=to_unicode(entry.media.thumbnail[0].url.strip()),
|
||||||
)
|
)
|
||||||
video.author = entry.author[0].name.text.strip()
|
if entry.author[0].name.text:
|
||||||
|
video.author = entry.author[0].name.text.strip()
|
||||||
if entry.media.name:
|
if entry.media.name:
|
||||||
video.author = to_unicode(entry.media.name.text.strip())
|
video.author = to_unicode(entry.media.name.text.strip())
|
||||||
return video
|
return video
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue