Skip to content

Commit

Permalink
version 1.0.4
Browse files Browse the repository at this point in the history
Handle non-200 HTTP responses in downloadSegment()
  • Loading branch information
Kevin Zhang committed Dec 31, 2013
1 parent 423a761 commit 5028007
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5028007

Please sign in to comment.