Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/walkingdevel/v-tiktok
A V library for downloading TikTok videos.
https://github.com/walkingdevel/v-tiktok
library tiktok video vlang
Last synced: 3 months ago
JSON representation
A V library for downloading TikTok videos.
- Host: GitHub
- URL: https://github.com/walkingdevel/v-tiktok
- Owner: walkingdevel
- Created: 2023-03-11T12:56:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-03-11T15:41:14.000Z (over 1 year ago)
- Last Synced: 2024-05-06T10:35:31.059Z (6 months ago)
- Topics: library, tiktok, video, vlang
- Language: V
- Homepage:
- Size: 2.93 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-v - v-tiktok - A V library for downloading TikTok videos. (Libraries / Web)
README
# V TikTok
A V library for downloading TikTok videos. Inspired by https://github.com/Sharqo78/VTik
## Install
```sh
v install https://github.com/walkingdevel/v-tiktok
```## API
```v
fn new_tiktok_video(url_or_video_id string) !TikTokVideo
struct TikTokVideo {
video_id string
mut:
video_file_url string
meta TikTokVideoMeta
is_fetched bool
}fn (mut t TikTokVideo) get_meta() !TikTokVideoMeta
fn (mut t TikTokVideo) download_file(output_file_path string) !
fn (mut t TikTokVideo) download_bytes() ![]u8
fn (mut t TikTokVideo) get_file_url() !stringstruct TikTokVideoMeta {
description string
cover_url string
region string
}```
## Example
```v
import v_tiktokfn main() {
mut video := v_tiktok.new_tiktok_video('7204144603975634222')!println(video.get_meta()!.description)
println(video.get_file_url()!)video.download_file('./output.mp4')!
}```