Skip to content

Commit

Permalink
Merge pull request #258 from jpacg/master
Browse files Browse the repository at this point in the history
extractors/youku: 🔧 ccode
  • Loading branch information
Xinzhao Xu authored Sep 3, 2018
2 parents 5cd51fd + cc6c931 commit 5c2afb6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion extractors/qq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestQQ(t *testing.T) {
args: test.Args{
URL: "https://v.qq.com/x/page/n0687peq62x.html",
Title: "世界杯第一期:100秒速成!“伪球迷”世界杯生存指南",
Size: 23897406,
Size: 23759683,
Quality: "蓝光;(1080P)",
},
},
Expand Down
4 changes: 2 additions & 2 deletions extractors/youku.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func youkuUps(vid string) youkuData {
// grep -oE '"[0-9a-zA-Z+/=]{256}"' youku-player.min.js
ckey := "7B19C0AB12633B22E7FE81271162026020570708D6CC189E4924503C49D243A0DE6CD84A766832C2C99898FC5ED31F3709BB3CDD82C96492E721BDD381735026"
for _, ccode := range []string{config.Ccode} {
if ccode == "010101500003" {
if ccode == "0103010102" {
utid = generateUtdid()
}
url = fmt.Sprintf(
Expand Down Expand Up @@ -137,7 +137,7 @@ func hmacSha1(key []byte, msg []byte) []byte {
func generateUtdid() string {
timestamp := int32(time.Now().Unix())
var buffer bytes.Buffer
buffer.Write(getBytes(timestamp))
buffer.Write(getBytes(timestamp - 60*60*8))
buffer.Write(getBytes(rand.Int31()))
buffer.WriteByte(0x03)
buffer.WriteByte(0x00)
Expand Down
10 changes: 5 additions & 5 deletions extractors/youku_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func TestYouku(t *testing.T) {
config.InfoOnly = true
config.Ccode = "010101500003"
config.Ccode = "0103010102"
tests := []struct {
name string
args test.Args
Expand All @@ -19,17 +19,17 @@ func TestYouku(t *testing.T) {
args: test.Args{
URL: "http://v.youku.com/v_show/id_XMzUzMjE3NDczNg==.html",
Title: "车事儿:智能汽车已经不在遥远 东风风光iX5发布",
Size: 22692900,
Quality: "mp4hd2 1280x720",
Size: 45185427,
Quality: "mp4hd3 1920x1080",
},
},
{
name: "normal test",
args: test.Args{
URL: "http://v.youku.com/v_show/id_XMzQ1MTAzNjQwNA==.html",
Title: "这!就是街舞 第一季 第3期:百强“互杀”队长不忍直视",
Size: 750911635,
Quality: "mp4hd2 1280x720 国语",
Size: 1419459808,
Quality: "mp4hd3 1920x1080 国语",
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func init() {
"Playlist video items to download. Separated by commas like: 1,5,6",
)
flag.BoolVar(&config.Caption, "C", false, "Download captions")
flag.StringVar(&config.Ccode, "ccode", "010101500003", "Youku ccode")
flag.StringVar(&config.Ccode, "ccode", "0103010102", "Youku ccode")
flag.IntVar(
&config.RetryTimes, "retry", 100, "How many times to retry when the download failed",
)
Expand Down

0 comments on commit 5c2afb6

Please sign in to comment.