all repos — fixyoutube-go @ 4846d568efd55de76a5d085fe69abb4f30cff54d

A better way to embed YouTube videos everywhere (inspired by FixTweet).

fix proxy recursion
Marco Andronaco andronacomarco@gmail.com
Mon, 01 Jan 2024 23:40:55 +0100
commit

4846d568efd55de76a5d085fe69abb4f30cff54d

parent

a2de1ac53930095b77cb2248757e24c5624f30ff

1 files changed, 5 insertions(+), 2 deletions(-)

jump to
M invidious/invidious.goinvidious/invidious.go

@@ -1,6 +1,7 @@

package invidious import ( + "bytes" "encoding/json" "fmt" "io"

@@ -196,9 +197,11 @@

w.Header().Set("content-type", "video/mp4") w.Header().Set("Status", "200") - _, err = io.Copy(w, resp.Body) + temp := bytes.NewBuffer(nil) + _, err = io.Copy(temp, resp.Body) if err == nil { // done - return nil + _, err2 := io.Copy(w, temp) + return err2 } newIndex := formatIndex + 1