Video information print out
This commit is contained in:
parent
f97e6b5b1c
commit
f0dbb580b2
@ -27,9 +27,10 @@ class YouTubeAPI(object):
|
|||||||
title = snippet['title']
|
title = snippet['title']
|
||||||
date = snippet['publishedAt']
|
date = snippet['publishedAt']
|
||||||
channel = snippet['channelTitle']
|
channel = snippet['channelTitle']
|
||||||
|
channelId = snippet['channelId']
|
||||||
description = snippet['description']
|
description = snippet['description']
|
||||||
tags = snippet['tags']
|
tags = snippet['tags']
|
||||||
privacy = status['privacyStatus']
|
privacy = status['privacyStatus']
|
||||||
return title, date, channel, description, tags, privacy
|
return title, date, channel, channelId, description, tags, privacy
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,4 +8,10 @@ def getYouTubeAPIKey():
|
|||||||
return open('youtube.key', 'r').read()
|
return open('youtube.key', 'r').read()
|
||||||
|
|
||||||
api = YouTubeAPI(getYouTubeAPIKey())
|
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user