Closed josondev closed 4 months ago
Could this, be related to this error by any chance?
https://github.com/jdepoix/youtube-transcript-api/issues/299
Hi @josondev,
First of all, your issue description contained your OpenAI API Key. I edited it to remove it. Please be more careful about this in the future!
It seems that your issues regards the video qcphMpZ4sU
. If I open it on YouTube it says "Video is not available", which explains why you can't get transcripts for it.
DO NOT DELETE THIS! Please take the time to fill this out properly. I am not able to help you if I do not know what you are executing and what error messages you are getting. If you are having problems with a specific video make sure to include the video id.
To Reproduce
Steps to reproduce the behavior:
What code / cli command are you executing?
Im running the code in Google colab and getting the error TranscriptsDisabled
TranscriptsDisabled in <cell line: 5>()
166 from youtube_transcript_api import YouTubeTranscriptApi
167 video_id=input('enter youtube video link:')[33:]
--> 168 transcript=YouTubeTranscriptApi.get_transcript(video_id)
169 search_agent=SearchAgent.add_youtube(transcript)
170 #while(1):
Traceback (most recent call last)
3 frames /usr/local/lib/python3.10/dist-packages/youtube_transcript_api/_transcripts.py in _extract_captions_json(self, html, video_id) 60 raise VideoUnavailable(video_id) 61 ---> 62 raise TranscriptsDisabled(video_id) 63 64 captions_json = json.loads(
TranscriptsDisabled: Could not retrieve a transcript for the video https://www.youtube.com/watch?v=qcphMpZ4sU! This is most likely caused by:
Subtitles are disabled for this video
If you are sure that the described cause is not responsible for this error and that a transcript should be retrievable, please create an issue at https://github.com/jdepoix/youtube-transcript-api/issues. Please add which version of youtube_transcript_api you are using and provide the information needed to replicate the error. Also make sure that there are no open issues which already describe your problem!
key=''
ans=input('voice or search or chat or generator or summariser:')
if(ans=='voice'): from lyzr import VoiceBot vb=VoiceBot(api_key=key) ans=input('Text-to-speech or Transcribe or Text-to-notes:') if(ans=='Text-to-speech'): vb.text_to_speech(input('enter the text to be converted to speech:')) print('Successful execution.Please check the files.') elif(ans=='Text-to-notes'): print(vb.text_to_notes(input('enter the text to be converted to notes:'))) else: print(vb.transcribe(input('enter the audio file to be converted to text:')))
elif(ans=='summariser'): from lyzr import Summarizer summarizer = Summarizer(api_key=key) ans=input('enter the text to be converted to a summary:') instructions=input('suummary,notes or tweet:') print(summarizer.summarize(ans))
elif(ans=='generator'): from lyzr import Generator generator=Generator(api_key=key) ans=input('enter the topic to be expanded:') persona=input('target audience:') print(generator.generate(ans))
else:
Prompt user to upload a folder
if(ans=='chat'): from google.colab import files import os from lyzr import ChatBot os.environ['OPENAI_API_KEY'] = key ans=input('word document or pdf or youtube video or website or webpage or text file:') if(ans=='pdf'): while(1): try: uploaded = files.upload() # Returns a dictionary filename = next(iter(uploaded)) '''with open(filename, 'wb') as f: # Save the uploaded file f.write(uploaded[filename])''' # Get the filename chatbot = ChatBot.pdf_chat(input_files=[filename]) # Pass the filename to pdf_chat ans = input("Your question here:") response = chatbot.chat(ans) print(response.response) break except: print('please enter the correct pdf file.')
else:
else: