File size: 556 Bytes
59e1d08
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from tool.file_name import *
from ui.ui_component import current_ui_lang
import gradio as gr
import gdown


def get_video_from_url(url):
    # Download video from google drive with shareable link
    gr.Info(current_ui_lang["get_video_start_info"])
    download_result = gdown.download(
        url, dir_download_file, quiet=False, fuzzy=True)

    # Raise error if failed
    if (download_result is None):
        raise gr.Error(current_ui_lang["get_video_fail_info"])

    gr.Info(current_ui_lang["get_video_finished_info"])
    return dir_download_file