-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError: 'player' #179
Comments
I'm running into the same issue.
I installed by cloning the repo and copying the python script to my |
Here's an untested patch that attempts to make the video/audio save/embed code more robust. These instructions seem to be necessary here: diff --git a/tumblr_backup.py b/tumblr_backup.py
index 338c7d3..c2eb2fe 100755
--- a/tumblr_backup.py
+++ b/tumblr_backup.py
@@ -731,13 +731,17 @@ class TumblrPost:
src, "Your browser does not support the video element.", src, "Video file"
))
else:
- append(post['player'][-1]['embed_code'])
+ player = get_try('player')
+ if player:
+ append(player[-1]['embed_code'])
+ else:
+ append_try('video_url')
append_try('caption')
elif self.typ == 'audio':
src = ''
+ audio_url = get_try('audio_url') or get_try('audio_source_url')
if options.save_audio:
- audio_url = get_try('audio_url') or get_try('audio_source_url')
if post['audio_type'] == 'tumblr':
if audio_url.startswith('https://a.tumblr.com/'):
src = self.get_media_url(audio_url, '.mp3')
@@ -746,12 +750,13 @@ class TumblrPost:
src = self.get_media_url(audio_url, '.mp3')
elif post['audio_type'] == 'soundcloud':
src = self.get_media_url(audio_url, '.mp3')
- if src:
+ player = get_try('player')
+ if src or ((not player) and audio_url):
append(u'<p><audio controls><source src="%s" type=audio/mpeg>%s<br>\n<a href="%s">%s</a></audio></p>' % (
- src, "Your browser does not support the audio element.", src, "Audio file"
+ src, "Your browser does not support the audio element.", src or audio_url, "Audio file"
))
- else:
- append(post['player'])
+ elif player:
+ append(player)
append_try('caption')
elif self.typ == 'answer': |
@kafuku1 @themcny Is it possible to get the full command that was run (including blog name)? I'd like to try to test @cebtenzzre's patch, but don't know what specific payloads are causing the problem. |
I'm having issues with the latest release of the tool. Everytime I run it this error appears. I've looked for the same error but I didn't find any solution.
Exception in thread Thread-14:to 49 of 1679
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Users\user\Downloads\c\tumblr_backup.py", line 1043, in handler
File "C:\Users\user\Downloads\c\tumblr_backup.py", line 735, in save_con
tent
append(post['player'][-1]['embed_code'])
KeyError: 'player'
Exception in thread Thread-9:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Users\user\Downloads\c\tumblr_backup.py", line 1043, in handler
File "C:\Users\user\Downloads\c\tumblr_backup.py", line 735, in save_con
tent
append(post['player'][-1]['embed_code'])
KeyError: 'player'
Exception in thread Thread-17:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Users\user\Downloads\c\tumblr_backup.py", line 1043, in handler
File "C:\Users\user\Downloads\c\tumblr_backup.py", line 735, in save_con
tent
append(post['player'][-1]['embed_code'])
KeyError: 'player'
The text was updated successfully, but these errors were encountered: