mirror of
https://github.com/mxpv/podsync.git
synced 2024-05-11 05:55:04 +00:00
Implement Vimeo builder
This commit is contained in:
35
web/pkg/builders/common.go
Normal file
35
web/pkg/builders/common.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package builders
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
itunes "github.com/mxpv/podcast"
|
||||
"github.com/mxpv/podsync/web/pkg/database"
|
||||
)
|
||||
|
||||
const (
|
||||
podsyncGenerator = "Podsync generator"
|
||||
defaultCategory = "TV & Film"
|
||||
)
|
||||
|
||||
type linkType int
|
||||
|
||||
const (
|
||||
_ = iota
|
||||
linkTypeChannel linkType = iota
|
||||
linkTypePlaylist
|
||||
linkTypeUser
|
||||
linkTypeGroup
|
||||
)
|
||||
|
||||
func makeEnclosure(feed *database.Feed, id string, lengthInBytes int64) (string, itunes.EnclosureType, int64) {
|
||||
ext := "mp4"
|
||||
contentType := itunes.MP4
|
||||
if feed.Format == database.AudioFormat {
|
||||
ext = "mp3"
|
||||
contentType = itunes.MP3
|
||||
}
|
||||
|
||||
url := fmt.Sprintf("http://podsync.net/download/%s/%s.%s", feed.HashId, id, ext)
|
||||
return url, contentType, lengthInBytes
|
||||
}
|
||||
Reference in New Issue
Block a user