diff --git a/tumblr_backup.py b/tumblr_backup.py index 7250939..d4f7ef4 100755 --- a/tumblr_backup.py +++ b/tumblr_backup.py @@ -868,7 +868,11 @@ def _backup(posts, post_respfiles): break if options.likes: - before = resp['_links']['next']['query_params']['before'] + next_ = resp['_links'].get('next') + if next_ is None: + log.status('Backing up posts end of likes, finishing\r') + break + before = next_['query_params']['before'] i += MAX_POSTS except: # ensure proper thread pool termination