handle posts without media_content
This commit is contained in:
parent
cea73a38d6
commit
3297ab7c70
2 changed files with 6 additions and 5 deletions
|
@ -21,7 +21,7 @@ dr = False
|
|||
@click.option('--prime', is_flag=True)
|
||||
@click.option('--debug', is_flag=True)
|
||||
@click.option('--dryrun', is_flag=True)
|
||||
@click.version_option(version='0.2.1')
|
||||
@click.version_option(version='0.2.2')
|
||||
def main(ctx, db, prime, debug, dryrun):
|
||||
global dr
|
||||
|
||||
|
@ -138,9 +138,10 @@ def pnutpost(entry, source, token):
|
|||
}
|
||||
}
|
||||
raw = [crosspost]
|
||||
for media in entry.media_content:
|
||||
if media["medium"] == "image":
|
||||
raw.append(embed_image(media["url"]))
|
||||
if hasattr(entry, 'media_content'):
|
||||
for media in entry.media_content:
|
||||
if media["medium"] == "image":
|
||||
raw.append(embed_image(media["url"]))
|
||||
|
||||
try:
|
||||
rx = re.compile('<.*?>')
|
||||
|
|
2
setup.py
2
setup.py
|
@ -2,7 +2,7 @@ from setuptools import setup
|
|||
|
||||
setup(
|
||||
name='feedbot',
|
||||
version='0.2.1',
|
||||
version='0.2.2',
|
||||
py_modules=[
|
||||
'models',
|
||||
'feedbot',
|
||||
|
|
Loading…
Reference in a new issue