File size: 1,167 Bytes
34b3dac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import subprocess
import os
from IPython.display import Audio
import urllib.request

import streamlit as st
import streamlit.components.v1 as components
from PIL import Image

# with open('style.css') as f:
#     st.markdown(f'<style>{f.read()}</style>',unsafe_allow_html=True)


def main():
    title = "Youtube to audio coversion tool by Proxima PK"
    st.title(title)
    # image = Image.open('PROXIMA LOGO.png')
    # st.image(image, use_column_width=True)


    with st.spinner(f'Downloading Audio.... '):
        link = st.text_input('youtube link')
        st.write('The current vedio link you give is ', link)

        yt="https://youtu.be/7wtfhZwyrcc"
        b =" youtube-dl --extract-audio --audio-format wav {} ".format(link)
        c = "youtube-dl --get-title {}".format(link)
        
        download = subprocess.call(b,shell=True)
        
        name=subprocess.check_output(c)
        a = str(name)

        x = a.replace("b'", "")
        print(x)
        v = x.replace("n'", "")
        print(v)
        finalname = v.replace(v[-1], "")
        print(finalname)
        st.write(finalname)

      



    
if __name__ == '__main__':
    main()