Skip to content

Commit

Permalink
extractors/youku: fix error data check
Browse files Browse the repository at this point in the history
  • Loading branch information
iawia002 committed May 10, 2018
1 parent 9f1bba5 commit 33af2e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion extractors/youku.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func youkuUps(vid string) youkuData {
// data must be emptied before reassignment, otherwise it will contain the previous value(the 'error' data)
data = youkuData{}
json.Unmarshal([]byte(html), &data)
if data.Data.Error.Code != -6004 {
if data.Data.Error == (errorData{}) {
return data
}
}
Expand Down
8 changes: 4 additions & 4 deletions extractors/youku_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ func TestYouku(t *testing.T) {
args: test.Args{
URL: "http://v.youku.com/v_show/id_XMzUzMjE3NDczNg==.html",
Title: "优酷汽车 车事儿:智能汽车已经不在遥远 东风风光iX5发布",
Size: 45185427,
Quality: "mp4hd3v2 1920x1080",
Size: 22692900,
Quality: "mp4hd2v2 1280x720",
},
},
{
name: "normal test",
args: test.Args{
URL: "http://v.youku.com/v_show/id_XMzQ1MTAzNjQwNA==.html",
Title: "这就是街舞 第3期:百强“互杀”队长不忍直视",
Size: 1419459808,
Quality: "mp4hd3v2 1920x1080",
Size: 750911635,
Quality: "mp4hd2v2 1280x720",
},
},
}
Expand Down

0 comments on commit 33af2e1

Please sign in to comment.