Compare commits

..

No commits in common. "bea70c722c88412bf8ee92356d2508b56ad9b04b" and "d022f43aa3c27ce0b7a58ba2bae8118f478d7cac" have entirely different histories.

View File

@ -167,8 +167,7 @@ if source[:4] == 'http':
if 'links' in t: if 'links' in t:
for l in t.links: for l in t.links:
if l.type in ('image/gif', 'image/jpg', 'image/png', 'image/webp'): if l.type in ('image/gif', 'image/jpg', 'image/png', 'image/webp'):
media = requests.get(l.url, headers = {'User-agent': 'Mozilla/5.0'}) media = requests.get(l.url)
if media.status_code == 200:
media_posted = mastodon_api.media_post( media_posted = mastodon_api.media_post(
media.content, mime_type=media.headers.get('content-type')) media.content, mime_type=media.headers.get('content-type'))
toot_media.append(media_posted['id']) toot_media.append(media_posted['id'])
@ -202,7 +201,7 @@ if source[:4] == 'http':
in_reply_to_id=None, in_reply_to_id=None,
media_ids=toot_media, media_ids=toot_media,
sensitive=False, sensitive=False,
visibility='unlisted', visibility='public',
spoiler_text=None) spoiler_text=None)
if "id" in toot: if "id" in toot:
db.execute("INSERT INTO tweets VALUES ( ? , ? , ? , ? , ? )", db.execute("INSERT INTO tweets VALUES ( ? , ? , ? , ? , ? )",