Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
feat: add new video types (MKV, MOV, AVI, MP4, WMV, and WebM) to hyko…
Browse files Browse the repository at this point in the history
…sdk io
  • Loading branch information
ayoubmrx committed Feb 25, 2024
1 parent d205b75 commit 73ae807
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
8 changes: 8 additions & 0 deletions hyko_sdk/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ def validate_object(val: "Video"):
assert obj_ext.value in [
Ext.MP4,
Ext.WEBM,
Ext.AVI,
Ext.MKV,
Ext.MOV,
Ext.WMV,
], "Invalid file extension for Video error"
return Video(obj_ext=obj_ext, file_name=file_name)

Expand All @@ -266,6 +270,10 @@ def validate_file_name(file_name: str):
assert obj_ext.value in [
Ext.MP4,
Ext.WEBM,
Ext.AVI,
Ext.MKV,
Ext.MOV,
Ext.WMV,
], "Invalid file extension for Video error"
return Video(obj_ext=obj_ext, file_name=file_name)

Expand Down
4 changes: 4 additions & 0 deletions hyko_sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ class Ext(str, Enum):
WAV = "wav"
MP4 = "mp4"
MP3 = "mp3"
AVI = "avi"
MKV = "mkv"
MOV = "mov"
WMV = "wmv"
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ async def main(inputs: Inputs, params: Params) -> Outputs:
type_to_object = {
"webm": Ext.WEBM,
"mp4": Ext.MP4,
# "avi": Ext.AVI,
# "mkv": Ext.MKV,
# "mov": Ext.MOV,
# "wmv": Ext.WMV,
"avi": Ext.AVI,
"mkv": Ext.MKV,
"mov": Ext.MOV,
"wmv": Ext.WMV,
}

with open(f"/app/video{ext}", "wb") as f:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


class SupportedTypes(str, Enum):
# mkv = "mkv"
# mov = "mov"
# avi = "avi"
mkv = "mkv"
mov = "mov"
avi = "avi"
mp4 = "mp4"
# wmv = "wmv"
wmv = "wmv"
webm = "webm"


Expand Down

0 comments on commit 73ae807

Please sign in to comment.