Metadata-Version: 2.4
Name: sychodl
Version: 1.2.3
Summary: Instagram & TikTok video downloader library - get direct video links and download reels/videos in your Python code
Author: SYCHO
License: MIT
Keywords: instagram,tiktok,downloader,reels,video
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0

# sychodl

A lightweight **Instagram & TikTok** video downloader **library**. Import it in your Python code and get direct video links or download videos with one function call.

```bash
pip install sychodl
```

## Quick Start

```python
from sychodl import download, get_video_info

# 1. Get Instagram video info (title + direct video URL)
info = get_video_info("https://www.instagram.com/reel/ABC123/")
print(info)
# {"status": "success", "result": {"title": "Some Video Title", "videoUrl": "https://..."}}

# 2. Download the video to a file
result = download("https://www.instagram.com/reel/ABC123/", output="my_video.mp4")
print(result)
# {"status": "success", "result": {"title": "...", "videoUrl": "...", "file": "my_video.mp4"}}
```

## Instagram

| Function | What it does |
|---|---|
| `get_video_info(url, timeout=15)` | Returns title + direct video URL (no download) |
| `download(url, output=None, timeout=15)` | Resolves the video and saves it to a file |

Invalid URLs return `{"status": "failed", "message": "Enter Valid Instagram URL"}`.

## TikTok

```python
from sychodl import download_tiktok, get_tiktok_info

# Get info (title, HD link, author, duration, cover)
info = get_tiktok_info("https://www.tiktok.com/@user/video/1234567890", hd=True)
print(info)
# {"status": "success", "result": {"title": "...", "videoUrl": "https://...", "author": "...", "duration": 19, "cover": "..."}}

# Download (hd=True for HD quality)
result = download_tiktok("https://vm.tiktok.com/XXXXX/", output="tiktok_video.mp4", hd=True)
print(result)
# {"status": "success", "result": {"title": "...", "videoUrl": "...", "file": "tiktok_video.mp4"}}
```

Short links (`vm.tiktok.com`, `vt.tiktok.com`) and full video URLs are both supported. Works for **videos** and **photos**. Invalid URLs return `{"status": "failed", "message": "Enter Valid TikTok URL"}`.

## Response Format

Success:

```json
{
  "status": "success",
  "result": {
    "title": "Video Title",
    "videoUrl": "https://scontent.cdninstagram.com/..."
  }
}
```

Failure:

```json
{"status": "failed", "message": "Video link Not Found."}
```

## Notes

- Instagram: works with **post** and **reel** URLs. No Instagram login or API key required.
- TikTok: powered by the [tikwm.com](https://tikwm.com) public API.
- All responses are JSON-style dicts, so they drop straight into Flask/FastAPI endpoints.
