Allow/Add YouTube and Twitter mobile link previews (#3314)
This commit is contained in:
parent
303197fbd0
commit
142b170ec9
|
@ -80,11 +80,21 @@ func LinkPreviewWhitelist() []Site {
|
||||||
Address: "youtu.be",
|
Address: "youtu.be",
|
||||||
ImageSite: false,
|
ImageSite: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Title: "YouTube Mobile",
|
||||||
|
Address: "m.youtube.com",
|
||||||
|
ImageSite: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Title: "Twitter",
|
Title: "Twitter",
|
||||||
Address: "twitter.com",
|
Address: "twitter.com",
|
||||||
ImageSite: false,
|
ImageSite: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Title: "Twitter Mobile",
|
||||||
|
Address: "mobile.twitter.com",
|
||||||
|
ImageSite: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Title: "GIPHY GIFs shortener",
|
Title: "GIPHY GIFs shortener",
|
||||||
Address: "gph.is",
|
Address: "gph.is",
|
||||||
|
@ -267,7 +277,7 @@ func GetLinkPreviewData(link string) (previewData LinkPreviewData, err error) {
|
||||||
hostname := strings.ToLower(u.Hostname())
|
hostname := strings.ToLower(u.Hostname())
|
||||||
|
|
||||||
switch hostname {
|
switch hostname {
|
||||||
case "youtube.com", "youtu.be", "www.youtube.com":
|
case "youtube.com", "youtu.be", "www.youtube.com", "m.youtube.com":
|
||||||
return GetYoutubePreviewData(link)
|
return GetYoutubePreviewData(link)
|
||||||
case "github.com", "our.status.im":
|
case "github.com", "our.status.im":
|
||||||
return GetGenericLinkPreviewData(link)
|
return GetGenericLinkPreviewData(link)
|
||||||
|
@ -275,7 +285,7 @@ func GetLinkPreviewData(link string) (previewData LinkPreviewData, err error) {
|
||||||
return GetGiphyPreviewData(link)
|
return GetGiphyPreviewData(link)
|
||||||
case "gph.is":
|
case "gph.is":
|
||||||
return GetGiphyShortURLPreviewData(link)
|
return GetGiphyShortURLPreviewData(link)
|
||||||
case "twitter.com":
|
case "twitter.com", "mobile.twitter.com":
|
||||||
return GetTwitterPreviewData(link)
|
return GetTwitterPreviewData(link)
|
||||||
case "media.tenor.com":
|
case "media.tenor.com":
|
||||||
return FakeGenericImageLinkPreviewData("Tenor", link)
|
return FakeGenericImageLinkPreviewData("Tenor", link)
|
||||||
|
|
Loading…
Reference in New Issue