Skip to content

AlbertoCV03/VideoMiner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VideoMiner API

REST API for retrieving, consulting and storing channel data.

General Information

  • OpenAPI Version: 3.1.0
  • API Version: v1
  • Base URL: http://localhost:8080

Table of Contents


Features

  • Retrieve channels, videos, comments and captions

  • Pagination support

  • Sorting support

  • Filter channels by minimum number of videos

  • Filter videos by date

  • CRUD operations for channels, videos, comments and captions

  • Nested resources support:

    • Videos by channel
    • Comments by video
    • Captions by video

Data Models

Channel

{
  "id": "80",
  "name": "tv",
  "description": "random videos channel",
  "createdTime": "2023-01-01T23:36:17.306Z",
  "videos": []
}
Field Type Required
id string
name string
description string
createdTime string
videos array(Video)

Video

{
  "id": "21856",
  "name": "Alien: Isolation live on iOS",
  "description": "HOW WILL YOU SURVIVE?",
  "releaseTime": "2023-01-09T22:32:41.126Z",
  "user": {},
  "comments": [],
  "captions": []
}
Field Type Required
id string
name string
description string
releaseTime string
user User
comments array(Comment)
captions array(Caption)

Comment

{
  "id": "3955",
  "text": "Funniest video I've ever seen",
  "createdOn": "2023-01-03T23:45:40.196Z"
}
Field Type Required
id string
text string
createdOn string

Caption

{
  "id": "1",
  "link": "/lazy-static/video-captions/file.vtt",
  "language": "Spanish"
}
Field Type Required
id string
link string
language string

User

{
  "id": 1,
  "name": "stux",
  "user_link": "https://peertube.tv/accounts/stux",
  "picture_link": "https://peertube.tv/lazy-static/avatar.png"
}
Field Type Required
id integer
name string
user_link string
picture_link string

Channel Endpoints

Get all channels

GET /videominer/channels

Query Parameters

Parameter Type Description Default
page integer Page number 0
size integer Page size 100
minVideos integer Minimum number of videos 0
order string Sort by id, name or createdTime (- for descending order) -

Example

GET /videominer/channels?page=0&size=10&minVideos=5&order=-createdTime

Get a channel

GET /videominer/channels/{id}

Path Parameters

Parameter Type Description
id string Channel identifier

Save a channel

POST /videominer/channels

Request Body

{
  "name": "tv",
  "description": "random videos channel",
  "createdTime": "2023-01-01T23:36:17.306Z",
  "videos": []
}

Responses

Status Description
201 Channel successfully saved
500 Internal Server Error caused by incorrect body format

Save multiple channels

POST /videominer/channels/all

Request Body

[
  {
    "name": "science",
    "createdTime": "2024-01-01T10:00:00.000Z",
    "videos": []
  }
]

Update a channel

PUT /videominer/channels/{id}

Delete a channel

DELETE /videominer/channels/{id}

Video Endpoints

Get all videos

GET /videominer/videos

Query Parameters

Parameter Type
page integer
size integer
findDate string
year integer
month integer
day integer

Example

GET /videominer/videos?year=2023&month=1&day=9

Get a video

GET /videominer/videos/{videoId}

Get all videos from a channel

GET /videominer/channels/{channelId}/videos

Update a video

PUT /videominer/videos/{id}

Delete a video

DELETE /videominer/videos/{id}

Comment Endpoints

Get all comments

GET /videominer/comments

Query Parameters

Parameter Type
page integer
size integer
order string

Get a comment

GET /videominer/comments/{commentId}

Get all comments from a video

GET /videominer/videos/{videoId}/comments

Update a comment

PUT /videominer/comments/{id}

Delete a comment

DELETE /videominer/comments/{id}

Caption Endpoints

Get all captions

GET /videominer/captions

Query Parameters

Parameter Type
page integer
size integer
order string

Get a caption

GET /videominer/captions/{captionId}

Get all captions from a video

GET /videominer/videos/{videoId}/captions

Update a caption

PUT /videominer/captions/{id}

Delete a caption

DELETE /videominer/captions/{id}

Pagination and Sorting

Several endpoints support pagination and sorting.

Pagination Example

GET /videominer/channels?page=1&size=20

Descending Sort Example

GET /videominer/channels?order=-createdTime

Ascending Sort Example

GET /videominer/channels?order=name

Example Request

curl -X GET "http://localhost:8080/videominer/channels?page=0&size=5"

Example Response

[
  {
    "id": "80",
    "name": "tv",
    "description": "random videos channel",
    "createdTime": "2023-01-01T23:36:17.306Z",
    "videos": []
  }
]

Status Codes

Code Meaning
200 OK
201 Created
204 No Content
500 Internal Server Error

Technologies

  • Java
  • Spring Boot
  • Maven
  • OpenAPI / Swagger

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages