Spaces:
Building
Building
GilangAlRusliadi
commited on
Commit
•
bd65db9
1
Parent(s):
d4fb6cc
CX
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
|
3 |
# os.system('pip install jedi')
|
4 |
# os.system('python -m pip install --upgrade pip setuptools wheel')
|
@@ -10,18 +11,18 @@ import streamlit as st
|
|
10 |
from streamlit_option_menu import option_menu
|
11 |
from Torrent import torrent_info, torrent_download, torrent_group, simpan_txt, link_redirect, sesi
|
12 |
|
13 |
-
|
14 |
# Navigasi Sidebar
|
15 |
with st.sidebar:
|
16 |
-
selected = option_menu("Torrent",
|
17 |
icons=['search', 'house', 'fire', 'water'], menu_icon="cast", default_index=0)
|
18 |
|
19 |
st.sidebar.image('DanMachi.png')
|
20 |
|
21 |
-
if selected ==
|
22 |
url = 'DanMachi.png'
|
23 |
st.image(url)
|
24 |
-
st.title(
|
25 |
link = st.text_input("Masukkan Magnet Link", "")
|
26 |
search = link = st.text_input("Masukkan Pencarian", "")
|
27 |
extension = st.selectbox('Pilih Extension', ['.mp4', '.zip'])
|
@@ -34,8 +35,8 @@ if selected == 'Magnet Link':
|
|
34 |
selected_index = int(file_priority.split('.')[0])
|
35 |
downloaded_files = torrent_download(link, [selected_index])
|
36 |
|
37 |
-
elif selected ==
|
38 |
-
st.title(
|
39 |
teks = st.text_area("Masukkan Teks", '', height=(25 * 10))
|
40 |
tim = st.checkbox("Gak Perlu Dikelompokkan")
|
41 |
if tim:
|
@@ -48,8 +49,8 @@ elif selected == 'Index Torrent':
|
|
48 |
lokasi_file = simpan_txt('Group Torrent', info)
|
49 |
sesi(info, lokasi_file)
|
50 |
|
51 |
-
elif selected ==
|
52 |
-
st.title(
|
53 |
link = st.text_input("Masukkan Link", "https://t.co/c31TBe7s4W")
|
54 |
|
55 |
if st.button("Trace On"):
|
@@ -58,11 +59,22 @@ elif selected == 'Link Redirect':
|
|
58 |
sesi(info, lokasi_file)
|
59 |
|
60 |
else:
|
61 |
-
st.title(
|
62 |
link = st.text_input("Masukkan Link", "https://t.co/8Qes0WO3GV")
|
63 |
|
64 |
if st.button("Trace On"):
|
65 |
info = link_redirect(link)
|
66 |
-
info = info.split('%')[-10].split('D')[1].replace('000', '-0').upper()
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
sesi(info, lokasi_file)
|
|
|
1 |
import os
|
2 |
+
import re
|
3 |
|
4 |
# os.system('pip install jedi')
|
5 |
# os.system('python -m pip install --upgrade pip setuptools wheel')
|
|
|
11 |
from streamlit_option_menu import option_menu
|
12 |
from Torrent import torrent_info, torrent_download, torrent_group, simpan_txt, link_redirect, sesi
|
13 |
|
14 |
+
option = ['Magnet Link', 'Index Torrent', 'Link Redirect', 'Kode']
|
15 |
# Navigasi Sidebar
|
16 |
with st.sidebar:
|
17 |
+
selected = option_menu("Torrent", option,
|
18 |
icons=['search', 'house', 'fire', 'water'], menu_icon="cast", default_index=0)
|
19 |
|
20 |
st.sidebar.image('DanMachi.png')
|
21 |
|
22 |
+
if selected == option[0]:
|
23 |
url = 'DanMachi.png'
|
24 |
st.image(url)
|
25 |
+
st.title(selected)
|
26 |
link = st.text_input("Masukkan Magnet Link", "")
|
27 |
search = link = st.text_input("Masukkan Pencarian", "")
|
28 |
extension = st.selectbox('Pilih Extension', ['.mp4', '.zip'])
|
|
|
35 |
selected_index = int(file_priority.split('.')[0])
|
36 |
downloaded_files = torrent_download(link, [selected_index])
|
37 |
|
38 |
+
elif selected == option[1]:
|
39 |
+
st.title(selected)
|
40 |
teks = st.text_area("Masukkan Teks", '', height=(25 * 10))
|
41 |
tim = st.checkbox("Gak Perlu Dikelompokkan")
|
42 |
if tim:
|
|
|
49 |
lokasi_file = simpan_txt('Group Torrent', info)
|
50 |
sesi(info, lokasi_file)
|
51 |
|
52 |
+
elif selected == option[2]:
|
53 |
+
st.title(selected)
|
54 |
link = st.text_input("Masukkan Link", "https://t.co/c31TBe7s4W")
|
55 |
|
56 |
if st.button("Trace On"):
|
|
|
59 |
sesi(info, lokasi_file)
|
60 |
|
61 |
else:
|
62 |
+
st.title(selected)
|
63 |
link = st.text_input("Masukkan Link", "https://t.co/8Qes0WO3GV")
|
64 |
|
65 |
if st.button("Trace On"):
|
66 |
info = link_redirect(link)
|
67 |
+
info = info.split('%')[-10] #.split('D1')[1].split('D')[1].replace('000', '-0').upper()
|
68 |
+
|
69 |
+
# Pola regex untuk mencocokkan pola yang dijelaskan
|
70 |
+
pattern = r'[A-Za-z]+(\d{3})'
|
71 |
+
|
72 |
+
# Mencari kecocokan dengan pola regex
|
73 |
+
matches = re.findall(pattern, info)
|
74 |
+
|
75 |
+
if matches:
|
76 |
+
alfabet, number = matches[0][:3], matches[0][3:]
|
77 |
+
info = f"{alfabet.upper()}-{number.lstrip('0')}"
|
78 |
+
|
79 |
+
lokasi_file = simpan_txt('Group Torrent', info)
|
80 |
sesi(info, lokasi_file)
|