Spacebot icon indicating copy to clipboard operation
Spacebot copied to clipboard

Videos don't load in meme command + End interaction button

Open Dhravya opened this issue 2 years ago • 8 comments

I noticed that videos simply don't load in the meme command. The bigger issue is that I don't really know how to work around this. Any suggestions? image

Also, an end interaction button could be nice that just disables the buttons.

Dhravya avatar Dec 11 '21 16:12 Dhravya

Its easy tbh. Check if the url of the submission starts with "https://i.redd.it/"

This is how i do in one of my bots-

async for submission in hot:
    if submission.url.startswith("https://i.redd.it/"):
    self.new_memes.append(submission)

OmLanke avatar Dec 11 '21 16:12 OmLanke

Checking is simple, but what about embedding the video? Is it even possible?

Dhravya avatar Dec 11 '21 16:12 Dhravya

No. At least i haven't successfully found a way.

You can send the permalink of the submission and discord will natively embed it. The videos never played on my laptop tho. I had to click on the link to watch them

OmLanke avatar Dec 11 '21 16:12 OmLanke

Oh, i just discovered this

        url = data[0]["data"]["children"][0]["data"]["secure_media"]["reddit_video"][
            "fallback_url"
        ]

The above snippet returns the direct .mp4 url of the video, but how to attach it?

Dhravya avatar Dec 11 '21 16:12 Dhravya

Yeah i can't seem to find a method that adds video links to embed.

Try setting it as the url during definition of the embed. I'll check and come back

OmLanke avatar Dec 11 '21 16:12 OmLanke

Yea maybe should just detect the video and make a hyperlink then

Dhravya avatar Dec 11 '21 16:12 Dhravya

This worked?

OmLanke avatar Jan 10 '22 06:01 OmLanke

nope didnt work

I don't think embeds can accept video urls lel the video just doesnt load

Dhravya avatar Jan 11 '22 03:01 Dhravya