Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/krypton-byte/tiktok-downloader

Tiktok Downloader/Scraper using requests & bs4
https://github.com/krypton-byte/tiktok-downloader

asynchronous asyncio beautifulsoup bs4 crawler downloader flask krypton-byte lightweight nowm python python3 requests tiktok watermark web without

Last synced: about 1 month ago
JSON representation

Tiktok Downloader/Scraper using requests & bs4

Awesome Lists containing this project

README

        






[![Unittest](https://github.com/krypton-byte/tiktok-downloader/actions/workflows/unittest.yml/badge.svg)](https://github.com/krypton-byte/tiktok-downloader/actions/workflows/unittest.yml)
[![Upload to PyPi](https://github.com/krypton-byte/tiktok-downloader/actions/workflows/python-publish.yml/badge.svg?branch=0.1.7&event=release)](https://github.com/krypton-byte/tiktok-downloader/actions/workflows/python-publish.yml)
[![Downloads](https://static.pepy.tech/personalized-badge/tiktok-downloader?period=total&units=none&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/tiktok-downloader)
[![viitor](https://visitor-badge.glitch.me/badge?page_id=krypton-byte.tiktok-downloader)]()

# install

```bash
> python3 -m pip install tiktok_downloader
> python3 -m pip install git+https://github.com/krypton-byte/tiktok-downloader
```

# Library

Tikmate

```python
>>> from tiktok_downloader import Tikmate
>>> d=Tikmate("url")
[<[type: "video" watermark: False]>, <[type: "video" watermark: False]>]
>>> d[0].download('video.mp4')
```

Snaptik

```python
>>> from tiktok_downloader import snaptik
>>> d=snaptik('https://vt.tiktok.com/xxxxxx/')
>>> d
[<[type: "video" watermark: False]>]
>>> d[0].download('video.mp4')
```

Musically Down

```python
>>> from tiktok_downloader import mdown
>>> d=mdown('https://vt.tiktok.com/xxxxxx/')
>>> d
[<[type: "video" watermark: False]>]
>>> d[0].download('video.mp4')
```

Tikdown

```python
>>> from tiktok_downloader import tikdown
>>> d=tikdown('https://vt.tiktok.com/xxxxxx/')
>>> d
[<[type: "video" watermark: False]>]
>>> d[0].download('video.mp4')
```

TTDownloader

```python
>>> from tiktok_downloader import ttdownloader
>>> d=ttdownloader('https://vt.tiktok.com/xxxxxx/')
>>> d
[<[type: "video" watermark: False]>]
>>> d[0].download('video.mp4')
```

Tikwm

```python
>>> from tiktok_downloader import tikwm
>>> d=tikwm('https://vt.tiktok.com/xxxxxx/')
>>> d
[<[type: "video" watermark: False]>]
>>> d[0].download('video.mp4')
```

Tiktok

```python
>>> from tiktok_downloader import VideoInfo
>>> d=VideoInfo.service('https://vt.tiktok.com/xxxxxx/')
>>> d
[<[type: "video" watermark: False]>]
>>> d[0].download('video.mp4')
```

Get Info

```python
>>> from tiktok_downloader import VideoInfo
>>> VideoInfo.get_info('https://vt.tiktok.com/xxxxxx/')
```

# Command line

```
usage: python3 -m tiktok_downloader [-h] [--snaptik | --ssstik | --tikmate | --mdown | --ttdownloader | --tikwm | --tikdown | --tiktok] [--host HOST] [--debug] [--port PORT] (--server | --url URL) [--info] [--json | --save SAVE]

Tiktok Downloader [CLI]

options:
-h, --help show this help message and exit

List Of Services:
--snaptik
--ssstik
--tikmate
--mdown
--ttdownloader
--tikdown
--tikwm
--tiktok

Web Configuration:
--host HOST Set host to run this web
--debug Set flask mode to debug
--port PORT Set port

Mode:
--server Run as web application
--url URL Video URL

Optional:
--info Print info video like author, id & etc

Output Type:
--json Print result to json format
--save SAVE Write the result to file
```
## Example CLI

Download

```bash
$ python3 -m tiktok_downloader --url https://vt.tiktok.com/lorem --snaptik --save tiktok.mp4
```

Json

```bash
$ python3 -m tiktok_downloader --url https://vt.tiktok.com/lorem --snaptik --json
```

Run as web

```bash
$ python3 -m tiktok_downloader --host=0.0.0.0 --port=8000 --server
* Serving Flask app 'tiktok_downloader.server' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```

## Deploy Heroku
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/krypton-byte/tiktok-downloader/tree/master)
## Preview

## Request API using curl & wget

```bash
$ wget -O result.mp4 $(curl -sG http://127.0.0.1:8000/snaptik -d url=https://vm.tiktok.com/xxxxxxxx/|jq .[0].url -r)
```
## you can direct Download using browser or curl
```
http://127.0.0.1:8000/snaptik?url=https://vm.tiktok.com/xxxxxxxx/&type=embed
```
### Endpoint
| Name | Endpoint | Status|
|------------------------------------------------------|---------------|--------|
| Snaptik | /snaptik | ✓
| Tikmate | /tikmate |✓
| MusicalDown | /mdown |✓
|
ssstik | /ssstik | ✓
| ttdownloader | /ttdownloader | ✓
| tikwm | /tikwm | ✓
| tikdown | /tikdown | x
| tiktok | /tiktok | ✓
# Donasi