Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
汪标炎
qingrong-base-tool
Merge requests
!1
抖音上传
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
任世行
requested to merge
douyin_upload
into
master
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
1
0
0
Compare
master
master (base)
and
latest version
latest version
d4f04d32
1 commit,
1 year ago
1 file
+
60
−
2
Expand all files
Preferences
Preferences
File browser
List view
Tree view
Compare changes
Inline
Side-by-side
Show whitespace changes
Show one file at a time
src/ShortPlay/HuoshanShortPlay.php
+
60
−
2
Options
View file @ d4f04d32
Edit in single-file editor
Open in Web IDE
Show full file
@@ -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
Menu
Explore
Projects
Groups
Topics
Snippets