www.example.com into EdgeOne acceleration and due to popular series updates, you expect that submitting the M3U8 resource of a film will automatically pre-warm the associated TS resources to EdgeOne.https://www.example.com/c8679239vodtranssgp1500031474/5fac87c91397757892217228202/adp.1505647.m3u8.https://www.example.com/c8679239vodtranssgp1500031474/5fac87c91397757892217228202/1505647_0_0.ts.https://www.example.com/c8679239vodtranssgp1500031474/5fac87c91397757892217228202/adp.1505647.m3u8.curl -X POST https://teo.tencentcloudapi.com -H "Authorization: TC3-HMAC-SHA256 Credential=******************************/2025-02-19/teo/tc3_request, SignedHeaders=content-type;host, Signature=9ec53d3ba8d4049c219052b0a2275ff3a30d3429d6295ae4c799c74d32c8f015" -H "Content-Type: application/json" -H "Host: teo.tencentcloudapi.com" -H "X-TC-Action: CreatePrefetchTask" -H "X-TC-Timestamp: 1739965395" -H "X-TC-Version: 2022-09-01" -H "X-TC-Language: zh-CN" -d '{"ZoneId":"zone-xxx","Targets":["https://www.example.com/c8679239vodtranssgp1500031474/5fac87c91397757892217228202/adp.1505647.m3u8"]}'
package mainimport ("fmt""github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common""github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors""github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"teo "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo/v20220901")func main() {// Instantiate a credential object. You need to pass in the Tencent Cloud account's SecretId and SecretKey. Note the confidentiality of the keys.// Code leakage may result in the exposure of your SecretId and SecretKey, threatening the security of all resources under the account. The following code example is for reference only; it is recommended to use keys in a more secure manner. Please refer to: https://www.tencentcloud.com/document/product/1278/85305?from_cn_redirect=1// Keys can be obtained from the official console at https://console.tencentcloud.com/cam/capicredential := common.NewCredential("SecretId","SecretKey",)// Instantiate a client option, optional, can be skipped if there are no special needscpf := profile.NewClientProfile()cpf.HttpProfile.Endpoint = "teo.tencentcloudapi.com"// Instantiate the client object for the requested product. For domestic sites, you can fill in ap-guangzhou as the access region; for international sites, fill in ap-singapore as the access region. clientProfile is optional. client, _ := teo.NewClient(credential, "ap-guangzhou", cpf)client, _ := teo.NewClient(credential, "ap-guangzhou", cpf)// Instantiate a request object; each interface corresponds to a request objectrequest := teo.NewCreatePrefetchTaskRequest()request.ZoneId = common.StringPtr("zone-364ni75dvzva")request.Targets = common.StringPtrs([]string{"https://www.example.com/1.m3u8"})request.PrefetchMediaSegments = common.StringPtr("on")// The returned resp is an instance of CreatePrefetchTaskResponse, corresponding to the request objectresponse, err := client.CreatePrefetchTask(request)if _, ok := err.(*errors.TencentCloudSDKError); ok {fmt.Printf("An API error has returned: %s", err)return}if err != nil {panic(err)}// Output JSON format string responsefmt.Printf("%s", response.ToJsonString())}
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback