diff --git a/src/ShortPlay/HuoshanShortPlay.php b/src/ShortPlay/HuoshanShortPlay.php index 29f3b835318597713ba7c3985ee31385c47200ef..e1a5975dac0153a9f8cece6281c7633c0b28712d 100644 --- a/src/ShortPlay/HuoshanShortPlay.php +++ b/src/ShortPlay/HuoshanShortPlay.php @@ -2,18 +2,76 @@ namespace QingrongBase\Tool\ShortPlay; +use QingrongBase\Tool\BaseTool; use QingrongBase\Tool\Bean\ShortPlay\PullUploadParamBean; class HuoshanShortPlay implements ShortPlayInterface { + private $options; + + public function __construct($accessToken) + { + $this->options = [ + 'header' => [ 'access-token' => $accessToken ] + ]; + } + + /** + * 上传视频 + * @author rsx + * @date 2023-06-27 10:43 + */ public function pullUpload(PullUploadParamBean $pullUploadParamBean) { - // TODO: Implement pullUpload() method. + $url = 'https://open.douyin.com/api/playlet/v1/video/upload'; + $this->options['query'] = [ + 'video_url' => $pullUploadParamBean->getVideoUrl(), + 'video_format' => $pullUploadParamBean->getVideoFormat() + ]; + return BaseTool::postCurl($url, $this->options, true); } + /** + * 查询视频上传状态 + * @author rsx + * @date 2023-06-27 10:44 + */ public function getUploadStatus($taskId, $accessToken) { - // TODO: Implement getUploadStatus() method. + $url = "https://open.douyin.com/api/playlet/v1/video/get_upload_status"; + $this->options['query'] = [ + 'request_id' => $taskId, + ]; + return BaseTool::postCurl($url, $this->options, true); + } + + /** + * 图片上传 + * @author rsx + * @date 2023-06-27 10:44 + */ + public function imgUpload($picUrl) + { + $url = "https://open.douyin.com/api/playlet/v1/pic/upload"; + $this->options['query'] = [ + 'pic_url' => $picUrl, + ]; + return BaseTool::postCurl($url, $this->options, true); + } + + /** + * 查询审核模板 + * @author rsx + * @date 2023-06-27 10:44 + */ + public function productTemplateQuery($picUrl) + { + $url = "https://open.douyin.com/api/product/v1/product_template_query"; + $this->options['query'] = [ + 'biz_line' => 4, + 'product_type' => 3, + ]; + return BaseTool::postCurl($url, $this->options, true); } } \ No newline at end of file