Skip to content

Update Python Codes of Readme #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Unofficial TikTok API Wrapper in Python

This is an unofficial TikTok Api python wrapper. I have an App using this API, and thus will constantly keep updating this wrapper
Expand Down Expand Up @@ -32,6 +31,7 @@ This implementation is inspired by [TikTokApi](https://github.com/davidteather/T
To get started using this API, follow the instructions below.

### Installing

Pip
```
pip install PyTikTokAPI
Expand All @@ -45,35 +45,35 @@ python setup.py install

## Quick Start Guide
Import
```
```py
from TikTokAPI import TikTokAPI
```
Get your keys from Cookie. You can get them from the Applications tab in Chrome developer console.
By default it used hardcoded values which may not work after some time.
The keys to extract are `s_v_web_id` and `tt_webid`
```
```py
cookie = {
"s_v_web_id": "<your_key>",
"tt_webid": "<your_key>"
}
```
Get the most trending Videos on TikTok
```
```py
api = TikTokAPI(cookie=cookie)
retval = api.getTrending(count=5)
```
Get a user by name
```
```py
api = TikTokAPI(cookie=cookie)
user_obj = api.getUserByName("fcbarcelona")
```
Get videos of a user
```
```py
api = TikTokAPI(cookie=cookie)
user_videos = api.getVideosByUserName("fcbarcelona")
```
Get likes of a user
```
```py
api = TikTokAPI(cookie=cookie)
user_videos = api.getLikesByUserName("fcbarcelona")
```
Expand All @@ -89,23 +89,23 @@ Inputs
* region - Self explanatory
* cookie - The TikTok Cookie containing the parameter <em>s_v_web_id</em>. If not provided, the parameter will be generated.

```buildoutcfg
```py
__init__(self, language='en', region='IN', cookie=None)
```

#### Get Trending Videos
Inputs
* count - Number of videos to fetch

```buildoutcfg
```py
getTrending(self, count=30)
```

#### Get User
Inputs
* user_name - Username, eg - <em>fcbarcelona</em>

```buildoutcfg
```py
getUserByName(self, user_name)
```

Expand All @@ -114,7 +114,7 @@ Inputs
* user_name - Username, eg - <em>fcbarcelona</em>
* count - Number of videos to fetch

```buildoutcfg
```py
getVideosByUserName(self, user_name, count=30)
```

Expand All @@ -123,15 +123,15 @@ Inputs
* user_name - Username, eg - <em>fcbarcelona</em>
* count - Number of videos to fetch

```buildoutcfg
```py
getLikesByUserName(self, user_name, count=30)
```

#### Get Hashtag
Inputs
* hashTag - HashTag, eg - <em>#fcbarcelona</em>

```buildoutcfg
```py
getHashTag(self, hashTag)
```

Expand All @@ -140,15 +140,15 @@ Inputs
* hashTag - HashTag, eg - <em>#fcbarcelona</em>
* count - Number of videos to fetch

```buildoutcfg
```py
getVideosByHashTag(self, hashTag, count=30)
```

#### Get Music
Inputs
* music_id - Music Id, eg - <em>6704854531001289474</em>

```buildoutcfg
```py
getMusic(self, music_id)
```

Expand All @@ -157,15 +157,15 @@ Inputs
* music_id - Music Id, eg - <em>6704854531001289474</em>
* count - Number of videos to fetch

```buildoutcfg
```py
getVideosByMusic(self, music_id, count=30)
```

#### Get Video By Id
Inputs
* video_id - Video Id, eg - <em>6843481669886954757</em>

```buildoutcfg
```py
getVideoById(self, video_id)
```

Expand All @@ -174,7 +174,7 @@ Inputs
* video_id - Video Id, eg - <em>6843481669886954757</em>
* save_path - Path where the downloaded video should be saved

```buildoutcfg
```py
downloadVideoById(self, video_id, save_path)
```

Expand All @@ -183,7 +183,7 @@ Inputs
* video_id - Video Id, eg - <em>6843481669886954757</em>
* save_path - Path where the downloaded video should be saved

```buildoutcfg
```py
downloadVideoByIdNoWatermark(self, video_id, save_path)
```

Expand All @@ -197,6 +197,6 @@ downloadVideoByIdNoWatermark(self, video_id, save_path)

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
This project is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details

[![Run on Repl.it](https://repl.it/badge/github/avilash/TikTokAPI-Python)](https://repl.it/github/avilash/TikTokAPI-Python)