-
Notifications
You must be signed in to change notification settings - Fork 10
/
web-dl.py
executable file
·49 lines (38 loc) · 1.09 KB
/
web-dl.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
#!/usr/bin/env python3
import modules.args as args
import modules.assets as assets
import modules.downloader as downloader
import modules.decryptor as decryptor
# === Ctrl+C === #
assets.ctrl_c()
# === MAIN === #
def main():
"""
Main program flow.
"""
# Banner
assets.banner(); assets.divider()
# Arguments
args.init_args()
# Hide cursor
assets.cursor_hide()
# Checking for DRM protections
encrypted = downloader.is_encrypted(args.url())
if not encrypted:
# Download content
downloader.get_content(args.url())
else:
# Download encrypted content
downloader.get_enc_content(args.url())
# Extract KID, PR_PSSH, WV_PSSH, KEY
video_keys, audio_keys = decryptor.extract_keys(args.url())
# Decrypt content
decryptor.decrypt(video_keys, audio_keys)
# Merge video & audio files
if downloader.merge(args.output()):
# Delete cache files if merged correctly
downloader.delete_cache()
# Show cursor
assets.cursor_show()
if __name__ == "__main__":
main()