Spaces:
Building
Building
import os | |
os.system('pip install jedi') | |
os.system('python -m pip install --upgrade pip setuptools wheel') | |
os.system('python -m pip install lbry-libtorrent') | |
os.system('apt-get install ffmpeg -y') | |
os.system('apt install python3-libtorrent') | |
import streamlit as st | |
from streamlit_option_menu import option_menu | |
from Torrent import torrent_info, torrent_download | |
# Navigasi Sidebar | |
with st.sidebar: | |
selected = option_menu("Torrent", ['Magnet Link'], | |
icons=['search'], menu_icon="cast", default_index=0) | |
if selected == 'Magnet Link': | |
url = 'DanMachi.png' | |
st.image(url) | |
st.title("Magnet Link Torrent") | |
link = st.text_input("Masukkan Magnet Link", "") | |
extension = st.selectbox('Pilih Extension', ['.mp4', '.zip']) | |
if st.button("Trace On"): | |
info = torrent_info(link, extension) | |
file_priority = st.selectbox('Pilih File', info) | |
if st.button("Download"): | |
selected_index = int(file_priority.split('.')[0]) | |
downloaded_files = torrent_download(link, [selected_index]) | |