Skip to content

sullyh7/aetoons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

aetoons

API Documentation

This documentation provides details about the REST API endpoints for the AeToons application. This application allows users to manage shows and episodes while integrating with Vimeo and the MyAnimeList (MAL) API for extended functionality.

Endpoints

1. Test Endpoint

  • URL: /
  • Method: GET
  • Description: Simple test endpoint to verify the API is running.
  • Response:
    {
      "test": "success"
    }

2. Fetch All Shows

  • URL: /shows
  • Method: GET
  • Description: Retrieves all shows stored in the database.
  • Response:
    • Status Code: 200 OK
    • Body:
      [
        {
          "id": 1,
          "title": "One Piece",
          "main_picture": {
            "medium": "https://cdn.myanimelist.net/images/anime/1244/138851.jpg",
            "large": "https://cdn.myanimelist.net/images/anime/1244/138851l.jpg"
          },
          "episodes": [
            {
              "id": 1,
              "title": "Episode 1",
              "episode_number": 1,
              "video_url": "video-url"
            }
          ]
        }
      ]

3. Add a Show

  • URL: /add-show
  • Method: POST
  • Description: Adds a new show to the database using data from the MAL API.
  • Request Body (JSON):
    {
      "mal_id": 21
    }
  • Response:
    • Status Code: 200 OK
    • Body:
      {
        "id": 21,
        "title": "One Piece",
        "main_picture": {
          "medium": "medium.jpg",
          "large": "large.jpg"
        }
      }

4. Add an Episode (File Upload)

  • URL: /add-episode
  • Method: POST
  • Description: Adds a new episode by uploading a video file. The video is transcribed and uploaded to Vimeo.
  • Form Data:
    • title (string, required): The title of the episode.
    • episode_number (integer, required): The episode number.
    • show_id (integer, required): The ID of the show.
    • file (file, required): The video file to upload.
  • Response:
    • Status Code: 200 OK
    • Body:
      {
        "id": 1,
        "title": "Episode 1",
        "episode_number": 1,
        "video_url": "video-url",
        "show_id": 1
      }

5. Add an Episode (From URL)

  • URL: /add-episode-from-url
  • Method: POST
  • Description: Adds a new episode by providing a video URL. The video is downloaded, transcribed, and uploaded to Vimeo.
  • Request Body (JSON):
    {
      "title": "Episode 1",
      "episode_number": 1,
      "show_id": 1,
      "video_url": "video-url"
    }
  • Response:
    • Status Code: 200 OK
    • Body:
      {
        "id": 1,
        "title": "Episode 1",
        "episode_number": 1,
        "video_url": "video-url",
        "show_id": 1
      }

Models

Show

{
  "id": 1,
  "title": "One Piece",
  "main_picture": {
    "medium": "medium.jpg",
    "large": "medium.jpg"
  },
  "episodes": [
    {
      "id": 1,
      "title": "Episode 1",
      "episode_number": 1,
      "video_url": "video-url"
    }
  ]
}

Episode

{
  "id": 1,
  "title": "Episode 1",
  "episode_number": 1,
  "video_url": "video-url",
  "show_id": 1
}

Error Responses

  • 400 Bad Request:

    • Missing or invalid fields in the request.
    {
      "error": "Missing required fields"
    }
  • 500 Internal Server Error:

    • Server-side errors, such as issues with file uploads, database operations, or external API calls.
    {
      "error": "Failed to save file"
    }

Notes

  • Ensure the MAL Client ID is correctly set in the configuration (MAL_AUTH_PARAM_NAME) for adding shows.
  • The upload directory for videos is ./uploads/. Ensure this directory is writable by the server.
  • Subtitles are automatically generated during the transcription process.

For additional questions or issues, refer to the AeToons documentation or contact the API support team.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published