Skip to content
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

Added syntax highlighting for code segments #73

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
Expand Up @@ -33,47 +33,47 @@ To get started using this API, follow the instructions below.

### Installing
Pip
```
```shell
pip install PyTikTokAPI
```

Install from source
```
```shell
git clone https://github.com/avilash/TikTokAPI-Python.git
python setup.py install
```

## Quick Start Guide
Import
```
```python
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`
```
```python
cookie = {
"s_v_web_id": "<your_key>",
"tt_webid": "<your_key>"
}
```
Get the most trending Videos on TikTok
```
```python
api = TikTokAPI(cookie=cookie)
retval = api.getTrending(count=5)
```
Get a user by name
```
```python
api = TikTokAPI(cookie=cookie)
user_obj = api.getUserByName("fcbarcelona")
```
Get videos of a user
```
```python
api = TikTokAPI(cookie=cookie)
user_videos = api.getVideosByUserName("fcbarcelona")
```
Get likes of a user
```
```python
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
```python
__init__(self, language='en', region='IN', cookie=None)
```

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

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

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

```buildoutcfg
```python
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
```python
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
```python
getLikesByUserName(self, user_name, count=30)
```

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

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

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

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

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

```buildoutcfg
```python
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
```python
getVideosByMusic(self, music_id, count=30)
```

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

```buildoutcfg
```python
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
```python
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
```python
downloadVideoByIdNoWatermark(self, video_id, save_path)
```

Expand Down