Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
Co-Authored-By: Xinzhao Xu <xuxinzhao@caicloud.io>
  • Loading branch information
weiyongsheng and Xinzhao Xu committed Apr 8, 2020
1 parent ebac7d0 commit da89466
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extractors/geekbang/geekbang.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func Extract(url string) ([]downloader.Data, error) {
return nil, extractors.ErrURLParseFailed
}

//获取视频信息
// Get video information
heanders := map[string]string{"Origin": "https://time.geekbang.org", "Content-Type": "application/json", "Referer": url}
params := strings.NewReader("{\"id\":" + string(matches[2]) + "}")
res, err := request.Request(http.MethodPost, "https://time.geekbang.org/serv/v1/article", params, heanders)
Expand All @@ -101,7 +101,7 @@ func Extract(url string) ([]downloader.Data, error) {
return nil, errors.New("请先购买课程,或使用Cookie登录。")
}

//获取视频授权token信息
// Get video license token information
params = strings.NewReader("{\"source_type\":1,\"aid\":" + string(matches[2]) + ",\"video_id\":\"" + string(data.Data.VideoID) + "\"}")
res, err = request.Request(http.MethodPost, "https://time.geekbang.org/serv/v3/source_auth/video_play_auth", params, heanders)
if err != nil {
Expand All @@ -118,7 +118,7 @@ func Extract(url string) ([]downloader.Data, error) {
return nil, errors.New(string(playAuth.Error))
}

//获取视频的播放信息
// Get video playback information
heanders = map[string]string{"Accept-Encoding": ""}
res, err = request.Request(http.MethodGet, "http://ali.mantv.top/play/info?playAuth="+playAuth.Data.PlayAuth, nil, heanders)
if err != nil {
Expand Down

0 comments on commit da89466

Please sign in to comment.