Skip to content

tbdsux/kuryana

Repository files navigation

kuryana

A simple MyDramaList.com scraper api.

This scrapes on the go so it might be slow.

THIS SERVICE IS ONLY CREATED TO SATISFY THE NEED FOR AN API FOR [MYDRAMALIST.COM](https://mydramalist.com). THIS WILL BE STOPPED ONCE AN OFFICIAL API WILL BE RELEASED.

Deployment

Self Hosted - Docker

# run
docker compose up -d --build

# take down
docker compose down

dokploy.docker-compose.yml

docker compose -f ./dokploy.docker-compose.yml up -d

Make sure to set deploy/vercel as the branch.

Note

Deployed vercel project will still continue to live.

API Use

  • Search for dramas
GET /search/q/{yourquery}
  • Get DRAMA Info
GET /id/{mydramalist-slug}
  • Get DRAMA Cast
GET /id/{mydramalist-slug}/cast
  • Get DRAMA Episodes
GET /id/{mydramalist-slug}/episodes
  • Get DRAMA Reviews
GET /id/{mydramalist-slug}/reviews
  • Get Person(People) Info
GET /people/{people-id}
  • Get seasonal drama
GET /seasonal/{year}/{quarter}
  • Get Lists
GET /list/{id}
  • Get User Dramalist
GET /dramalist/{user_id}

API Endpoints to use

  • Primary (Self-Hosted)

    https://kuryana.tbdh.app
    
  • Vercel deployment (deploy/vercel branch)

    https://kuryana.vercel.app
    

    Has quirks like requests failing for first time then succeeding.

    Please start to transition on using the primary deployed endpoint for your projects, thank you.

Error Messages

// mainly on all endpoints except `search`
// sample: /list/unknown-random-id
{
  "code": 400,
  "error": true,
  "description": {
    "title": "This list is private.",
    "info": "You can see this page because the URL you are accessing cannot be found."
  }
}
// could also be this (only on `/search`) endpoint
{
  "error": true,
  "code": 404,
  "description": "404 Not Found"
}

API Wrappers

A JS/TS and Python api wrappers are currently available. Learn More...

JS/TS

import { Kuryana } from "@tbdhdev/kuryana-ts";

async function main() {
  const kuryana = new Kuryana();
  // const kuryana = new Kuryana("https://custom-endpoint.net");

  const res = await kuryana.search("goblin");

  if (!res.success) {
    console.error("Search failed:", res.error);
    return;
  }

  // log results
  for (const item of res.result.results.dramas) {
    console.log("Drama:", item.title);
    console.log("Year:", item.year);
    console.log("-----\n");
  }
}

main();

Python

from kuryana import Kuryana

client = Kuryana()


if __name__ == "__main__":
    response = client.get()
    print(response.message)

    assert "MDL Scraper API" in response.message

    print("\n\n")

    search = client.search("goblin")
    for drama in search.results.dramas:
        print(f"{drama.title} - {drama.year}")

Development

  • Minimum Python Version : 3.12,

  • Make sure uv is installed in your machine, more details

  • Sync project dependencies

    uv sync

Dev Server

Start development server.

uv run fastapi dev

FastAPI CLI

Others

Note

All Requests and SCRAPED Datas are not cached by the API Endpoints.

© tbdsux

Contributors 7