mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-08-04 21:16:07 -04:00
Removed unneeded code and fixed small typos
This commit is contained in:
@@ -13,7 +13,6 @@ class StreamListener(mastodon.StreamListener):
|
||||
pub.sendMessage("mastodon.status_received", status=status, session_name=self.session_name)
|
||||
|
||||
def on_conversation(self, conversation):
|
||||
print("New conversation: {}".format(conversation))
|
||||
pub.sendMessage("mastodon.conversation_received", conversation=conversation, session_name=self.session_name)
|
||||
|
||||
def on_notification(self, notification):
|
||||
|
@@ -35,13 +35,15 @@ def is_audio_or_video(post):
|
||||
|
||||
def is_image(post):
|
||||
if post.reblog != None:
|
||||
return is_audio_or_video(post.reblog)
|
||||
return is_image(post.reblog)
|
||||
# Checks firstly for Mastodon native videos and audios.
|
||||
for media in post.media_attachments:
|
||||
if media["type"] == "gifv" or media["type"] == "image":
|
||||
return True
|
||||
|
||||
def get_media_urls(post):
|
||||
if hasattr(post, "reblog") and post.reblog != None:
|
||||
return get_media_urls(post.reblog)
|
||||
urls = []
|
||||
for media in post.media_attachments:
|
||||
if media.get("type") == "audio" or media.get("type") == "video":
|
||||
|
Reference in New Issue
Block a user