-
Notifications
You must be signed in to change notification settings - Fork 1
/
core_GUI.py
48 lines (40 loc) · 1.36 KB
/
core_GUI.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
# =============================================================================
# Init
# =============================================================================
import pyglet as pg
from tkinter import ttk, Tk, Button, Entry, Label
import core
fontname = "内海フォントJP--Regular"
pg.font.add_file("NKF.TTF")
# 視窗細項(window config)
def gen():
global win
win = Tk()
win.title("ClipResourceDownloader v1.0")
win.configure(bg="#64aaf0")
def click_download():
mode_v = mode.get()
url_v = url.get()
x = (mode_v, url_v)
core.download(x)
def ui():
global url, mode
gen()
# 元件
mode = ttk.Combobox(win, values=["playlist", "video"], font=(fontname, 25))
url = Entry(win, font=(fontname, 30))
start = Button(win, text="start", bg="#64aaf0", font=(
fontname, 20), command=lambda: click_download())
stop = Button(win, text="EXIT", bg="#64aaf0",
font=(fontname, 20), command=win.destroy)
don_t_do = Label(
win, text="Do NOT download MEMBERS-ONLY video.", font=(fontname, 17), fg="red", bg="#64aaf0")
# 排版
don_t_do.pack(anchor="sw", padx=10, side="bottom")
win.geometry("600x800")
mode.pack(side="top", fill='x', pady=0)
url.pack(pady=20, fill="x")
start.place(x=200, y=110)
stop.place(x=320, y=110)
win.mainloop()
url, mode = None, None