handle posts without media_content

This commit is contained in:
Morgan McMillian 2022-07-12 11:12:57 -07:00
parent cea73a38d6
commit 3297ab7c70
2 changed files with 6 additions and 5 deletions

View file

@ -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,9 +138,10 @@ def pnutpost(entry, source, token):
} }
} }
raw = [crosspost] raw = [crosspost]
for media in entry.media_content: if hasattr(entry, 'media_content'):
if media["medium"] == "image": for media in entry.media_content:
raw.append(embed_image(media["url"])) if media["medium"] == "image":
raw.append(embed_image(media["url"]))
try: try:
rx = re.compile('<.*?>') rx = re.compile('<.*?>')

View file

@ -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',