-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
52 lines (44 loc) · 1.97 KB
/
main.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
from config import run, configure
from scr import Downloader
custom_video_downloader = Downloader()
@custom_video_downloader.app.command(name='youtube', help="Method to download a video from a youtube link", short_help="Download youtube video")
def download_video(
stage = custom_video_downloader.get_stage_options(),
link = custom_video_downloader.get_link_options(),
file_type = custom_video_downloader.get_file_type_options(),
output = custom_video_downloader.get_output_options(),
):
config = configure(stage)
run(
config=config, command="youtube",
link=link, output_path=output, file_type=file_type
)
config.logger.info("Task completed")
@custom_video_downloader.app.command(name='instagram', help="Method to download a video from an instagram link", short_help="Download instagram video")
def download_video(
stage = custom_video_downloader.get_stage_options(),
link = custom_video_downloader.get_link_options(),
file_type = custom_video_downloader.get_file_type_options(),
output = custom_video_downloader.get_output_options(),
):
config = configure(stage)
run(
config=config, command="instagram",
link=link, output_path=output, file_type=file_type
)
config.logger.info("Task completed")
@custom_video_downloader.app.command(name='facebook', help="Method to download a video from a facebookl link", short_help="Download facebook video")
def download_video(
stage = custom_video_downloader.get_stage_options(),
link = custom_video_downloader.get_link_options(),
file_type = custom_video_downloader.get_file_type_options(),
output = custom_video_downloader.get_output_options(),
):
config = configure(stage)
run(
config=config, command="facebook",
link=link, output_path=output, file_type=file_type
)
config.logger.info("Task completed")
if __name__ == "__main__":
custom_video_downloader.app()