1
0
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:
Maksym Pavlenko
2017-08-05 13:48:53 -07:00
parent b1a608c1fb
commit 15d58b208c
5 changed files with 434 additions and 31 deletions

View 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
}