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('--prime', is_flag=True)
|
||||||
@click.option('--debug', is_flag=True)
|
@click.option('--debug', is_flag=True)
|
||||||
@click.option('--dryrun', 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):
|
def main(ctx, db, prime, debug, dryrun):
|
||||||
global dr
|
global dr
|
||||||
|
|
||||||
|
@ -138,6 +138,7 @@ def pnutpost(entry, source, token):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
raw = [crosspost]
|
raw = [crosspost]
|
||||||
|
if hasattr(entry, 'media_content'):
|
||||||
for media in entry.media_content:
|
for media in entry.media_content:
|
||||||
if media["medium"] == "image":
|
if media["medium"] == "image":
|
||||||
raw.append(embed_image(media["url"]))
|
raw.append(embed_image(media["url"]))
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -2,7 +2,7 @@ from setuptools import setup
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='feedbot',
|
name='feedbot',
|
||||||
version='0.2.1',
|
version='0.2.2',
|
||||||
py_modules=[
|
py_modules=[
|
||||||
'models',
|
'models',
|
||||||
'feedbot',
|
'feedbot',
|
||||||
|
|
Loading…
Reference in a new issue