Repository: Cog-Creators/Red-DiscordBot

Issue:
[Streams] YouTube Alert Suggestion/Option
Since this alert is very bland and link to the livestream is already used in the preview, why not have the bot just post the link to the stream instead of the bot's own preview. Then you get a large image (like Twitch or just posting a video) which is better visually, plus a lot of info that is added in the description of the stream is also visible in the preview. And you can also press play to start the stream directly in Discord if you want to take a peek without going to YouTube.

This is a lot better than what is used now IMO.
Would be awesome to at least have this as an option to use if it's not changed completely. 


Discussion:
The info from stream's description is apparently only on mobile. But better nonetheless.

Just for reference.
Desktop: 
![image](https://user-images.githubusercontent.com/24851042/77333870-54f7d600-6d24-11ea-8b0b-426104932c11.png)

Mobile:
![image](https://user-images.githubusercontent.com/24851042/77333901-5fb26b00-6d24-11ea-8805-61b41cfc0d1e.png)


I can't say right now if we want stream description to be included in the embed (possibly configurable?) but stream desription *is* included in the API response that we get already so it's not hard to add and it won't cost us any additional quota.

I doubt we will use the embed that is generated by discord though so preview would still be a thumbnail, not a video - same as for stream alerts for Twitch.
The stream's description is automatically added by Discord on mobile devices. I was just showing the difference. I also mentioned it above, that the description is only shown on mobile.
Forgot to add. The link post is just better than bot creating a preview. Why would it not be okay for the bot to post "Lalala is live" with a YouTube link to the stream which is already used for the poor preview anyway? Seems a bit weird to me.
@Menteroth Discord's link crawler (the thing that goes to the link and checks for metadata to generate embeds for links) has been problematic in the past and I don't think it's good to rely on it.
But what I meant in my comment is that we can generate same embed as the one that discord generates with no issue and it's only a question of whether we want that (I would say we do, but I can't talk for others).

Here's how Discord's embeds looks:
![Discord_2020-03-23_17-16-33](https://user-images.githubusercontent.com/6032823/77338859-3cd78500-6d2b-11ea-8661-1deb07458a9f.png)

Here's a few previews of how embed generated by us could look:
![Discord_2020-03-23_17-27-29](https://user-images.githubusercontent.com/6032823/77339127-a2c40c80-6d2b-11ea-9dfc-03fbd1105d8f.png)
![Discord_2020-03-23_17-27-04](https://user-images.githubusercontent.com/6032823/77339133-a5266680-6d2b-11ea-896f-a998c752412a.png)
![Discord_2020-03-23_17-20-51](https://user-images.githubusercontent.com/6032823/77339152-a6f02a00-6d2b-11ea-8f00-7e170b60ff3a.png)

For comparison, the current embed looks like this:
![image](https://user-images.githubusercontent.com/6032823/77340803-1c5cfa00-6d2e-11ea-8915-d3ea12629308.png)

That first image you say is Discord embed,  that has to be mobile, yes? Because you don't get description on desktop client. That's my first image as well. And with desc. in my second image, from my phone.

The first image from "us" is good enough. I really dislike the current one so much haha.
Description is also not something I meant to say I wanted added, just what it looks from my phone in comparison to desktop.

But yeah. The title and large image. Big :+1:.
> That first image you say is Discord embed, that has to be mobile, yes?

No, it's not on mobile, it's on desktop client, I guess I just kind of gave one reason why we can't really rely on embeds generated by Discord, they're not consistent (sometimes they might not even show at all) 😄 

If this is just about having bigger image then I agree that we should have used bigger thumbnail there, similarly to other stream alert embeds.

Changing status to Accepted, we will appreciate if someone would take this PR, it should be a matter of changing the size of thumbnail from `"default"` to `"medium"` here:
https://github.com/Cog-Creators/Red-DiscordBot/blob/a88b2af4a9d089141d34a01485bcf979607a957c/redbot/cogs/streams/streamtypes.py#L156

Resolving patch:
diff --git a/redbot/cogs/streams/streamtypes.py b/redbot/cogs/streams/streamtypes.py
--- a/redbot/cogs/streams/streamtypes.py
+++ b/redbot/cogs/streams/streamtypes.py
@@ -153,7 +153,7 @@ def make_embed(self, data):
         vid_data = data["items"][0]
         video_url = "https://youtube.com/watch?v={}".format(vid_data["id"])
         title = vid_data["snippet"]["title"]
-        thumbnail = vid_data["snippet"]["thumbnails"]["default"]["url"]
+        thumbnail = vid_data["snippet"]["thumbnails"]["medium"]["url"]
         channel_title = vid_data["snippet"]["channelTitle"]
         embed = discord.Embed(title=title, url=video_url)
         embed.set_author(name=channel_title)


Test patch: