mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-18 23:04:21 +01:00
support .mov videos on normal notes.
This commit is contained in:
4
data.go
4
data.go
@@ -159,7 +159,7 @@ func grabData(ctx context.Context, code string, isProfileSitemap bool) (*Data, e
|
|||||||
image = imageMatch[0]
|
image = imageMatch[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
videoMatch := regexp.MustCompile(`https:\/\/[^ ]*\.(mp4|webm)`).FindStringSubmatch(event.Content)
|
videoMatch := regexp.MustCompile(`https:\/\/[^ ]*\.(mp4|mov|webm)`).FindStringSubmatch(event.Content)
|
||||||
var video string
|
var video string
|
||||||
if len(videoMatch) > 0 {
|
if len(videoMatch) > 0 {
|
||||||
video = videoMatch[0]
|
video = videoMatch[0]
|
||||||
@@ -169,6 +169,8 @@ func grabData(ctx context.Context, code string, isProfileSitemap bool) (*Data, e
|
|||||||
if video != "" {
|
if video != "" {
|
||||||
if strings.HasSuffix(video, "mp4") {
|
if strings.HasSuffix(video, "mp4") {
|
||||||
videoType = "mp4"
|
videoType = "mp4"
|
||||||
|
} else if strings.HasSuffix(video, "mov") {
|
||||||
|
videoType = "mov"
|
||||||
} else {
|
} else {
|
||||||
videoType = "webm"
|
videoType = "webm"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user