123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- package dyjx
- import (
- "fmt"
- "io/ioutil"
- "net/http"
- "testing"
- )
- func TestUrl2(t *testing.T) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- request, err := http.NewRequest("GET", "https://aweme.snssdk.com/aweme/v1/play/?video_id=v0300fg10000c2pqsiu8valn90t2ugq0&ratio=720p&line=0", nil)
- if err != nil {
- fmt.Print(err.Error())
- }
-
-
-
-
-
-
- client := &http.Client{
- CheckRedirect: func(req *http.Request, via []*http.Request) error {
- return http.ErrUseLastResponse
- },
- }
-
-
-
-
- request.Header.Set("User-Agent", "Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Mobile Safari/537.36")
- response, err := client.Do(request)
- if err != nil {
- fmt.Print("err = ", err.Error())
- }
- fmt.Print("body = ", response.StatusCode)
- fmt.Print("loc =", response.Header.Get("location"))
- if response.StatusCode == 200 {
- body, _ := ioutil.ReadAll(response.Body)
- _ = string(body)
-
- }
- fmt.Print("body = ", response.StatusCode)
- }
|