File size: 1,538 Bytes
529d20c
8489786
a8844fc
529d20c
60c500c
aadeb4e
a04f9dc
f702a14
 
 
 
725f99f
 
9f9dd1f
daef9df
6a637af
8489786
7341fad
f9d0dfe
a8844fc
 
8489786
 
a8844fc
8489786
 
0becee4
daef9df
8489786
0becee4
a8844fc
8489786
47afa67
d6f0faf
bec374d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import gradio as gr
import requests
import os


download_url="https://img.zcool.cn/community/0104c15cd45b49a80121416816f1ec.jpg@1280w_1l_2o_100sh.jpg"
response = requests.get("https://img.zcool.cn/community/0104c15cd45b49a80121416816f1ec.jpg@1280w_1l_2o_100sh.jpg")
file_name = download_url.split("/")[-1]  # Extracting the file name from the URL
save_path = os.path.join(os.getcwd(), file_name)
with open(save_path, 'wb') as f:
    f.write(response.content)


download_url="https://img.zcool.cn/community/0104c15cd45b49a80121416816f1ec.jpg@1280w_1l_2o_100sh.jpg"
def download_file(download_url):
    download_url="https://img.zcool.cn/community/0104c15cd45b49a80121416816f1ec.jpg@1280w_1l_2o_100sh.jpg"
    try:
        download_url="https://img.zcool.cn/community/0104c15cd45b49a80121416816f1ec.jpg@1280w_1l_2o_100sh.jpg"
        response = requests.get("https://img.zcool.cn/community/0104c15cd45b49a80121416816f1ec.jpg@1280w_1l_2o_100sh.jpg")
        file_name = download_url.split("/")[-1]  # Extracting the file name from the URL
        save_path = os.path.join(os.getcwd(), file_name)
        with open(save_path, 'wb') as f:
            f.write(response.content)
        return f"File downloaded successfully to {save_path}"
    except Exception as e:
        return f"Error downloading file: {str(e)}"

iface = gr.Interface(fn=download_file, inputs=["text"], outputs="text")
iface.launch(share=True)


# subprocess.run(["wget", "-O", "G_38400.pth", "https://github.com/00000000002/render/releases/download/ddd/G_38400.pth"])