1
|
|
|
# ------------------ Packages imported --------------------------------------------- |
2
|
|
|
import pytube |
3
|
|
|
from pytube import YouTube |
4
|
|
|
from pytube import Playlist |
5
|
|
|
import sys |
6
|
|
|
import re |
7
|
|
|
import requests as r |
8
|
|
|
import wget |
9
|
|
|
from tkinter import PhotoImage, Label, StringVar, Entry, Button, IntVar, \ |
10
|
|
|
Radiobutton, messagebox, filedialog, Frame, X, Y, LEFT, RIGHT, \ |
11
|
|
|
N, FLAT, CENTER, Canvas, Scrollbar, VERTICAL, BOTH, SUNKEN, SOLID |
12
|
|
|
import tkinter as tk |
13
|
|
|
from tkinter import ttk |
14
|
|
|
import clipboard |
15
|
|
|
import webbrowser |
16
|
|
|
from tkinterhtml import HtmlFrame |
17
|
|
|
from tkinter import Tk,Menu,Toplevel,Text,Spinbox |
18
|
|
|
import pywhatkit |
19
|
|
|
import time |
20
|
|
|
import sys |
21
|
|
|
import os |
22
|
|
|
from youtubepy import Video |
23
|
|
|
from PIL import Image, ImageTk |
24
|
|
|
|
25
|
|
|
# ============================ Window Design ================================ |
26
|
|
|
|
27
|
|
|
top = Tk() |
28
|
|
|
# - Top is Main Screen Intialization |
29
|
|
|
# - Menu bar Intialization |
30
|
|
|
def Whatsapp_History(): |
31
|
|
|
import WA_history |
32
|
|
|
|
33
|
|
|
def openweb(): # Software Update response |
34
|
|
|
webbrowser.open(url1, new=new) |
35
|
|
|
|
36
|
|
|
def update_check(): # AutoCheck Software Update and Sub Screen |
37
|
|
|
response = r.get(res_url) |
38
|
|
|
response.raise_for_status() |
39
|
|
|
if messagebox.askyesno("Software Update", |
40
|
|
|
"New Update is Availabe, Click yes to install.") is True: |
41
|
|
|
openweb() |
42
|
|
|
|
43
|
|
|
def find_update(): # Check Software Update - 2 |
44
|
|
|
try: |
45
|
|
|
update_check() |
46
|
|
|
messagebox.showinfo("FYIT", "Thank You.") |
47
|
|
|
except r.ConnectionError as e: |
48
|
|
|
messagebox.showinfo("Connection Error", |
49
|
|
|
"Check the Internet Connection") |
50
|
|
|
except r.exceptions.HTTPError as err: |
51
|
|
|
messagebox.showinfo("FYIT","No Update yet..") |
52
|
|
|
|
53
|
|
|
def Cancel_Shutdown(): |
54
|
|
|
try: |
55
|
|
|
pywhatkit.cancelShutdown() |
56
|
|
|
messagebox.showinfo("Shutdown Cancelled.", "Shutdown Scheduled time cancelled Successfully.") |
57
|
|
|
except NameError: |
58
|
|
|
messagebox.showwarning("No Schedule.", "Shutdown is not been Scheduled.") |
59
|
|
|
|
60
|
|
|
# -----------Close Function-------------------------------------------------- |
61
|
|
|
|
62
|
|
|
def close_btn(): |
63
|
|
|
if messagebox.askyesno("FYIT..", "Are you Sure you want to exit") is True: |
64
|
|
|
top.withdraw() |
65
|
|
|
top.destroy() |
66
|
|
|
top.exit() |
67
|
|
|
|
68
|
|
|
# --------------------------------------------------------------------------- |
69
|
|
|
|
70
|
|
|
if (1 ==1): |
71
|
|
|
try: |
72
|
|
|
import pywhatkit |
73
|
|
|
except Exception as e: |
74
|
|
|
messagebox.showwarning("No Internet or Internet is Slow", "Check Internet Connection") |
75
|
|
|
else: |
76
|
|
|
messagebox.showwarning("No Internet or Internet is Slow", "Check Internet Connection") |
77
|
|
|
|
78
|
|
|
menubar = Menu(top) |
79
|
|
|
menubar.add_cascade(label="Whatsapp History", command=Whatsapp_History) |
80
|
|
|
menubar.add_cascade(label="Cancel Shutdown", command=Cancel_Shutdown) |
81
|
|
|
menubar.add_cascade(label="Check Update",command=find_update) |
82
|
|
|
top.config(bg='black', menu=menubar) |
83
|
|
|
|
84
|
|
|
# Styles and Designs Functions for Screens |
85
|
|
|
# Color set for youtube for selectcolor, bg & activebackground #0B1D6F |
86
|
|
|
yt_col = "#0B1D6F" # Youtube bg Color |
87
|
|
|
# Color set for facebook for selectcolor, bg & activebackground #075C90 |
88
|
|
|
fb_col = '#075C90' # Facebook bg Color |
89
|
|
|
col_show = 'white' # pure white fg |
90
|
|
|
col_select = 'gray' # gray for activeforeground |
91
|
|
|
COLOR_1 = "#90B3DD" # TabControl Config Color |
92
|
|
|
# Font Style and Size |
93
|
|
|
large_font = font = ('Cascadia Mono', 16) # style='my.head' |
94
|
|
|
DisFont = font = ('', 14) # style='my.default' |
95
|
|
|
SubFont = font = ('Consolas', 12) # style='my.sub' |
96
|
|
|
tab_font = font = ('Consolas', 12) # Tab font style |
97
|
|
|
|
98
|
|
|
# Tab Control Style Config |
99
|
|
|
tab_show = "#90B3DD" |
100
|
|
|
tab_select = "#C8D9EE" |
101
|
|
|
|
102
|
|
|
g_black = "#262626" |
103
|
|
|
black = "#000000" |
104
|
|
|
|
105
|
|
|
style = ttk.Style() |
106
|
|
|
style.theme_create( "yummy", parent="alt", settings={ |
107
|
|
|
"TNotebook": {"configure": { "tabmargins": [2, 5, 2, 0] } }, |
108
|
|
|
"TNotebook.Tab": { |
109
|
|
|
"configure": {"padding": [15, 5], "foreground": 'gray', "background": black }, |
110
|
|
|
"map": {"background": [("selected", g_black)], |
111
|
|
|
"foreground": [("selected", 'white')], |
112
|
|
|
"expand": [("selected", [2, 3, 2, 0])] } } } ) |
113
|
|
|
style.theme_use("yummy") |
114
|
|
|
|
115
|
|
|
# ------------------------ Screen and Tab ----------------------------------- |
116
|
|
|
|
117
|
|
|
style = ttk.Style(top) |
118
|
|
|
style.configure('lefttab.TNotebook', tabposition='sw') |
119
|
|
|
tabControl = ttk.Notebook(top, style='lefttab.TNotebook') |
120
|
|
|
|
121
|
|
|
lb = 20 |
122
|
|
|
bd = 20 |
123
|
|
|
|
124
|
|
|
tabimg1 = Image.open("Assets/WA.png") |
125
|
|
|
tabimg1 = tabimg1.resize((lb,bd), Image.ANTIALIAS) |
126
|
|
|
timg1 = ImageTk.PhotoImage(tabimg1) |
127
|
|
|
|
128
|
|
|
tabimg2 = Image.open("Assets/fs.png") |
129
|
|
|
tabimg2 = tabimg2.resize((lb,bd), Image.ANTIALIAS) |
130
|
|
|
timg2 = ImageTk.PhotoImage(tabimg2) |
131
|
|
|
|
132
|
|
|
tabimg3 = Image.open("Assets/yt.png") |
133
|
|
|
tabimg3 = tabimg3.resize((lb,bd), Image.ANTIALIAS) |
134
|
|
|
timg3 = ImageTk.PhotoImage(tabimg3) |
135
|
|
|
|
136
|
|
|
tabimg4 = Image.open("Assets/fb.png") |
137
|
|
|
tabimg4 = tabimg4.resize((lb,bd), Image.ANTIALIAS) |
138
|
|
|
timg4 = ImageTk.PhotoImage(tabimg4) |
139
|
|
|
|
140
|
|
|
tabimg5 = Image.open("Assets/i.png") |
141
|
|
|
tabimg5 = tabimg5.resize((lb,bd), Image.ANTIALIAS) |
142
|
|
|
timg5 = ImageTk.PhotoImage(tabimg5) |
143
|
|
|
|
144
|
|
|
tab4 = ttk.Frame(tabControl) |
145
|
|
|
tabControl.add(tab4, text='WhatsApp-MessageSender', image=timg1, compound='left') |
146
|
|
|
|
147
|
|
|
tab5 = ttk.Frame(tabControl) |
148
|
|
|
tabControl.add(tab5,text='Fast-YoutubeSearch', image=timg2, compound='left') |
149
|
|
|
|
150
|
|
|
tab1 = ttk.Frame(tabControl) # Tab1 - Youtube |
151
|
|
|
tabControl.add(tab1, text='Youtube-Downloader', image=timg3, compound='left') |
152
|
|
|
|
153
|
|
|
tab2 = ttk.Frame(tabControl) # Tab2 - Facebook |
154
|
|
|
tabControl.add(tab2, text='Facebook-Downloader', image=timg4, compound='left') |
155
|
|
|
|
156
|
|
|
tab3 = ttk.Frame(tabControl) # Tab3 - About |
157
|
|
|
tabControl.add(tab3, text='About', image=timg5, compound='left') |
158
|
|
|
|
159
|
|
|
tabControl.pack() |
160
|
|
|
|
161
|
|
|
top.iconbitmap('Assets/YoutubeDownloader.ico') # Window Title Icon |
162
|
|
|
top.title("FYIT Download Manager :") # Title Label |
163
|
|
|
top.geometry("800x520+100+100") # Screen Size |
164
|
|
|
|
165
|
|
|
photo = PhotoImage(file="Assets/youtube_bg.png") # Tab1 Background |
166
|
|
|
w = Label(tab1, image=photo) |
167
|
|
|
w.pack() |
168
|
|
|
|
169
|
|
|
photo2 = PhotoImage(file="Assets/facebook_bg.png") # Tab2 Background |
170
|
|
|
w2 = Label(tab2, image=photo2) |
171
|
|
|
w2.pack() |
172
|
|
|
|
173
|
|
|
top.resizable(0, 0) # Disable the Maximize & Minimize option |
174
|
|
|
|
175
|
|
|
var1 = StringVar() |
176
|
|
|
# Entry Widget for Youtube Downloader Tab |
177
|
|
|
url = Entry(tab1, textvariable=var1, font=large_font, fg='darkblue') |
178
|
|
|
url.place(x=70, y=117, width=500, height=30) |
179
|
|
|
|
180
|
|
|
# Entry Widget for Facebook Downloader Tab |
181
|
|
|
url_fb = Entry(tab2, textvariable=var1, font=large_font, fg='darkblue') |
182
|
|
|
url_fb.place(x=70, y=117, width=500, height=30) |
183
|
|
|
|
184
|
|
|
# Quit_button placed in tab1 |
185
|
|
|
quit_button = Button(tab1, |
186
|
|
|
text="Quit", |
187
|
|
|
relief=SOLID, |
188
|
|
|
font=SubFont, |
189
|
|
|
cursor='hand2', |
190
|
|
|
command=close_btn) |
191
|
|
|
quit_button.place(x=60, y=400, width=200, height=30) |
192
|
|
|
|
193
|
|
|
# ----------------------- Auto URL Paste Functions -------------------------- |
194
|
|
|
|
195
|
|
|
temp = clipboard.paste() |
196
|
|
|
url.insert('end', temp) |
197
|
|
|
url_fb.insert('end', temp) |
198
|
|
|
var1.set(temp) |
199
|
|
|
|
200
|
|
|
|
201
|
|
|
def paste(): # Paste text from Clipboard - Function |
202
|
|
|
variable = clipboard.paste() |
203
|
|
|
url.insert('end', variable) |
204
|
|
|
url_fb.insert('end', variable) |
205
|
|
|
var1.set(variable) |
206
|
|
|
|
207
|
|
|
def e1_delete(): # Clear text from Entry - Function |
208
|
|
|
url.delete(0, 'end') |
209
|
|
|
url_fb.delete(0, 'end') |
210
|
|
|
|
211
|
|
|
def toggle(tog=[0]): # Toggle Button for clear and paste |
212
|
|
|
tog[0] = not tog[0] |
213
|
|
|
if tog[0]: |
214
|
|
|
t_btn.config(text='Paste') |
215
|
|
|
t_btn1.config(text='Paste') |
216
|
|
|
e1_delete() |
217
|
|
|
else: |
218
|
|
|
t_btn.config(text='Clear') |
219
|
|
|
t_btn1.config(text='Clear') |
220
|
|
|
paste() |
221
|
|
|
|
222
|
|
|
# tab1 clear & paste |
223
|
|
|
t_btn1 = ttk.Button(tab1, text="Clear", cursor='hand2', style='my.TButton', command=toggle) |
224
|
|
|
t_btn1.place(x=571, y=118, width=45, height=29) |
225
|
|
|
|
226
|
|
|
# tab2 clear & paste |
227
|
|
|
t_btn = ttk.Button(tab2, text="Clear", cursor='hand2', style='my.TButton', command=toggle) |
228
|
|
|
t_btn.place(x=571, y=118, width=45, height=29) |
229
|
|
|
|
230
|
|
|
# ------------------ Fetching Part from Youtube ---------------------------- |
231
|
|
|
|
232
|
|
|
new = 1 |
233
|
|
|
url1 = "https://bit.ly/site-fyit" |
234
|
|
|
res_url = "https://github.com/DeepakChakravarthy/YoutubeDownloader-FYI/releases/download/V3.0/FYI.DOWNLOAD.EXE" |
235
|
|
|
|
236
|
|
|
# -------------------Youtube Function Call----------------------------------- |
237
|
|
|
|
238
|
|
|
def get_fetch(): |
239
|
|
|
resolution = Rvideo.get() |
240
|
|
|
Select = A_Video.get() |
241
|
|
|
Selection = A_Audio.get() |
242
|
|
|
|
243
|
|
|
try: |
244
|
|
|
update_check() |
245
|
|
|
except r.exceptions.HTTPError as err: |
246
|
|
|
# - No Updates |
247
|
|
|
messagebox.showinfo("FYIT", "Select Location to Save the File.") |
248
|
|
|
|
249
|
|
|
except r.ConnectionError as e: |
250
|
|
|
messagebox.showinfo("Connection Error", "Check the Internet Connection") |
251
|
|
|
|
252
|
|
|
try: |
253
|
|
|
if var1 is None: |
254
|
|
|
print("error") |
255
|
|
|
dirname = filedialog.askdirectory(parent=tab1, |
256
|
|
|
initialdir="/", |
257
|
|
|
title='Please select a directory:') |
258
|
|
|
|
259
|
|
|
if dirname: |
260
|
|
|
try: |
261
|
|
|
# Youtube Video with Resolution |
262
|
|
|
if resolution <= 3: |
263
|
|
|
yt = pytube.YouTube(var1.get()) |
264
|
|
|
|
265
|
|
|
if resolution == 1: |
266
|
|
|
progress_bar = ttk.Progressbar(tab1, |
267
|
|
|
orient='horizontal', |
268
|
|
|
length=500, |
269
|
|
|
mode='determinate') |
270
|
|
|
progress_bar.place(x=70, y=160) |
271
|
|
|
progress_bar.start() |
272
|
|
|
messagebox.showinfo( |
273
|
|
|
"Download", |
274
|
|
|
"Downloading.. Please Wait for a Minute.") |
275
|
|
|
video = yt.streams.get_by_itag(22) |
276
|
|
|
video.download(dirname) |
277
|
|
|
messagebox.showinfo("Downloaded. ", "Thank You..") |
278
|
|
|
|
279
|
|
|
elif resolution == 2: |
280
|
|
|
progress_bar = ttk.Progressbar(tab1, |
281
|
|
|
orient='horizontal', |
282
|
|
|
length=500, |
283
|
|
|
mode='determinate') |
284
|
|
|
progress_bar.place(x=70, y=160) |
285
|
|
|
progress_bar.start() |
286
|
|
|
messagebox.showinfo("Download", "Downloading...") |
287
|
|
|
video = yt.streams.first() |
288
|
|
|
video.download(dirname) |
289
|
|
|
messagebox.showinfo("Downloaded. ", "Thank You..") |
290
|
|
|
|
291
|
|
|
elif resolution == 3: |
292
|
|
|
progress_bar = ttk.Progressbar(tab1, |
293
|
|
|
orient='horizontal', |
294
|
|
|
length=500, |
295
|
|
|
mode='determinate') |
296
|
|
|
progress_bar.place(x=70, y=160) |
297
|
|
|
progress_bar.start() |
298
|
|
|
messagebox.showinfo("Download", "Downloading...") |
299
|
|
|
video = yt.streams.get_by_itag(36) |
300
|
|
|
video.download(dirname) |
301
|
|
|
messagebox.showinfo("Downloaded. ", "Thank You..") |
302
|
|
|
|
303
|
|
|
# Download Playlist |
304
|
|
|
if Select == 1: |
305
|
|
|
playlist = pytube.Playlist(var1.get()) |
306
|
|
|
progress_bar = ttk.Progressbar(tab1, |
307
|
|
|
orient='horizontal', |
308
|
|
|
length=500, |
309
|
|
|
mode='determinate') |
310
|
|
|
progress_bar.place(x=70, y=160) |
311
|
|
|
progress_bar.start() |
312
|
|
|
playlist.populate_video_urls() # To load bulk list |
313
|
|
|
messagebox.showinfo("Download", "Downloading...") |
314
|
|
|
playlist.download_all(dirname) |
315
|
|
|
messagebox.showinfo("Downloaded. ", "Thank You..") |
316
|
|
|
|
317
|
|
|
# Audio files |
318
|
|
|
if Selection <= 2: |
319
|
|
|
link = YouTube(var1.get()) |
320
|
|
|
format_a = link.streams.filter(only_audio=True).all() |
321
|
|
|
|
322
|
|
|
if Selection == 1: # mp4 |
323
|
|
|
progress_bar = ttk.Progressbar(tab1, |
324
|
|
|
orient='horizontal', |
325
|
|
|
length=500, |
326
|
|
|
mode='determinate') |
327
|
|
|
progress_bar.place(x=70, y=160) |
328
|
|
|
progress_bar.start() |
329
|
|
|
messagebox.showinfo("Download", "Downloading...") |
330
|
|
|
format_a[0].download(dirname) |
331
|
|
|
messagebox.showinfo("Downloaded. ", "Thank You..") |
332
|
|
|
|
333
|
|
|
elif Selection == 2: # webm |
334
|
|
|
progress_bar = ttk.Progressbar(tab1, |
335
|
|
|
orient='horizontal', |
336
|
|
|
length=500, |
337
|
|
|
mode='determinate') |
338
|
|
|
progress_bar.place(x=70, y=160) |
339
|
|
|
progress_bar.start() |
340
|
|
|
messagebox.showinfo("Download", "Downloading...") |
341
|
|
|
format_a[1].download(dirname) |
342
|
|
|
messagebox.showinfo("Downloaded. ", "Thank You..") |
343
|
|
|
messagebox.showinfo("FYIT", "Please Select Valid option") |
344
|
|
|
except Exception as a: |
345
|
|
|
messagebox.showwarning(" FYIT.. ", "Failed") |
346
|
|
|
else: |
347
|
|
|
messagebox.showwarning(" FYIT. ", "Cancelled") |
348
|
|
|
except Exception as a: |
349
|
|
|
messagebox.showwarning(" FYIT. ", "Cancelled") |
350
|
|
|
sys.exit() |
351
|
|
|
|
352
|
|
|
downbtn = Button(tab1, |
353
|
|
|
text="Download", |
354
|
|
|
relief=SOLID, |
355
|
|
|
font=SubFont, |
356
|
|
|
command=get_fetch, |
357
|
|
|
cursor='hand2' ) |
358
|
|
|
downbtn.place(x=500, y=400, width=200, height=30) # Download button Tab1 |
359
|
|
|
yt_label = Label(tab1, |
360
|
|
|
text="Enter the Link to Download", |
361
|
|
|
font=large_font, |
362
|
|
|
bg="#0B1D6F", |
363
|
|
|
fg="White") |
364
|
|
|
yt_label.place(x=65, y=65) # Label placed in Tab1 |
365
|
|
|
|
366
|
|
|
# -----------------Radio button for video resolution------------------------- |
367
|
|
|
|
368
|
|
|
Rvideo = IntVar() # Variable Daclaraton for Youtube Video (options) |
369
|
|
|
resolution_label = Label(tab1, |
370
|
|
|
text="Video Resolution:", |
371
|
|
|
font=DisFont, |
372
|
|
|
bg="#0B1D6F", |
373
|
|
|
fg="white") |
374
|
|
|
resolution_label.place(x=75, y=200) |
375
|
|
|
R1 = Radiobutton(tab1, |
376
|
|
|
text="Mp4 720", |
377
|
|
|
cursor='hand2', |
378
|
|
|
font=SubFont, |
379
|
|
|
variable=Rvideo, |
380
|
|
|
value=1, |
381
|
|
|
fg=col_show, |
382
|
|
|
bg=yt_col, |
383
|
|
|
activebackground=yt_col, |
384
|
|
|
activeforeground=col_select, |
385
|
|
|
selectcolor=yt_col) |
386
|
|
|
R1.place(x=80, y=240) |
387
|
|
|
R2 = Radiobutton(tab1, |
388
|
|
|
text="Mp4 360px", |
389
|
|
|
cursor='hand2', |
390
|
|
|
font=SubFont, |
391
|
|
|
variable=Rvideo, |
392
|
|
|
value=2, |
393
|
|
|
fg=col_show, |
394
|
|
|
bg=yt_col, |
395
|
|
|
activebackground=yt_col, |
396
|
|
|
activeforeground=col_select, |
397
|
|
|
selectcolor=yt_col) |
398
|
|
|
R2.place(x=80, y=280) |
399
|
|
|
R3 = Radiobutton(tab1, |
400
|
|
|
text="3gp 144px", |
401
|
|
|
cursor='hand2', |
402
|
|
|
font=SubFont, |
403
|
|
|
variable=Rvideo, |
404
|
|
|
value=3, |
405
|
|
|
fg=col_show, |
406
|
|
|
bg=yt_col, |
407
|
|
|
activebackground=yt_col, |
408
|
|
|
activeforeground=col_select, |
409
|
|
|
selectcolor=yt_col) |
410
|
|
|
R3.place(x=80, y=320) |
411
|
|
|
|
412
|
|
|
# -----------------Radio button for video to Audio---------------------------- |
413
|
|
|
|
414
|
|
|
A_Audio = IntVar() # Variable Daclaraton for Youtube Audio (options) |
415
|
|
|
format_label = Label(tab1, |
416
|
|
|
text="Only Audio:", |
417
|
|
|
font=DisFont, |
418
|
|
|
bg="#0B1D6F", |
419
|
|
|
fg="white") |
420
|
|
|
format_label.place(x=260, y=200) |
421
|
|
|
R4 = Radiobutton(tab1, |
422
|
|
|
text="Mp4 Audio", |
423
|
|
|
cursor='hand2', |
424
|
|
|
font=SubFont, |
425
|
|
|
variable=A_Audio, |
426
|
|
|
value=1, |
427
|
|
|
fg=col_show, |
428
|
|
|
bg=yt_col, |
429
|
|
|
activebackground=yt_col, |
430
|
|
|
activeforeground=col_select, |
431
|
|
|
selectcolor=yt_col) |
432
|
|
|
R4.place(x=265, y=240) |
433
|
|
|
R5 = Radiobutton(tab1, |
434
|
|
|
text="webm", |
435
|
|
|
cursor='hand2', |
436
|
|
|
font=SubFont, |
437
|
|
|
variable=A_Audio, |
438
|
|
|
value=2, |
439
|
|
|
fg=col_show, |
440
|
|
|
bg=yt_col, |
441
|
|
|
activebackground=yt_col, |
442
|
|
|
activeforeground=col_select, |
443
|
|
|
selectcolor=yt_col) |
444
|
|
|
R5.place(x=265, y=280) |
445
|
|
|
|
446
|
|
|
# -----------------Radio button for Playlist video -------------------------- |
447
|
|
|
|
448
|
|
|
A_Video = IntVar() # Variable Daclaraton for Youtube Playlist (options) |
449
|
|
|
list_label = Label(tab1, |
450
|
|
|
text="Download Playlist:", |
451
|
|
|
font=DisFont, |
452
|
|
|
bg="#0B1D6F", |
453
|
|
|
fg="white") |
454
|
|
|
list_label.place(x=415, y=200) |
455
|
|
|
R7 = Radiobutton(tab1, |
456
|
|
|
text="High (Default)", |
457
|
|
|
cursor='hand2', |
458
|
|
|
font=SubFont, |
459
|
|
|
variable=A_Video, |
460
|
|
|
value=1, |
461
|
|
|
fg=col_show, |
462
|
|
|
bg=yt_col, |
463
|
|
|
activebackground=yt_col, |
464
|
|
|
activeforeground=col_select, |
465
|
|
|
selectcolor=yt_col) |
466
|
|
|
R7.place(x=420, y=240) |
467
|
|
|
|
468
|
|
|
# ======================= Facebook Control ================================== |
469
|
|
|
|
470
|
|
|
quit_button = Button(tab2, |
471
|
|
|
text="Quit", |
472
|
|
|
relief=SOLID, |
473
|
|
|
font=SubFont, |
474
|
|
|
cursor='hand2', |
475
|
|
|
command=close_btn) |
476
|
|
|
quit_button.place(x=60, y=400, width=200, height=30) # Quit_button placed in tab2 |
477
|
|
|
fb_label = Label(tab2, |
478
|
|
|
text="Enter the Link to Download", |
479
|
|
|
font=large_font, |
480
|
|
|
bg="#075C90", |
481
|
|
|
fg="White") |
482
|
|
|
fb_label.place(x=65, y=65) # Label placed in Tab2 |
483
|
|
|
|
484
|
|
|
def FacebookDownload(): # FacebookDownloader Main Fuction |
485
|
|
|
try: |
486
|
|
|
update_check() |
487
|
|
|
except r.exceptions.HTTPError as err: |
488
|
|
|
messagebox.showinfo("FYIT", "Select Location to Download.") |
489
|
|
|
except r.ConnectionError as e: |
490
|
|
|
messagebox.showinfo("Connection Error", |
491
|
|
|
"Check the Internet Connection") |
492
|
|
|
|
493
|
|
|
try: |
494
|
|
|
html = r.get(var1.get()) |
495
|
|
|
dirname = filedialog.askdirectory(parent=tab2, |
496
|
|
|
initialdir="/", |
497
|
|
|
title='Please select a directory:') |
498
|
|
|
|
499
|
|
|
if dirname: |
500
|
|
|
hdvideo_url = re.search('hd_src:"(.+?)"', html.text)[1] |
501
|
|
|
try: |
502
|
|
|
hd_url = hdvideo_url.replace('hd_src:"', '') |
|
|
|
|
503
|
|
|
messagebox.showinfo("FYIT", "[+] Video Started Downloading") |
504
|
|
|
progress_bar = ttk.Progressbar(tab2, |
505
|
|
|
orient='horizontal', |
506
|
|
|
length=500, |
507
|
|
|
mode='determinate') |
508
|
|
|
progress_bar.place(x=60, y=180) |
509
|
|
|
progress_bar.start() |
510
|
|
|
wget.download(hd_url, dirname) |
511
|
|
|
ERASE_LINE = '\x1b[2K' |
512
|
|
|
sys.stdout.write(ERASE_LINE) |
513
|
|
|
messagebox.showinfo("FYIT", "Video downloaded") |
514
|
|
|
progress_bar.stop() |
515
|
|
|
except r.ConnectionError as e: |
516
|
|
|
messagebox.showerror("FYIT", "ConnectionError") |
517
|
|
|
except r.Timeout as e: |
518
|
|
|
messagebox.showinfo("FYIT", "Tomeout") |
519
|
|
|
except r.RequestException as e: |
520
|
|
|
messagebox.showerror("FYIT", "General Error or Invalid URL") |
521
|
|
|
except (KeyboardInterrupt, SystemExit): |
522
|
|
|
messagebox.showinfo("FYIT", "SystemExit") |
523
|
|
|
sys.exit() |
524
|
|
|
except TypeError: |
525
|
|
|
messagebox.showerror("FYIT", "Video May Private or InvalidURL") |
526
|
|
|
except Exception as e: |
527
|
|
|
messagebox.showwarning("FYIT", "Cancelled") |
528
|
|
|
|
529
|
|
|
downbtnfb = Button(tab2, |
530
|
|
|
text="Download", |
531
|
|
|
relief=SOLID, |
532
|
|
|
font=SubFont, |
533
|
|
|
command=FacebookDownload, |
534
|
|
|
cursor='hand2') |
535
|
|
|
downbtnfb.place(x=500, y=400, width=200, height=30) # Download placed in Tab2 |
536
|
|
|
|
537
|
|
|
# ======================= About Tab Control =================================== |
538
|
|
|
|
539
|
|
|
def check_it(hyper_link): |
540
|
|
|
# About tab Redirect Link (Frame1) |
541
|
|
|
webbrowser.open_new(hyper_link) |
542
|
|
|
|
543
|
|
|
tab3_style = ttk.Style() |
544
|
|
|
|
545
|
|
|
frame1 = tk.Frame(master=tab3, width=260) # Tab3_Frame1 |
546
|
|
|
frame1.pack(fill=tk.BOTH, side=tk.LEFT, expand=True) |
547
|
|
|
|
548
|
|
|
imge = PhotoImage(file='Assets/side_bar.png') |
549
|
|
|
pht = Label(frame1, image=imge) |
550
|
|
|
pht.pack() |
551
|
|
|
|
552
|
|
|
link_1 = Label(frame1, |
553
|
|
|
text="How to use..?", |
554
|
|
|
font=tab_font, |
555
|
|
|
fg="blue", |
556
|
|
|
bg="#90B3DD", |
557
|
|
|
activeforeground="red", |
558
|
|
|
activebackground="green", |
559
|
|
|
cursor="hand2", |
560
|
|
|
underline=0) |
561
|
|
|
link_1.place(x=20, y=260) |
562
|
|
|
link_1.bind("<Button-1>", |
563
|
|
|
lambda e: check_it()) |
564
|
|
|
|
565
|
|
|
link_2 = Label(frame1, |
566
|
|
|
text="Help..!", |
567
|
|
|
font=tab_font, |
568
|
|
|
fg="blue", |
569
|
|
|
bg="#90B3DD", |
570
|
|
|
activeforeground="red", |
571
|
|
|
activebackground="green", |
572
|
|
|
cursor="hand2", |
573
|
|
|
underline=0) |
574
|
|
|
link_2.place(x=20, y=300) |
575
|
|
|
link_2.bind("<Button-1>", |
576
|
|
|
lambda e: check_it("http://bit.ly/site-fyit")) |
577
|
|
|
|
578
|
|
|
link_3 = Label(frame1, |
579
|
|
|
text="Contact us..", |
580
|
|
|
font=tab_font, |
581
|
|
|
fg="blue", |
582
|
|
|
bg="#90B3DD", |
583
|
|
|
activeforeground="red", |
584
|
|
|
activebackground="green", |
585
|
|
|
cursor="hand2", |
586
|
|
|
underline=0) |
587
|
|
|
link_3.place(x=20, y=340) |
588
|
|
|
link_3.bind("<Button-1>", |
589
|
|
|
lambda e: check_it("https://gitter.im/FYIT-DOWNLOADER/DEV-FYI?utm_source=share-link&utm_medium=link&utm_campaign=share-link")) |
590
|
|
|
|
591
|
|
|
link_4 = Label(frame1, |
592
|
|
|
text="Visit us..", |
593
|
|
|
font=tab_font, |
594
|
|
|
fg="blue", |
595
|
|
|
bg="#90B3DD", |
596
|
|
|
activeforeground="red", |
597
|
|
|
activebackground="green", |
598
|
|
|
cursor="hand2", |
599
|
|
|
underline=0) |
600
|
|
|
link_4.place(x=20, y=380) |
601
|
|
|
link_4.bind("<Button-1>", |
602
|
|
|
lambda e: check_it("http://bit.ly/site-fyit")) |
603
|
|
|
|
604
|
|
|
link_5 = Button(frame1, |
605
|
|
|
text="Check Update..", |
606
|
|
|
font=tab_font, |
607
|
|
|
command=find_update, |
608
|
|
|
fg="blue", |
609
|
|
|
bg="#90B3DD", |
610
|
|
|
activeforeground="red", |
611
|
|
|
activebackground="#90B3DD", |
612
|
|
|
cursor="hand2", |
613
|
|
|
relief=FLAT, |
614
|
|
|
underline=0) |
615
|
|
|
link_5.place(x=20, y=420) |
616
|
|
|
link_5.config(highlightthickness=0) |
617
|
|
|
|
618
|
|
|
frame2 = HtmlFrame(master=tab3, width=640, horizontal_scrollbar="auto") # Tab3_Frame2 |
619
|
|
|
frame2.pack(fill=tk.BOTH, side=tk.LEFT, expand=True) |
620
|
|
|
|
621
|
|
|
frame2.set_content(open("Assets/help.html", "r").read()) |
622
|
|
|
|
623
|
|
|
# ----------------------------Fast Youtube Search ---------------- |
624
|
|
|
|
625
|
|
|
cust_font = font = ('Consolas', 16) |
626
|
|
|
width = 800 |
627
|
|
|
height = 500 |
628
|
|
|
img1 = Image.open("Assets/ytsearch_bg.png") |
629
|
|
|
img1 = img1.resize((width, height), Image.ANTIALIAS) |
630
|
|
|
photoImg1 = ImageTk.PhotoImage(img1) |
631
|
|
|
wb1 = Label(tab5, image=photoImg1) |
632
|
|
|
wb1.pack() |
633
|
|
|
|
634
|
|
|
Name_Label = Label(tab5, font=cust_font, |
635
|
|
|
text="Fast Search in Youtube", bg='#232621', fg='#ffffff') |
636
|
|
|
Name_Label.place(x=130, y=140, width=280, height=30) |
637
|
|
|
|
638
|
|
|
Search_Key = StringVar() |
639
|
|
|
|
640
|
|
|
KeyEntry = Entry(tab5, font=cust_font, textvariable=Search_Key) |
641
|
|
|
KeyEntry.place(x=130, y=200, width=550, height=30) |
642
|
|
|
|
643
|
|
|
def Key(): |
644
|
|
|
#pywhatkit.playonyt(Search_Key.get()) |
645
|
|
|
#Search_Key Variable to check the Keyword |
646
|
|
|
|
647
|
|
|
Fs_Search = Video(Search_Key.get()) |
648
|
|
|
Out = Fs_Search.search() |
649
|
|
|
webbrowser.open_new(Out) |
650
|
|
|
|
651
|
|
|
|
652
|
|
|
Search_Button = Button(tab5, font=cust_font, text="Search", command=Key) |
653
|
|
|
Search_Button.place(x=530, y=320, width=150, height=30) |
654
|
|
|
tab5.update() |
655
|
|
|
|
656
|
|
|
# ----------------------- Whatsapp Screen----------------------------------- |
657
|
|
|
|
658
|
|
|
cust_font1 = font = ('Consolas', 14) |
659
|
|
|
width1 = 800 |
660
|
|
|
height1 = 500 |
661
|
|
|
img = Image.open("Assets/whatsapp_bg.png") |
662
|
|
|
img = img.resize((width1, height1), Image.ANTIALIAS) |
663
|
|
|
photoImg = ImageTk.PhotoImage(img) |
664
|
|
|
wb = Label(tab4, image=photoImg) |
665
|
|
|
wb.pack() |
666
|
|
|
|
667
|
|
|
MobNum = StringVar() |
668
|
|
|
Mob2msg = StringVar() |
669
|
|
|
hour = IntVar() |
670
|
|
|
minutes = IntVar() |
671
|
|
|
|
672
|
|
|
Number = Label(tab4, text="Enter the Mobile No", |
673
|
|
|
font=cust_font1, bg="#1B1B19", fg="#ffffff") |
674
|
|
|
Number.place(x=100, y=70, width=200, height=30) |
675
|
|
|
|
676
|
|
|
Message = Label(tab4, text="Enter the Message", |
677
|
|
|
font=cust_font1, bg="#1B1B19", fg="#ffffff") |
678
|
|
|
Message.place(x=100, y=120, width=185, height=30) |
679
|
|
|
|
680
|
|
|
hourlabel = Label(tab4, text="Enter Schedule Time", |
681
|
|
|
font=cust_font1, bg="#1B1B19", fg="#ffffff") |
682
|
|
|
hourlabel.place(x=100, y=260, width=210, height=30) |
683
|
|
|
|
684
|
|
|
Shutdown_label = Label(tab4, text="Enter Shutdown Timer", |
685
|
|
|
font=cust_font1, bg="#1B1B19", fg="#ffffff") |
686
|
|
|
Shutdown_label.place(x=100, y=310, width=220, height=30) |
687
|
|
|
|
688
|
|
|
hrs_label = Label(tab4, text="hrs", |
689
|
|
|
font=cust_font1, bg="#1B1B19", fg="#ffffff") |
690
|
|
|
hrs_label.place(x=400, y=260, width=100, height=30) |
691
|
|
|
|
692
|
|
|
mins_label = Label(tab4, text="mins.", |
693
|
|
|
font=cust_font1, bg="#1B1B19", fg="#ffffff") |
694
|
|
|
mins_label.place(x=560, y=260, width=100, height=30) |
695
|
|
|
|
696
|
|
|
shut_label = Label(tab4, text="seconds.", |
697
|
|
|
font=cust_font1, bg="#1B1B19", fg="#ffffff") |
698
|
|
|
shut_label.place(x=430, y=310, width=100, height=30) |
699
|
|
|
|
700
|
|
|
Entrynum = Entry(tab4, textvariable=MobNum, font=cust_font) |
701
|
|
|
Entrynum.insert(0,"+91") |
702
|
|
|
Entrynum.place(x=350, y=70, width=300, height=30) |
703
|
|
|
|
704
|
|
|
Entrymsg = Text(tab4, font=cust_font) |
705
|
|
|
Entrymsg.place(x=350, y=120, width=300, height=120) |
706
|
|
|
|
707
|
|
|
hours = Spinbox(tab4, textvariable=hour, font=cust_font, from_=0, to=23) |
708
|
|
|
hours.place(x=350, y=260, width=70, height=30) |
709
|
|
|
|
710
|
|
|
mins = Spinbox(tab4, textvariable=minutes, font=cust_font, from_=0, to=59) |
711
|
|
|
mins.place(x=500, y=260, width=70, height=30) |
712
|
|
|
|
713
|
|
|
sleep = IntVar() |
714
|
|
|
|
715
|
|
|
def shut_timer(): |
716
|
|
|
sh_time = sleep.get() |
717
|
|
|
|
718
|
|
|
if sh_time == 0: |
719
|
|
|
try: |
720
|
|
|
pywhatkit.cancelShutdown() |
721
|
|
|
messagebox.showinfo("Shutdown Timer", "Shutdown timer is not fixed") |
722
|
|
|
except NameError: |
723
|
|
|
messagebox.showinfo("Shutdown Timer", "Shutdown timer is not fixed") |
724
|
|
|
|
725
|
|
|
elif sh_time <= 86400: |
726
|
|
|
messagebox.showinfo("Shutdown Timer", "When we sent WhatsApp message PC will shutdown after fixed timer") |
727
|
|
|
pywhatkit.shutdown(time=sh_time) |
728
|
|
|
else: |
729
|
|
|
messagebox.showinfo("Shutdown Timer", "Shutdown timer is Greater than 24hrs.") |
730
|
|
|
|
731
|
|
|
def go(): |
732
|
|
|
messagebox.showinfo("AutoWhatsappMessage", |
733
|
|
|
"Will open web.whatsapp.com at before 1 minute of Scheduled time and message \ |
734
|
|
|
will be send Automatically at Scheduled time exactly Given") |
735
|
|
|
|
736
|
|
|
try: |
737
|
|
|
num = MobNum.get() |
738
|
|
|
msg = Entrymsg.get("1.0", "end-1c") |
739
|
|
|
hr = hour.get() |
740
|
|
|
mini = minutes.get() |
741
|
|
|
|
742
|
|
|
if (1 ==1): |
743
|
|
|
try: |
744
|
|
|
import pywhatkit |
745
|
|
|
except Exception as e: |
746
|
|
|
messagebox.showwarning("No Internet or Internet is Slow", "Check Internet Connection") |
747
|
|
|
else: |
748
|
|
|
messagebox.showwarning("No Internet or Internet is Slow", "Check Internet Connection") |
749
|
|
|
shut_timer() |
750
|
|
|
pywhatkit.sendwhatmsg(num, msg, hr, mini) |
751
|
|
|
except pywhatkit.CallTimeException: |
752
|
|
|
messagebox.showerror("AutoWhatsAppMessage", |
753
|
|
|
"Set Schedule time More than 1 minute from Current Time") |
754
|
|
|
except pywhatkit.CountryCodeException: |
755
|
|
|
messagebox.showerror("AutoWhatsAppMessage", |
756
|
|
|
"Please Ensure the mobile number & Coutry code.") |
757
|
|
|
|
758
|
|
|
sleep_time = Spinbox(tab4, textvariable=sleep, font=cust_font, from_=0, to=86399) |
759
|
|
|
sleep_time.place(x=350, y=310, height=30, width=80) |
760
|
|
|
|
761
|
|
|
GoCheck = Button(tab4, text="Start Schedule", command=go, font=cust_font) |
762
|
|
|
GoCheck.place(x=300, y=405) |
763
|
|
|
|
764
|
|
|
|
765
|
|
|
|
766
|
|
|
|
767
|
|
|
label = Label(tab4, |
768
|
|
|
text="Time must be in 24 hours Format & Country Code is Must.", |
769
|
|
|
font=cust_font1, bg="#1B1B19", fg="#ffffff") |
770
|
|
|
|
771
|
|
|
infinity = 1 |
772
|
|
|
while infinity == 1: |
773
|
|
|
for i in range(500): |
774
|
|
|
xpos = i |
775
|
|
|
label.place(x=xpos, y=20) |
776
|
|
|
time.sleep(0.01) |
777
|
|
|
if xpos == 500: |
778
|
|
|
xpos = 0 |
779
|
|
|
tab4.update() |
780
|
|
|
|
781
|
|
|
|
782
|
|
|
|
783
|
|
|
|
784
|
|
|
|
785
|
|
|
# ----------------------------- Close Function ------------------------------- |
786
|
|
|
|
787
|
|
|
top.config(bg='black') |
788
|
|
|
|
789
|
|
|
top.mainloop() |
790
|
|
|
|
791
|
|
|
def on_close(): |
792
|
|
|
top.destroy() |
793
|
|
|
sys.exit() |
794
|
|
|
|
795
|
|
|
top.protocol("WM_DELETE_WINDOW", on_close) |
796
|
|
|
|