Spaces:
Build error
Build error
| import gradio as gr | |
| # coding: utf-8 | |
| # Your code here! | |
| import shlex | |
| import requests | |
| from bs4 import BeautifulSoup | |
| import html | |
| import os | |
| import secrets | |
| import json | |
| def dlvid(url): | |
| proxy=os.environ['proxy'] | |
| vname=secrets.token_hex() | |
| os.system('chmod +x ./yt-dlp') | |
| os.system(f'./yt-dlp -N 4 -o "{vname}.%(ext)s" --write-info-json --remux-video mp4 --add-header "Accept-Language:ja" --progress-delta 5 --no-playlist --proxy "{proxy}" {shlex.quote(url)}') | |
| return [f'./{vname}.mp4',f'./{vname}.info.json'] | |
| demo = gr.Interface(fn=dlvid, inputs="text", outputs=["file"]) | |
| demo.launch() | |