sheldygg / aiotiktok

TikTok Api
MIT License
33 stars 8 forks source link

expanding code by openapi.json #8

Closed wweevv-johndpope closed 1 year ago

wweevv-johndpope commented 1 year ago

I used some sample code by chatgpt to scaffold these calls

Screenshot 2023-06-01 at 12 26 21 pm

may not be so helpful - but if the calls are all matched up - would be a good feature set. Have to do some manually mapping - (people could contribute via PR) eg. for number 1) /public/followers -> /aweme/v1/user/follower/list/ https://github.com/kingking888/app-crawler/blob/5a8211671efc86d01f72c9bfdb4543aff135c5d7/app/event.py#L16


        'login': (url_api, 'passport/user/login/'),
        'user_info': (url_api16, '/aweme/v1/user/'),

        'search_human': (url_api16, '/aweme/v1/discover/search/'),
        'search_ht':  (url_api16, '/aweme/v1/challenge/search/'),

        'followers_list':  (url_api, 'aweme/v1/user/follower/list/'),
        'followings_list':  (url_api16, 'aweme/v1/user/following/list/'),

        'like':  (url_api16, '/aweme/v1/commit/item/digg/'),

        'follow': (url_api16, '/aweme/v1/commit/follow/user/'),
        'posts': (url_api16, '/aweme/v1/aweme/post/'),

        'comments_list':  (url_api16, '/aweme/v1/comment/list')

UPDATE

private static final ArrayList<String> f68802f = n.d("/service/1/update_token/", "/aweme/v1/aweme/detail/", "/aweme/v1/user/", "/aweme/v1/abtest/param/", "/aweme/v1/commerce/settings", "/aweme/v1/feed/", "/aweme/v1/settings/", "/aweme/v1/story/", "/aweme/v1/user/settings/", "/aweme/v1/im/cloud/token/", "/aweme/v1/upload/contacts/", "/aweme/v1/aweme/post/", "/aweme/v1/user/", "/aweme/v1/commit/follow/user/", "/aweme/v1/multi/aweme/detail/", "/aweme/v1/comment/publish/", "/aweme/v1/general/search/", "/passport/user/logout/", "/aweme/v1/commit/item/digg/", "/user/mobile/reset_password/", "/passport/auth/login/", "/aweme/v1/create/aweme/", "/aweme/v1/recommend/user/", "/aweme/v2/comment/list/", "/passport/mobile/login/", "/aweme/v1/user/follower/list/", "/aweme/v1/notice/count/", "/aweme/v1/friend/feed/", "/aweme/v1/aweme/stats/", "/aweme/v1/hot/search/list/", "/aweme/v1/recommend/challenge/");


class MyAPIClient(OpenAPIClient):
    async def public.check(self, **kwargs):
    url = self.build_url("/public/check")
    return await self.request("get", url, **kwargs)

async def public.followersList(self, **kwargs):
    url = self.build_url("/public/followers")
    return await self.request("get", url, **kwargs)

async def public.posts(self, **kwargs):
    url = self.build_url("/public/posts")
    return await self.request("get", url, **kwargs)

async def public.likes(self, **kwargs):
    url = self.build_url("/public/likes")
    return await self.request("get", url, **kwargs)

async def public.followingList(self, **kwargs):
    url = self.build_url("/public/following")
    return await self.request("get", url, **kwargs)

async def public.explore(self, **kwargs):
    url = self.build_url("/public/explore")
    return await self.request("get", url, **kwargs)

async def public.video(self, **kwargs):
    url = self.build_url("/public/video")
    return await self.request("get", url, **kwargs)

async def public.hashtag(self, **kwargs):
    url = self.build_url("/public/hashtag")
    return await self.request("get", url, **kwargs)

async def public.music(self, **kwargs):
    url = self.build_url("/public/music")
    return await self.request("get", url, **kwargs)

async def public.musicInfo(self, **kwargs):
    url = self.build_url("/public/music/info")
    return await self.request("get", url, **kwargs)

async def public.discover(self, **kwargs):
    url = self.build_url("/public/discover/{category}")
    return await self.request("get", url, **kwargs)

async def public.discoverKeyword(self, **kwargs):
    url = self.build_url("/public/discover/keyword")
    return await self.request("get", url, **kwargs)

async def public.search(self, **kwargs):
    url = self.build_url("/public/search/{category}")
    return await self.request("get", url, **kwargs)

async def user.info(self, **kwargs):
    url = self.build_url("/user/info")
    return await self.request("get", url, **kwargs)

async def user.edit(self, **kwargs):
    url = self.build_url("/user/edit/{field}")
    return await self.request("post", url, **kwargs)

async def user.notifications(self, **kwargs):
    url = self.build_url("/user/notifications")
    return await self.request("get", url, **kwargs)

async def user.analytics(self, **kwargs):
    url = self.build_url("/creator/analytics/{type}")
    return await self.request("get", url, **kwargs)

async def user.verify(self, **kwargs):
    url = self.build_url("/user/session/check")
    return await self.request("get", url, **kwargs)

async def user.following(self, **kwargs):
    url = self.build_url("/user/following")
    return await self.request("get", url, **kwargs)

async def user.follow(self, **kwargs):
    url = self.build_url("/user/follow")
    return await self.request("post", url, **kwargs)

async def user.unfollow(self, **kwargs):
    url = self.build_url("/user/unfollow")
    return await self.request("post", url, **kwargs)

async def user.posts.feed(self, **kwargs):
    url = self.build_url("/user/feed")
    return await self.request("get", url, **kwargs)

async def user.posts.likes(self, **kwargs):
    url = self.build_url("/user/likes")
    return await self.request("get", url, **kwargs)

async def user.posts.explore(self, **kwargs):
    url = self.build_url("/user/explore")
    return await self.request("get", url, **kwargs)

async def user.posts.video(self, **kwargs):
    url = self.build_url("/user/video")
    return await self.request("get", url, **kwargs)

async def user.posts.like(self, **kwargs):
    url = self.build_url("/user/like")
    return await self.request("post", url, **kwargs)

async def user.posts.unlike(self, **kwargs):
    url = self.build_url("/user/unlike")
    return await self.request("post", url, **kwargs)

async def user.posts.comments.list(self, **kwargs):
    url = self.build_url("/comment/list")
    return await self.request("get", url, **kwargs)

async def user.posts.comments.replies(self, **kwargs):
    url = self.build_url("/comment/reply/list")
    return await self.request("get", url, **kwargs)

async def user.posts.comments.post(self, **kwargs):
    url = self.build_url("/user/comment")
    return await self.request("post", url, **kwargs)

async def user.posts.comments.like(self, **kwargs):
    url = self.build_url("/user/comment/like")
    return await self.request("post", url, **kwargs)

async def user.posts.comments.unlike(self, **kwargs):
    url = self.build_url("/user/comment/unlike")
    return await self.request("post", url, **kwargs)

async def user.posts.comments.delete(self, **kwargs):
    url = self.build_url("/user/comment/delete")
    return await self.request("post", url, **kwargs)

async def user.conversations(self, **kwargs):
    url = self.build_url("/user/conversations")
    return await self.request("get", url, **kwargs)

async def user.messages(self, **kwargs):
    url = self.build_url("/user/messages")
    return await self.request("get", url, **kwargs)

async def user.sendMessage(self, **kwargs):
    url = self.build_url("/user/message/send")
    return await self.request("post", url, **kwargs)

async def user.live.permissions(self, **kwargs):
    url = self.build_url("/user/live/info")
    return await self.request("get", url, **kwargs)

async def user.live.start(self, **kwargs):
    url = self.build_url("/user/live/start")
    return await self.request("post", url, **kwargs)

async def user.live.stop(self, **kwargs):
    url = self.build_url("/user/live/stop")
    return await self.request("post", url, **kwargs)

async def user.live.info(self, **kwargs):
    url = self.build_url("/user/live/check")
    return await self.request("get", url, **kwargs)

async def user.live.recommend(self, **kwargs):
    url = self.build_url("/user/live/recommend")
    return await self.request("get", url, **kwargs)

async def user.live.stats(self, **kwargs):
    url = self.build_url("/user/live/stats")
    return await self.request("get", url, **kwargs)

async def user.live.chat(self, **kwargs):
    url = self.build_url("/user/live/chat")
    return await self.request("get", url, **kwargs)

async def user.live.sendChat(self, **kwargs):
    url = self.build_url("/user/live/chat/send")
    return await self.request("post", url, **kwargs)

async def user.live.topics(self, **kwargs):
    url = self.build_url("/user/live/topics")
    return await self.request("get", url, **kwargs)

async def user.live.transactionHistory(self, **kwargs):
    url = self.build_url("/user/wallet/transactions")
    return await self.request("get", url, **kwargs)

async def key(self, **kwargs):
    url = self.build_url("/key/info")
    return await self.request("get", url, **kwargs)

https://gist.github.com/wweevv-johndpope/04ab609277ecffb4335de719acbba0ac

wweevv-johndpope commented 1 year ago

fyi - https://github.com/pablouser1/SignTok/tree/b7c46979f104dc8aee8feafce7708a68bf3d03fc

sheldygg commented 1 year ago

I don't really understand why use someone's private api? the point is to make a request to tiktok yourself and receive data directly

sheldygg commented 1 year ago

fyi - https://github.com/pablouser1/SignTok/tree/b7c46979f104dc8aee8feafce7708a68bf3d03fc

i already create signature service https://github.com/sheldygg/tiktok-signature

wweevv-johndpope commented 1 year ago

fyi - I found this US Api - https://gist.github.com/wweevv-johndpope/083043b2fd2b6f77e7be4239726fa597