File size: 897 Bytes
8cecc5d
97680fb
 
3b68ded
97680fb
8cecc5d
a16bfda
 
1c05d4a
e1d5167
8cecc5d
 
 
 
e1d5167
8cecc5d
 
 
e1d5167
8cecc5d
 
 
1c05d4a
8cecc5d
1c05d4a
8cecc5d
 
 
 
 
 
 
 
 
1567f17
8cecc5d
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 zipfile
import os
import time

# Hardcoded paths
ZIP_FILE_PATH = "ipv4/IP2PROXY-LITE-PX2.BIN.zip"  # ZIP file location
EXTRACT_FOLDER = "ipv4/"  # Extraction folder
os.makedirs(EXTRACT_FOLDER, exist_ok=True)

# Extract function
def extract_zip():
    if not os.path.exists(ZIP_FILE_PATH):
        return f"❌ ZIP file not found: {ZIP_FILE_PATH}"

    with zipfile.ZipFile(ZIP_FILE_PATH, 'r') as zip_ref:
        files = zip_ref.namelist()
        total_files = len(files)

        for i, file in enumerate(files):
            zip_ref.extract(file, EXTRACT_FOLDER)
            time.sleep(0.1)  # Simulate progress

    return f"✅ Extracted to {EXTRACT_FOLDER}"

# Gradio UI
iface = gr.Interface(
    fn=extract_zip,
    inputs=[],
    outputs="text",
    live=True,
    title="ZIP Extractor",
    description="Click the button to extract a ZIP file."
)

iface.launch()