-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.py
98 lines (92 loc) · 2.49 KB
/
content.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
from flet import *
import script
def main(page: Page):
def change_path_status(a):
folder_path.visible = path_change_chk.value is not False
page.update()
def send_info(_):
link, path = playlist_link.value, folder_path.value
script.__start(
page,
link,
path,
)
heading = Text(
value="Spotify Scraper",
style=TextThemeStyle.DISPLAY_MEDIUM,
color="#D3D5FD",
weight="w800",
)
playlist_link = TextField(
hint_text="Playlist Link",
autofocus=True,
color="#D3D5FD",
bgcolor="#474A56",
border_width=2,
border_color="#929AAB",
)
folder_path = TextField(
hint_text="Folder Path = Downloads",
visible=False,
color="#D3D5FD",
bgcolor="#474A56",
border_width=2,
border_color="#929AAB",
)
path_change_chk = Checkbox(
label="Change Download Location?",
value=False,
fill_color="#D3D5FD",
on_change=change_path_status,
)
download_btn = ElevatedButton(
text="Download",
icon="download",
on_click=send_info,
style=ButtonStyle(shape=RoundedRectangleBorder(radius=2)),
)
output = Column(
controls=[
Text(
value="Logs",
style=TextThemeStyle.TITLE_LARGE,
color="#D3D5FD",
weight="w800",
),
Divider(height=10, color="transparent"),
],
)
content = Column(
width=600,
controls=[
Row(
controls=[
heading,
],
alignment=MainAxisAlignment.CENTER,
),
Divider(height=5, color="transparent"),
Column(
controls=[
playlist_link,
folder_path,
],
),
Divider(height=5, color="transparent"),
Row(
controls=[
path_change_chk,
download_btn,
],
alignment=MainAxisAlignment.SPACE_EVENLY,
),
Divider(height=5, color="white"),
output,
],
)
page.bgcolor = "#0B0B0D"
page.title = "Spotify Scraper"
page.horizontal_alignment = CrossAxisAlignment.CENTER
page.add(content)
page.scroll = "always"
app(target=main, view=AppView.WEB_BROWSER, port=45000)