承接 libcast/authot-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

libcast/authot-client

Composer 安装命令:

composer require libcast/authot-client

包简介

Authot Client

README 文档

README

This package wraps Auhtôt API into a PHP client. Oauth2 implementation is provided.

Installation

To install, use composer:

composer require libcast/authot-client

Usage

<?php
// Http client
$httpClient = new \GuzzleHttp\Client([
    'base_uri' => 'https://app.xn--autht-9ta.com/'
]);

// Oauth2 provider
$provider = new \Libcast\OAuth2\Client\Provider\Authot([
    'clientId'          => '{authot-client-id}',
    'clientSecret'      => '{authot-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url',
]);

// Create the client
$client = (new \Libcast\Authot\Oauth2\ClientFactory($httpClient, $provider))
    ->create('{access_token}');

// Submit a transcription
$transcription = $client->createWithCallback('/path/to/audio/file.mp3', 'fr', 'https://example.com/transcription-callback-url');

// Fetch a transcription by its ID
$transcription = $client->find(42647);

echo $transcription->getId();
echo $transcription->getLang();
echo $transcription->getProgress();
echo $transcription->getStatus();
echo $transcription->getTitle();
echo $transcription->isFinished();

// Get User time left
$userTimeLeft = $client->getUserTimeLeft();
echo $userTimeLeft->getTimeLeftCorrection()->format('H:i:s');
echo $userTimeLeft->getTimeLeftTranscription()->format('H:i:s');

// Export a subtitle
$subtitle = $client->export(42647, 'srt'); // Available formats: txt, xml, sjson, srt, webvtt
file_put_contents('/path/to/output/file.srt', $subtitle);

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 21
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固