KEY
) to create a signature and put it into a video URL. As long as the key is not disclosed, the video URL cannot be forged.Note:
For more information on enabling key hotlink protection, please see Setting Hotlink Protection.
A hotlink protection URL of a video can be generated by adding the hotlink protection parameters at the end of the original URL in the form of QueryString
, such as:
http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4?t=[t]&exper=[exper]&rlimit=[rlimit]&us=[us]&sign=[sign]
The hotlink protection parameters in QueryString
must be spliced in the order of t
, exper
, rlimit
, us
, and sign
. Below are descriptions and values of the parameters in a hotlink protection URL.
Parameter Name | Required | Description |
---|---|---|
KEY |
Yes | The key entered when key hotlink protection is enabled. It must contain 8–20 letters (a–Z) or digits (0–9). You are recommended to click Generate KEY in the console to generate a key. For detailed directions, please see Setting Hotlink Protection. |
Dir |
Yes | The remaining part of the path in an original video URL after the filename is removed. For example, if the original URL is http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4 , then the playback path is /dir1/dir2/ . |
t |
Yes | |
exper |
No | |
rlimit |
No | rlimit to 1 (instead, set it to 3, for example), as a mobile device's IP may change after reconnection. |
us |
No | us value when generating a hotlink protection URL each time. |
sign |
Yes |
sign = md5(KEY + Dir + t + exper + rlimit + us)
+
in the formula represents string splicing. Optional parameters can be empty strings.
Assume that you have a video in VOD and its original playback URL is http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4
, you have enabled key hotlink protection, the generated key is 24FEQmTzro4V5u3D5epW
, the generated random string is 72d4cd1101
, and now you want to:
The following describes how to generate hotlink protection URLs for the scenarios of "validity period control of a video playback address", "maximum number of IPs allowed for playback at a video playback address", and "allowed video playback duration control".
Parameter Name | Value | Description |
---|---|---|
KEY |
24FEQmTzro4V5u3D5epW |
The key you selected when enabling key hotlink protection. |
Dir |
/dir1/dir2/ |
The remaining part of the path in the original video URL after myVideo.mp4 is removed. |
t |
5a71afc0 |
Hexadecimal result of the expiration timestamp 1517400000 . |
us |
72d4cd1101 |
The generated random string. |
sign = md5("24FEQmTzro4V5u3D5epW/dir1/dir2/5a71afc072d4cd1101") = "3d8488faeb37d52d6bf63b63c1b171c3"
Splice the hotlink protection parameters into the QueryString
of the original video URL to generate the hotlink protection URL of the video:
http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4?t=5a71afc0&us=72d4cd1101&sign=3d8488faeb37d52d6bf63b63c1b171c3
Parameter Name | Value | Description |
---|---|---|
KEY |
24FEQmTzro4V5u3D5epW |
The key you selected when enabling key hotlink protection. |
Dir |
/dir1/dir2/ |
The remaining part of the path in the original video URL after myVideo.mp4 is removed. |
t |
5a71afc0 |
Hexadecimal result of the expiration timestamp 1517400000 . |
rlimit |
3 |
Allow up to 3 different IPs to play back the video at the URL. |
us |
72d4cd1101 |
The generated random string. |
sign = md5("24FEQmTzro4V5u3D5epW/dir1/dir2/5a71afc0372d4cd1101") = "c5214f0d5961b13acd558b4957c4dfc5"
Splice the hotlink protection parameters into the QueryString
of the original video URL to generate the hotlink protection URL of the video:
http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4?t=5a71afc0&rlimit=3&us=72d4cd1101&sign=c5214f0d5961b13acd558b4957c4dfc5
Parameter Name | Value | Description |
---|---|---|
KEY |
24FEQmTzro4V5u3D5epW |
The key you selected when enabling key hotlink protection. |
Dir |
/dir1/dir2/ |
The remaining part of the path in the original video URL after myVideo.mp4 is removed. |
t |
5a71afc0 |
Hexadecimal result of the expiration timestamp 1517400000 . |
exper |
300 |
Preview the first 5 minutes (i.e., 300 seconds). |
us |
72d4cd1101 |
The generated random string. |
sign = md5("24FEQmTzro4V5u3D5epW/dir1/dir2/5a71afc030072d4cd1101") = "547d98c4b91e81b5ea55c95cef63223f"
Splice the hotlink protection parameters into the QueryString
of the original video URL to generate the hotlink protection URL of the video:
http://example.vod2.myqcloud.com/dir1/dir2/myVideo.mp4?t=5a71afc0&exper=300&us=72d4cd1101&sign=547d98c4b91e81b5ea55c95cef63223f
VOD provides key hotlink protection URL generator and checker for you to quickly and accurately generate and check hotlink protection URLs.
KEY
) must contain 8–20 letters (a–Z) or digits (0–9).QueryString
of a hotlink protection URL must be in the order of t
, exper
, rlimit
, us
, and sign
; otherwise, the video cannot be played back.
Was this page helpful?