Spaces:
No application file
No application file
Download run.py from procopio1000/mediaflow: direct link, hf CLI and curl.
- Browser
- Download file 597 Bytes
-
https://huggingface.co/spaces/procopio1000/mediaflow/resolve/main/run.py
- Command line
-
hf download hf://spaces/procopio1000/mediaflow/run.py
-
curl -L -o run.py https://huggingface.co/spaces/procopio1000/mediaflow/resolve/main/run.py
597 Bytes
| import gradio as gr | |
| import requests | |
| # Função proxy baseada no seu fork | |
| def proxy(url: str): | |
| try: | |
| headers = {"User-Agent": "Mozilla/5.0"} | |
| r = requests.get(url, headers=headers, timeout=15) | |
| return r.text | |
| except Exception as e: | |
| return f"Erro: {e}" | |
| # Interface mínima Gradio | |
| iface = gr.Interface( | |
| fn=proxy, | |
| inputs=gr.Textbox(label="URL"), | |
| outputs=gr.Textbox(label="Conteúdo"), | |
| title="MediaFlow Proxy", | |
| description="Digite a URL que quer acessar via proxy" | |
| ) | |
| # Executa a interface | |
| iface.launch(server_name="0.0.0.0", server_port=7860) | |