1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

27 lines
583 B
Go
Raw Normal View History

2017-08-05 13:48:53 -07:00
package builders
import (
"fmt"
itunes "github.com/mxpv/podcast"
2017-08-19 16:58:23 -07:00
"github.com/mxpv/podsync/pkg/api"
2017-11-03 16:04:33 -07:00
"github.com/mxpv/podsync/pkg/model"
2017-08-05 13:48:53 -07:00
)
const (
podsyncGenerator = "Podsync generator"
defaultCategory = "TV & Film"
)
2017-11-03 16:04:33 -07:00
func makeEnclosure(feed *model.Feed, id string, lengthInBytes int64) (string, itunes.EnclosureType, int64) {
2017-08-05 13:48:53 -07:00
ext := "mp4"
contentType := itunes.MP4
2017-11-03 15:04:33 -07:00
if feed.Format == api.FormatAudio {
2017-08-20 19:26:25 -07:00
ext = "m4a"
contentType = itunes.M4A
2017-08-05 13:48:53 -07:00
}
2017-11-26 00:31:48 -08:00
url := fmt.Sprintf("http://podsync.net/download/%s/%s.%s", feed.HashID, id, ext)
2017-08-05 13:48:53 -07:00
return url, contentType, lengthInBytes
}