Video.php 2.0 KB
<?php

namespace Lackoxygen\TiktokOpen\Wap\Video;

use Lackoxygen\TiktokOpen\Base\ServiceManager;

class Video extends ServiceManager
{
    public function videoList(string $openid, string $accessToken, int $cursor, int $count)
    {
        return $this->app['client']
            ->get(
                '/video/list/',
                [
                    'open_id' => $openid,
                    'access_token' => $accessToken,
                    'cursor' => $cursor,
                    'count' => $count,
                ]
            );
    }

    public function videoData(string $openid, string $accessToken)
    {
        return $this->app['client']->asJson()->post(
            '/video/data/',
            [
                'open_id' => $openid,
                'access_token' => $accessToken,
            ]
        );
    }

    public function shareId(bool $needCallback, string $sourceStyleId, string $defaultHashtag, string $linkParam)
    {
        return $this->app['client']->withSession()->get(
            '/share-id/',
            [
                'need_callback' => $needCallback,
                'source_style_id' => $sourceStyleId,
                'default_hashtag' => $defaultHashtag,
                'link_param' => $linkParam,
            ]
        );
    }

    public function poiSearchKeyword($accessToken, int $cursor, int $count, string $keyword, string $city)
    {
        return $this->app['client']->get(
            '/poi/search/keyword/',
            [
                'access_token' => $accessToken,
                'cursor' => $cursor,
                'count' => $count,
                'keyword' => $keyword,
                'city' => $city,
            ]
        );
    }

    public function videoSource(string $openid, string $accessToken)
    {
        return $this->app['client']->asJson()->post(
            '/video/source/',
            [
                'open_id' => $openid,
                'access_token' => $accessToken,
            ]
        );
    }

}