{"id":13617123,"url":"https://github.com/dailymotion/cloudkey-php","last_synced_at":"2025-04-15T19:29:22.271Z","repository":{"id":869863,"uuid":"609435","full_name":"dailymotion/cloudkey-php","owner":"dailymotion","description":"Dailymotion Cloud PHP client API","archived":false,"fork":false,"pushed_at":"2024-09-27T10:03:39.000Z","size":64,"stargazers_count":29,"open_issues_count":6,"forks_count":24,"subscribers_count":90,"default_branch":"master","last_synced_at":"2025-03-29T00:09:13.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dailymotion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-04-14T01:47:53.000Z","updated_at":"2024-09-27T11:07:52.000Z","dependencies_parsed_at":"2025-01-15T05:13:51.039Z","dependency_job_id":null,"html_url":"https://github.com/dailymotion/cloudkey-php","commit_stats":{"total_commits":82,"total_committers":15,"mean_commits":5.466666666666667,"dds":0.6341463414634146,"last_synced_commit":"04886c942a9ad976b5baf87dde57b06717f183b8"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailymotion%2Fcloudkey-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailymotion%2Fcloudkey-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailymotion%2Fcloudkey-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailymotion%2Fcloudkey-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dailymotion","download_url":"https://codeload.github.com/dailymotion/cloudkey-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249138124,"owners_count":21218833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T20:01:37.235Z","updated_at":"2025-04-15T19:29:22.250Z","avatar_url":"https://github.com/dailymotion.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"Remote methods\n==============\n\nThe Dailymotion Cloud API PHP binding exposes all API methods described in the API reference.\nA master class named `CloudKey` exposes all namespaces through object attributes. For instance,\na call to the `count` method in the `media` namespace would be as follow:\n\n    $cloudkey = new CloudKey($user_id, $api_key);\n    $result = $cloudkey-\u003emedia-\u003ecount();\n\nFor methods expecting parameters, these must be passed as an associative array:\n\n    $media = $cloudkey-\u003emedia-\u003einfo(array('id' =\u003e $a_media_id));\n\nThe returned values (when available) are either `stdClass` instances (when result is a structure)\nor arrays of `stdClass` instances (when result is a list of structures):\n\n    # Simple structure response\n    $media = $cloudkey-\u003emedia-\u003einfo(array('id' =\u003e $a_media_id));\n    echo $media-\u003eid;\n\n    # List of structures response\n    $page = 1;\n    while(1) {\n        $res = $cloudkey-\u003emedia-\u003elist(array('fields' =\u003e array('id', 'meta.title'), 'page' =\u003e $page++));\n        foreach($res-\u003elist as $media) {\n            printf(\"%s %s\\n\", $media-\u003eid, $media-\u003emeta-\u003etitle);\n        }\n        if ($res-\u003epage == $res-\u003epages) {\n            break;\n        }\n    }\n\nLocal methods\n=============\n\nAdditional local methods are exposed by the CloudKey class. They are not documented in the API\nreference and provided as helpers to ease the Dailymotion Cloud API integration.\n\n`file-\u003eupload_file($path)`\n--------------------------\n\nThis method manages files uploads to the Dailymotion Cloud upload servers. Information pertinent\nto the API media creation processus will be returned as a `dict`.\n\nArguments:\n\n- `$path`: (required) the path of the uploaded file.\n\nExample:\n\n    # source asset upload example\n    $file = $cloudkey-\u003efile-\u003eupload_file('path/to/video.mov');\n    # The list of encoding assets that we want\n    $assets = array('mp4_h264_aac', 'mp4_h264_aac_hq', 'jpeg_thumbnail_medium', 'jpeg_thumbnail_source');\n    # Metadata\n    $meta = array('title' =\u003e 'My video', 'author' =\u003e 'Author');\n    $media = $cloudkey-\u003emedia-\u003ecreate(array('assets_names' =\u003e $assets, 'meta' =\u003e $meta, 'url' =\u003e $file-\u003eurl));\n\n`media.get_embed_url(id)`\n-------------------------\n\nThis method returns a signed URL to a Dailymotion Cloud player embed (see the API reference for details).\nThe generated URL is perishable, and access is granted based on the provided security level bitmask.\n\nArguments:\n\n- `id`: (required) the media id.\n- `seclevel`: the security level bitmask (default is `CLOUDKEY_SECLEVEL_NONE`, see below for details).\n- `expires`: the UNIX epoch expiration time (default is `time() + 7200` (2 hours from now)).\n- `secure`: `true` to get the https embed url (default is `false`).\n\nThe following arguments may be required if the `CLOUDKEY_SECLEVEL_DELEGATE` option is not specified in\nthe seclevel parameter, depending on the other options. This is not recommanded as it would probably\nlead to spurious access denials, mainly due to GeoIP databases discrepancies.\n\n- `asnum`: the client's autonomous system number (default is `None`).\n- `ip`: the client's IP adress (default is `None`).\n- `useragent`: the client's HTTP User-Agent header (default is `None`).\n\nExample:\n\n    // Create an embed URL limited only to the AS of the end-user and valid for 1 hour\n    $url = $cloudkey-\u003emedia-\u003eget_embed_url(array('id' =\u003e $media-\u003eid, 'seclevel' =\u003e CLOUDKEY_SECLEVEL_DELEGATE | CLOUDKEY_SECLEVEL_ASNUM, 'expires' =\u003e time() + 3600));\n\n`media.get_stream_url(id)`\n--------------------------\n\nThis method returns a signed URL to a Dailymotion Cloud video stream (see the API reference for details).\nThe generated URL is perishable, and access is granted based on the provided security level bitmask.\n\nArguments:\n\n- `id`: (required) the media id.\n- `asset_name`: the desired media asset asset_name name (default is `mp4_h264_aac`).\n- `seclevel`: the security level bitmask (default is `CLOUDKEY_SECLEVEL_NONE`, see below for details).\n- `expires`: the UNIX epoch expiration time (default is `time() + 7200` (2 hours from now)).\n- `download`: `True` to get the download url (default is `False`).\n- `filename`: the download url filename (overrides the `download` parameter if set).\n- `version`: arbitrary integer inserted in the url for the cache flush.\nUse this parameter only if needed, and change its value only when a cache flush is required.\n- `protocol`: streaming protocol ('hls', 'rtmp', 'hps' or 'http'). Overrides the `download` parameter if 'http'.\n\nThe following arguments may be required if the `CLOUDKEY_SECLEVEL_DELEGATE` option is not specified in\nthe seclevel parameter, depending on the other options. This is not recommanded as it would probably\nlead to spurious access denials, mainly due to GeoIP databases discrepancies.\n\n- `asnum`: the client's autonomous system number (default is `None`).\n- `ip`: the client's IP adress (default is `None`).\n- `useragent`: the client's HTTP User-Agent header (default is `None`).\n\nExample:\n\n    // Create a stream URL limited only to the AS of the end-user and valid for 1 hour\n    url = cloudkey.media.get_stream_url(id=media['id'], seclevel=CLOUDKEY_SECLEVEL_DELEGATE | CLOUDKEY_SECLEVEL_ASNUM, expires=time() + 3600)\n    $url = $cloudkey-\u003emedia-\u003eget_stream_url(array('id' =\u003e $media-\u003eid, 'seclevel' =\u003e CLOUDKEY_SECLEVEL_DELEGATE | CLOUDKEY_SECLEVEL_ASNUM, 'expires' =\u003e time() + 3600));\n\nSecurity level options\n======================\n\nThe security level defines the mechanism used by the Dailymotion Cloud architecture to ensure a mediastream\nURL access will be limited to a single user or a group of users. The different (combinable) options are:\n\n- `CLOUDKEY_SECLEVEL_NONE`: the URL access is granted to everyone.\n\n- `CLOUDKEY_SECLEVEL_ASNUM`: the URL access is granted to the specified AS number only. AS numbers stands for\n  'Autonomous System number' and roughly map groups of IP to telcos and large organizations on the Internet\n   (each ISP has its own AS number for instance, Dailyotion's AS number is AS41690).\n\n- `CLOUDKEY_SECLEVEL_IP`: the URL access is granted to the specified IP address only. This option may lead to\n   spurious access denials as some users are load-balanced behind multiple proxies when accessing the Internet\n   (this is mostly the case with ISPs and large organizations).\n\n- `CLOUDKEY_SECLEVEL_USERAGENT`: the URL access is granted to users sending the specified User-Agent HTTP header\n   only.\n\n- `CLOUDKEY_SECLEVEL_DELEGATE`: the ASNUM, IP and User-Agent values are to be gathered at the server side during\n  the first URL access and don't need to be specified at the client side beforehand (this is the recommanded approach\n  as it will ensure a 100%-accurate ASNUM recognition).\n\n- `CLOUDKEY_SECLEVEL_USEONCE`: the URL access is granted once only (using this option will probably prevent seeking\n   from working correctly).\n\nFor more information, please refer to the Dailymotion Cloud streams security documentation.\n\nExceptions\n==========\n\nThe Dailymotion Cloud API methods may throw exceptions when errors occur, and they should be catched in your\ncode. The available exceptions are:\n\n- `CloudKey_Exception`: an unexpected API response occured.\n\n- `CloudKey_ProtocolException`: a transport layer error occured.\n\n- `CloudKey_InvalidNamespaceException`: an invalid namespace was used.\n\n- `CloudKey_InvalidMethodException`: an invalid method was called.\n\n- `CloudKey_NotFoundException`: an action was requested on an invalid item.\n\n- `CloudKey_MissingParamException`: a mandatory parameter was missing from a method call.\n\n- `CloudKey_InvalidParamException`: an invalid parameter was specified in a method call.\n\n- `CloudKey_AuthorizationRequiredException`: an authenticated method was call but no authentication information was provided.\n\n- `CloudKey_AuthenticationFailedException`: invalid authentication information was provided.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdailymotion%2Fcloudkey-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdailymotion%2Fcloudkey-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdailymotion%2Fcloudkey-php/lists"}