mirror of
https://github.com/cquest/tootbot.git
synced 2025-01-18 04:16:59 +00:00
Removed unnecessary code
This commit is contained in:
parent
03da7875aa
commit
e30fd92bd3
|
@ -100,7 +100,6 @@ if source[:4] == 'http':
|
||||||
c = ("RT https://twitter.com/%s\n" % t.author[2:-1]) + c
|
c = ("RT https://twitter.com/%s\n" % t.author[2:-1]) + c
|
||||||
toot_media = []
|
toot_media = []
|
||||||
# get the pictures...
|
# get the pictures...
|
||||||
hasMedia = False
|
|
||||||
|
|
||||||
if 'summary' in t:
|
if 'summary' in t:
|
||||||
for p in re.finditer(r"https://pbs.twimg.com/[^ \xa0\"]*", t.summary):
|
for p in re.finditer(r"https://pbs.twimg.com/[^ \xa0\"]*", t.summary):
|
||||||
|
@ -116,7 +115,6 @@ if source[:4] == 'http':
|
||||||
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'])
|
||||||
hasMedia = True
|
|
||||||
except:
|
except:
|
||||||
print('Could not upload media to Mastodon! ' + mediaUrl)
|
print('Could not upload media to Mastodon! ' + mediaUrl)
|
||||||
|
|
||||||
|
@ -127,10 +125,6 @@ if source[:4] == 'http':
|
||||||
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'])
|
||||||
hasMedia = True
|
|
||||||
|
|
||||||
if toot_media is None:
|
|
||||||
hasMedia = False
|
|
||||||
|
|
||||||
# replace short links by original URL
|
# replace short links by original URL
|
||||||
m = re.search(r"http[^ \xa0]*", c)
|
m = re.search(r"http[^ \xa0]*", c)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user