This method can't be used from web applications. Referrer is restricted to pcloud.com.
Name
gethlslink
Auth
yes
Description
Get a m3u8 playlist for live streaming for video file
Takes fileid (or path) of a video file and provides links (in the same way getfilelink does with hosts and path) from which a m3u8 playlist for HTTP Live Streaming can be downloaded.
Optional parameters are abitrate, vbitrate, resolution and skipfilename.
These have the same meaning as in getvideolink.
The defaults are the same as for getvideolink.
URL
https://api.pcloud.com/gethlslink
Required
Parameter | Description |
fileid | int ID of the renamed file |
path | string Path to the renamed file |
Optional
Parameter | Description |
abitrate | int audio bit rate in kilobits, from 16 to 320 |
vbitrate | int video bitrate in kilobits, from 16 to 4000 |
resolution | string in pixels, from 64x64 to 1280x960, WIDTHxHEIGHT |
skipfilename | int include the name of the file in the generated link |
Output
On success it will return array hosts with servers that have the file. The first server is the one we consider best for current download.
In path there will be a request you should send to server. You need to construct the URL yourself by concatenating http:// or https:// with one of the hosts (first one) and the path.
Example
{ expires: "Thu, 03 Oct 2013 01:27:42 +0000", result: 0, path: "/hash/My video.m3u8", hosts: [ "c11.pcloud.com", "c20.pcloud.com" ] }
Code | Description |
1000 | Log in required. |
1004 | No fileid or path provided. |
2000 | Log in failed. |
2002 | A component of parent directory does not exist. |
2003 | Access denied. You do not have permissions to preform this operation. |
2009 | File not found. |
2010 | Invalid path. |
2044 | Video links can only be generated for videos. |
4000 | Too many login tries from this IP address. |
5002 | Internal error, no servers available. Try again later. |