U
    rg                     @   s6  d dl mZmZmZmZ d dlmZ d dlmZ d dl	m
Z
 d dl mZ d dlZd dlmZ ejejejeZejejejedZejed	Ze Zejd
eeddd ejdeeddd e
ddZejdededddZededededddfeeeedddZdS )    )FastAPI
UploadFileFileForm)HTMLResponse)StaticFiles)Jinja2Templates)RequestN)process_videoZstaticZprocessed_videosz/static)	directory)namez
/processed	processed	templates/)Zresponse_classrequestc                    s   t dd| iS )N
index.htmlr   )r   TemplateResponser    r   */var/www/html/Web_Transcoder/src/./main.py	read_root   s    r   z/process.Z
video_file)alias)r   countrychannelfilec                    s$   t |||I d H }td| |dS )Nr   )r   Zdownload_link)r
   r   r   )r   r   r   r   Zoutput_file_pathr   r   r   upload_video   s
    r   )Zfastapir   r   r   r   Zfastapi.responsesr   Zfastapi.staticfilesr   Zfastapi.templatingr   r	   osZservices.ffmpeg_servicer
   pathdirnameabspath__file__ZBASE_DIRjoinZ
STATIC_DIRZPROCESSED_DIRappZmountr   getr   poststrr   r   r   r   r   <module>   s2   

