API untuk mengakses konten ReelShort - Platform Nonton Drama China. API ini menyediakan endpoint untuk mencari drama, mendapatkan daftar episode, mengambil URL video, dan mengakses bookshelf kategori.
- π Search Drama - Cari drama berdasarkan kata kunci
- π List Episodes - Dapatkan daftar episode dari drama
- π¬ Get Video URL - Ambil URL video langsung ke episode
- π Bookshelf Categories - Akses drama berdasarkan kategori (Dub, New Release, Recommended)
- π Swagger UI - Dokumentasi API interaktif
- π Auto Next Episode - Dapatkan info episode berikutnya otomatis
# Clone repository
git clone https://github.com/username/reelshort-api.git
cd reelshort-api
# Install dependencies
pip install flask flask-restx requests
# Jalankan server
python reelshort.pyServer akan berjalan di http://localhost:5000
Akses Swagger UI: http://localhost:5000/docs
API ini menggunakan 3 step berurutan:
GET /api/v1/reelshort/search?keywords=loveResponse:
{
"results": [
{
"book_id": "65a1b2c3d4e5f6g7h8i9j0k1",
"book_title": "Love Story Drama",
"filtered_title": "love-story-drama",
"book_pic": "https://...",
"chapter_count": 50
}
]
}Simpan
book_iddanfiltered_titleuntuk step 2
GET /api/v1/reelshort/episodes/{book_id}?filtered_title=love-story-dramaResponse:
{
"episodes": [
{
"episode": 1,
"chapter_id": "chapter_001"
},
{
"episode": 2,
"chapter_id": "chapter_002"
}
]
}Simpan
episodedanchapter_iduntuk step 3
GET /api/v1/reelshort/video/{book_id}/{episode_num}?filtered_title=love-story-drama&chapter_id=chapter_001Response:
{
"video_url": "https://cdn.reelshort.com/video.m3u8",
"episode": 1,
"duration": 120,
"next_episode": {
"episode": 2,
"chapter_id": "chapter_002"
}
}Convert Dulu dari .m3u8 jadi .mp4
Endpoint untuk mengakses drama berdasarkan kategori. Setiap buku sudah include filtered_title dan book_id yang bisa langsung digunakan untuk Step 2 dan Step 3.
GET /api/v1/reelshort/dramadubResponse:
{
"bookshelf_name": "Drama dengan Dubπ§",
"books": [
{
"book_title": "Drama Title",
"filtered_title": "drama-title",
"book_pic": "https://...",
"special_desc": "Description",
"chapter_count": 50,
"book_id": "65a1b2c3d4e5f6g7h8i9j0k1",
"chapter_base": [
{
"chapter_id": "chapter_001",
"chapter_name": "Episode 1",
"like_count": 1000,
"publish_at": "2024-01-01",
"create_time": "2024-01-01"
}
]
}
]
}GET /api/v1/reelshort/newreleaseResponse: Sama format dengan /dramadub
GET /api/v1/reelshort/recommendResponse: Sama format dengan /dramadub
# 1. Ambil daftar drama dari bookshelf
curl "http://localhost:5000/api/v1/reelshort/dramadub"
# 2. Gunakan book_id dan filtered_title langsung ke /episodes
curl "http://localhost:5000/api/v1/reelshort/episodes/BOOK_ID?filtered_title=FILTERED_TITLE"
# 3. Get video URL
curl "http://localhost:5000/api/v1/reelshort/video/BOOK_ID/1?filtered_title=FILTERED_TITLE&chapter_id=CHAPTER_ID"| Method | Endpoint | Deskripsi |
|---|---|---|
| GET | /api/v1/reelshort/search |
Cari drama |
| GET | /api/v1/reelshort/episodes/{book_id} |
Dapatkan daftar episode |
| GET | /api/v1/reelshort/video/{book_id}/{episode_num} |
Dapatkan URL video |
| GET | /api/v1/reelshort/dramadub |
Drama dengan dubbing |
| GET | /api/v1/reelshort/newrelease |
Rilis terbaru |
| GET | /api/v1/reelshort/recommend |
Lebih direkomendasikan |
| Parameter | Type | Required | Deskripsi |
|---|---|---|---|
| keywords | string | Yes | Kata kunci pencarian |
| Parameter | Type | Required | Deskripsi |
|---|---|---|---|
| book_id | path | Yes | ID dari hasil search atau bookshelf |
| filtered_title | query | Yes | Slug dari hasil search atau bookshelf |
| Parameter | Type | Required | Deskripsi |
|---|---|---|---|
| book_id | path | Yes | ID dari hasil search atau bookshelf |
| episode_num | path | Yes | Nomor episode |
| filtered_title | query | Yes | Slug dari hasil search atau bookshelf |
| chapter_id | query | Yes | ID chapter dari episodes |
| Parameter | Type | Required | Deskripsi |
|---|---|---|---|
| - | - | - | Tidak memerlukan parameter |
# Step 1: Search
curl "http://localhost:5000/api/v1/reelshort/search?keywords=love"
# Step 2: Get Episodes (ganti BOOK_ID dan FILTERED_TITLE)
curl "http://localhost:5000/api/v1/reelshort/episodes/BOOK_ID?filtered_title=FILTERED_TITLE"
# Step 3: Get Video (ganti parameter sesuai hasil sebelumnya)
curl "http://localhost:5000/api/v1/reelshort/video/BOOK_ID/1?filtered_title=FILTERED_TITLE&chapter_id=CHAPTER_ID"
# Atau gunakan Bookshelf (lebih mudah - sudah ada book_id dan filtered_title)
curl "http://localhost:5000/api/v1/reelshort/dramadub"import requests
BASE_URL = "http://localhost:5000/api/v1/reelshort"
# === METODE 1: VIA SEARCH ===
# Step 1: Search
search_resp = requests.get(f"{BASE_URL}/search", params={"keywords": "love"})
book = search_resp.json()["results"][0]
book_id = book["book_id"]
filtered_title = book["filtered_title"]
# Step 2: Get Episodes
episodes_resp = requests.get(
f"{BASE_URL}/episodes/{book_id}",
params={"filtered_title": filtered_title}
)
episodes = episodes_resp.json()["episodes"]
# Step 3: Get Video URL
video_resp = requests.get(
f"{BASE_URL}/video/{book_id}/{episodes[0]['episode']}",
params={
"filtered_title": filtered_title,
"chapter_id": episodes[0]["chapter_id"]
}
)
video_url = video_resp.json()["video_url"]
print(f"Video URL: {video_url}")
# === METODE 2: VIA BOOKSHELF (Lebih Mudah) ===
# Ambil dari bookshelf, langsung dapat book_id dan filtered_title
shelf_resp = requests.get(f"{BASE_URL}/dramadub")
book = shelf_resp.json()["books"][0]
book_id = book["book_id"] # Langsung ada
filtered_title = book["filtered_title"] # Langsung ada
chapter_id = book["chapter_base"][0]["chapter_id"] # Dari chapter_base
# Langsung ke Step 2 atau Step 3
video_resp = requests.get(
f"{BASE_URL}/video/{book_id}/1",
params={
"filtered_title": filtered_title,
"chapter_id": chapter_id
}
)
print(f"Video URL: {video_resp.json()['video_url']}")| Code | Deskripsi |
|---|---|
| 200 | Success |
| 400 | Bad Request - Parameter tidak lengkap |
| 404 | Not Found - Video atau bookshelf tidak ditemukan |
| 500 | Server Error |
.
βββ reelshort.py # Main API file
βββ README.md # Dokumentasi ini
βββ requirements.txt # Dependencies
- Flask
- Flask-RESTX
- Requests
Install semua:
pip install flask flask-restx requests- Bookshelf Data: Endpoint
/dramadub,/newrelease, dan/recommendmengembalikan FULL RESPONSE DARI REELSHORT - Book ID: Di bookshelf,
book_iddiperoleh otomatis dari hasil internal search menggunakanfiltered_title - Rate Limiting: Jika menggunakan bookshelf, API melakukan multiple search requests di background. Hindari pemanggilan berlebihan.
- Video Format: URL video berformat
.m3u8(HLS streaming), perlu dikonversi ke.mp4jika ingin download
MIT License
Dibuat dengan β€οΈ untuk komunitas