pCloud / pcloud-sdk-php

pCloud SDK for PHP
MIT License
54 stars 22 forks source link

gethlslink endpoint not working properly #33

Open JeanLouisMassei opened 2 months ago

JeanLouisMassei commented 2 months ago

Hello

Not related to php sdk it seems, but related to API itself.

$pCloudFolder = new pCloud\Sdk\Folder($pCloudApp); $content = $pCloudFolder->getContent($_GET['folderId']); $request = new pCloud\Sdk\Request($pCloudApp); foreach ($content as $item) { if (strpos($item->name, 'm3u8') !== false) { $response = $request->get("gethlslink", ['fileid' => $item->fileid]); // this produces error //$response = $request->get("getfilelink", ['fileid' => $item->fileid]); // this is ok } }

When I try to API directly from the terminal :

// works perfectly curl -X GET \ 'https://eapi.pcloud.com/getfilelink?fileid=123456&access_token=thisisascret'

// gives 1000 error (log in required, but the access token works for previous curl command) curl -X GET \ 'https://eapi.pcloud.com/gethlslink?fileid=123456&access_token=thisisascret'

According to the documentation, both endpoints should require exactly the same input parameters so I don't understand...

SHelfinger commented 2 weeks ago

Just a heads up.

https://docs.pcloud.com/methods/streaming/gethlslink.html

You using eapi (Europe), in the documentation is listed as only api.pcloud.com.