-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
36 lines (29 loc) · 896 Bytes
/
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
import utils
from spleeter.audio import Codec
def process_inputs_file(
inputs_file_path: str,
download_output: str,
separations_output: str,
separations_codec: Codec
):
def process_single_url(url_str: str) -> dict:
download_info = utils.download_youtube_audio(
url=url_str,
output_path=download_output
)
separation_info = utils.separate_4stems(
input_path=download_info.output_os_path,
output_path=separations_output,
codec=separations_codec
)
return {'download_info': download_info, 'separation_info': separation_info}
with open(inputs_file_path, 'r', encoding="utf-8") as file:
for url_str in file:
process_single_url(url_str)
if __name__ == '__main__':
process_inputs_file(
inputs_file_path='inputs.txt',
download_output='my_test',
separations_output='separated',
separations_codec=Codec.MP3
)