Spaces:
Paused
Paused
Download app.py from TypeGPT/Youtube_Transcript: direct link, hf CLI and curl.
- Browser
- Download file 725 Bytes
-
https://huggingface.co/spaces/TypeGPT/Youtube_Transcript/resolve/main/app.py
- Command line
-
hf download hf://spaces/TypeGPT/Youtube_Transcript/app.py
-
curl -L -o app.py https://huggingface.co/spaces/TypeGPT/Youtube_Transcript/resolve/main/app.py
725 Bytes
| import streamlit as st | |
| from youtube_transcript_api import YouTubeTranscriptApi | |
| import urllib.parse as urlparse | |
| from pytube import extract | |
| transcript = "" | |
| def read_file(_id): | |
| tx = YouTubeTranscriptApi.get_transcript(_id) | |
| my_list = [] | |
| for i in tx: | |
| curr_str = i["text"].replace("\xa0", "").replace("\n", " ") | |
| my_list.append(curr_str) | |
| transcript = " ".join(str(x) for x in my_list) | |
| st.markdown(transcript) | |
| st.title('Easily Transcribe YouTube Videos - ChatGPTBots.net') | |
| link = st.text_input('Enter your YouTube video link', 'https://www.youtube.com/watch?v=F6PqxbvOCUI') | |
| if link is not None: | |
| print(link) | |
| _id=extract.video_id(link) | |
| st.video(link) | |
| st.button('Check Status', on_click=read_file(_id)) | |