Parser.add_argument('-max-results', help='Max results', default=3) Parser.add_argument('-q', help='Search term', default='Google') Videos.append('%s' % (search_result))Įlif search_result = 'youtube#channel':Ĭhannels.append('%s' % (search_result))Įlif search_result = 'youtube#playlist': Youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=DEVELOPER_KEY)įor search_result in search_response.get('items', ): Please! Here is my following code: import argparseįrom googleapiclient.discovery import buildįrom googleapiclient.errors import HttpError Does anyone know of a way to play youtube audio/video through python without downloading the video first? I would think it is possible with a cmd line tool such as mplayer or vlc using the sub process to pop open a cmd for the cmd line and pass in the url, but I am stuck. So far, I am able to search for videos or playlists using youtube data api, grab the first video or playlist and pass it into pafy to get different streaming urls. I have tried numerous things but none really seem to work. I have been trying to create a way to stream a youtube url (preferably audio only, although this doesn't matter too much) right from python code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |