Video information print out

This commit is contained in:
Christian Colglazier 2021-06-28 16:13:04 -04:00
parent f97e6b5b1c
commit f0dbb580b2
2 changed files with 9 additions and 2 deletions

View File

@ -27,9 +27,10 @@ class YouTubeAPI(object):
title = snippet['title']
date = snippet['publishedAt']
channel = snippet['channelTitle']
channelId = snippet['channelId']
description = snippet['description']
tags = snippet['tags']
privacy = status['privacyStatus']
return title, date, channel, description, tags, privacy
return title, date, channel, channelId, description, tags, privacy

View File

@ -8,4 +8,10 @@ def getYouTubeAPIKey():
return open('youtube.key', 'r').read()
api = YouTubeAPI(getYouTubeAPIKey())
print(api.getVideoInfo(sys.argv[1]))
title, date, channel, channelId, description, tags, privacy = api.getVideoInfo(sys.argv[1])
print('Title: ' + title)
print('Date: ' + date)
print('Channel: {} ({})'.format(channel, channelId) )
print('Description: ' + description)
print('Tags: ', tags)
print('Privacy: ' + privacy)