File size: 1,053 Bytes
29af131
 
 
 
 
 
 
 
3b90d58
 
 
 
 
 
 
 
 
 
 
e354b65
 
3b90d58
 
9784d97
3b90d58
 
 
9784d97
3b90d58
9784d97
 
 
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
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])