diff options
author | James Taylor <user234683@users.noreply.github.com> | 2018-07-02 21:55:39 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2018-07-02 21:55:39 -0700 |
commit | 7c4298217bf07dc543c8183c61fee7d63ccecfa1 (patch) | |
tree | e503ea09bda8954616a43da1278eeed0b8c9ebe1 /youtube/common.py | |
parent | 49f10cb89ac458270a2ff5a48b2211e5d2c159ab (diff) | |
download | yt-local-7c4298217bf07dc543c8183c61fee7d63ccecfa1.tar.lz yt-local-7c4298217bf07dc543c8183c61fee7d63ccecfa1.tar.xz yt-local-7c4298217bf07dc543c8183c61fee7d63ccecfa1.zip |
get_text: return blank text when 'runs' is empty
Diffstat (limited to 'youtube/common.py')
-rw-r--r-- | youtube/common.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube/common.py b/youtube/common.py index 3133fed..c65f545 100644 --- a/youtube/common.py +++ b/youtube/common.py @@ -371,7 +371,11 @@ def get_text(node): try: return node['simpleText'] except KeyError: + pass + try: return node['runs'][0]['text'] + except IndexError: # empty text runs + return '' def get_formatted_text(node): try: |