Skip to content

Commit

Permalink
Merge pull request #27 from davidteather/nightly
Browse files Browse the repository at this point in the history
V2.2
  • Loading branch information
davidteather authored Nov 17, 2019
2 parents 5ae58b2 + 2810e65 commit ec46070
Show file tree
Hide file tree
Showing 12 changed files with 176 additions and 296 deletions.
36 changes: 22 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

This is an unoffical api wrapper for tiktok.com in python. With this api you are able to call most trending and fetch specific user information.

[![GitHub release (latest by date)](https://img.shields.io/github/v/release/davidteather/TikTok-Api)](https://github.com/davidteather/TikTok-Api/releases) [![Build Status](https://travis-ci.com/davidteather/TikTok-Api.svg?branch=master)](https://travis-ci.com/davidteather/TikTok-Api) [![GitHub](https://img.shields.io/github/license/davidteather/TikTok-Api)](https://github.com/davidteather/TikTok-Api/blob/master/LICENSE) [![PyPI - Downloads](https://img.shields.io/pypi/dm/TikTokApi)](https://pypi.org/project/TikTokApi/)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/davidteather/TikTok-Api)](https://github.com/davidteather/TikTok-Api/releases) [![Build Status](https://travis-ci.com/davidteather/TikTok-Api.svg?branch=master)](https://travis-ci.com/davidteather/TikTok-Api) [![GitHub](https://img.shields.io/github/license/davidteather/TikTok-Api)](https://github.com/davidteather/TikTok-Api/blob/master/LICENSE)
[![Downloads](https://pepy.tech/badge/tiktokapi)](https://pypi.org/project/TikTokApi/)

## Important Information
* If this API stops working for any reason open an issue.
Expand Down Expand Up @@ -68,24 +69,21 @@ headless - True/False - True means it will run a headless chrome browser, could
api.trending(count, verbose)
```

Trending returns an array of json objects. Example structure [here](https://gist.github.com/davidteather/0be2e495e2de54098e8f2a9594581d27)

JSON object tree [here](https://gist.github.com/davidteather/bc4baef0edb621dd322c8ad128a31ac1)
Trending returns an array of json objects. Example structure [here](https://gist.github.com/davidteather/1844d21d07f290be91fd9e56e41f925e)

##### The userPosts Method

```
# Where count is how many results you want
# Verbose is optional, default=0. Set it to 1 to get more information
# userid is the tiktok userid, can be found through response json tree or in the tiktok url
api.userPosts(userid, count, verbose)
api.userPosts(username, count, verbose)
```

Since this isn't an offical TikTok API the TikTok servers don't know what to do. This method specifically will throw a lot of errors if you have verbose on. It takes a lot longer than trending, however it will still end up working. Just give it a few minutes.
username - the username of the user

count - the amount you want

Trending returns an array of json objects. Example structure [here](https://gist.github.com/davidteather/a5c1e54de353353f77a78139d2e5a9f9)
verbose - 0/1 if you want it to display things

It has the same JSON object tree as trending. It's [here](https://gist.github.com/davidteather/bc4baef0edb621dd322c8ad128a31ac1) anyways.
Trending returns an array of json objects. Example structure [here](https://gist.github.com/davidteather/1844d21d07f290be91fd9e56e41f925e)

##### The search_by_hashtag Method

Expand All @@ -99,9 +97,19 @@ count - The number of results you want

Since this isn't an offical TikTok API the TikTok servers don't know what to do with my bad solutions, this takes a bit longer as it needs to find the hashtagID and stuff.

Search by hashtag returns an array of json objects. Example structure [here](https://gist.github.com/davidteather/a5c1e54de353353f77a78139d2e5a9f9)
Search by hashtag returns an array of json objects. Example structure [here](https://gist.github.com/davidteather/1844d21d07f290be91fd9e56e41f925e)


##### The get_song Method

```
api.get_song(url)
```

url - The url of the TikTok, can be found via trending.

This returns a dictionary. Example structure [here](https://gist.github.com/davidteather/777befde18641f44d90fbf008082ec02)

It has the same JSON object tree as trending. It's [here](https://gist.github.com/davidteather/bc4baef0edb621dd322c8ad128a31ac1) anyways.

##### The get_Video_By_Url Method

Expand All @@ -113,7 +121,7 @@ video_url - The video you want to get url.

return_bytes - The default value is 0, when it is set to 1 the function instead returns the bytes from the video rather than just the direct url.

##### The get_trending_hashtags Method
##### The get_trending_hashtags Method ( not working as of now )

```
api.get_trending_hashtags()
Expand Down
Binary file modified TikTokApi/__pycache__/tiktok.cpython-37.pyc
Binary file not shown.
Loading

0 comments on commit ec46070

Please sign in to comment.