close file
This commit is contained in:
parent
3a03a056e9
commit
878efc08d0
1 changed files with 1 additions and 0 deletions
1
main.go
1
main.go
|
|
@ -232,6 +232,7 @@ func (h *handler) ProcessPost(event *models.Event) error {
|
||||||
resp, _ := http.Get(buildBlobURL(h.bsky.Bluesky.Cfg.PDSURL, h.bsky.Bluesky.Cfg.DID, media.URI))
|
resp, _ := http.Get(buildBlobURL(h.bsky.Bluesky.Cfg.PDSURL, h.bsky.Bluesky.Cfg.DID, media.URI))
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
f, _ := os.Create(media.URI + ".mp4")
|
f, _ := os.Create(media.URI + ".mp4")
|
||||||
|
defer f.Close()
|
||||||
io.Copy(f, resp.Body)
|
io.Copy(f, resp.Body)
|
||||||
f.Seek(0, 0)
|
f.Seek(0, 0)
|
||||||
mediaAdd := tgbotapi.NewInputMediaVideo(tgbotapi.FileReader{Name: "video.mp4", Reader: f})
|
mediaAdd := tgbotapi.NewInputMediaVideo(tgbotapi.FileReader{Name: "video.mp4", Reader: f})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue