import web_resource as web_r import os import threading import youtube_api import util import os import google.auth import datetime from googleapiclient.discovery import build from youtube_transcript_api import YouTubeTranscriptApi

    class YouTubeAPI(web_r.web_results) :

                     def result_from_youtube(self, related_questions:dict)->dict: ""
                                                                                  " 
                                             Given questions as a list of related questions to a user input question, return youtube video captions by searching the sub - questions on youtube

                                             input:a dictionary with a user input question as key and sub - questions as value return :a dictionary with following format: {"result" : [{"question" : "What is the best way to learn Python?", "question_list" : [{"name" : "What is the best way to learn Python?", "url" : "https:                " content ": " I have been learning Python for a few months no "
}, {... }, ...] }] }

                                                                                                                                                                                         question:the user input question(key) question_list:name:one of the questions in the input url:the youtube video in answer to that question content:video caption.Should be after removing stop words ""
                                                                                                                                                                                                                                                                                                                                                                                               "

                                                                                                                                                                                                                          ##loop though questions and call youtube api on each result = self.search_youtube_transcript("")

#collect result and remove stop words
                                                                                                                                                                                                                                                                                                                           result = util.remove_stopwords(result)

                                                                                                                                                                                                                                                                                                                               result_list =[] for key, value in related_questions.items() :question_list =[] for question in value:question_list.append({"name" :question, "url" : "", "content" :result[question] }) result_list.append({"question" :key, "question_list" :question_list }) return {"result" :result_list }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          pass