fix a keyerror
This commit is contained in:
parent
ae75212eba
commit
8fe30f0c88
1 changed files with 5 additions and 1 deletions
4
main.py
4
main.py
|
@ -181,8 +181,12 @@ for f in following:
|
||||||
#you might be wondering, "lynne, what if the instance ratelimits you after 40 posts, and they've made 60 since main.py was last run? wouldn't the bot miss 20 posts and never be able to see them?" to which i reply, "i know but i don't know how to fix it"
|
#you might be wondering, "lynne, what if the instance ratelimits you after 40 posts, and they've made 60 since main.py was last run? wouldn't the bot miss 20 posts and never be able to see them?" to which i reply, "i know but i don't know how to fix it"
|
||||||
done = True
|
done = True
|
||||||
if cfg['lang']:
|
if cfg['lang']:
|
||||||
|
try:
|
||||||
if oi['object']['contentMap'][cfg['lang']]: # filter for language
|
if oi['object']['contentMap'][cfg['lang']]: # filter for language
|
||||||
insert_toot(oi, f, toot, c)
|
insert_toot(oi, f, toot, c)
|
||||||
|
except KeyError:
|
||||||
|
#JSON doesn't have contentMap, just insert the toot irregardlessly
|
||||||
|
insert_toot(oi, f, toot, c)
|
||||||
else:
|
else:
|
||||||
insert_toot(oi, f, toot, c)
|
insert_toot(oi, f, toot, c)
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue