diff --git a/CHANGELOG.md b/CHANGELOG.md index f41508c..2848c24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +1.0.4 - 12/30/2013 + +* Handle non-200 HTTP responses in downloadSegment() + 1.0.3 - 12/25/2013 * Improve logging diff --git a/README.md b/README.md index bdfa38e..131a8e9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ gohls - HTTP Live Streaming (HLS) downloader written in Golang -* Current version: **1.0.3** +* Current version: **1.0.4** * Author: Kevin Zhang * License: [GNU GPL version 3](http://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/main.go b/main.go index 0871900..976cf9e 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,7 @@ import "lru" // https://github.com/golang/groupcache/blob/master/lru/lru.go import "strings" import "github.com/grafov/m3u8" -const VERSION = "1.0.3" +const VERSION = "1.0.4" var USER_AGENT string @@ -62,6 +62,10 @@ func downloadSegment(fn string, dlc chan *Download, recTime time.Duration) { log.Print(err) continue } + if resp.StatusCode != 200 { + log.Printf("Received HTTP %v for %v\n", resp.StatusCode, v.URI) + continue + } _, err = io.Copy(out, resp.Body) if err != nil { log.Fatal(err)