22 lines
584 B
Python
22 lines
584 B
Python
#!/usr/bin/env python3
|
|
|
|
from youtube_api import YouTubeAPI
|
|
import sys
|
|
|
|
# Read YouTube API Key.
|
|
def getYouTubeAPIKey():
|
|
return open('youtube.key', 'r').read()
|
|
|
|
# Print out information about a video.
|
|
def printVideoInfo(info):
|
|
title, date, channel, channelId, description, tags, privacy = info
|
|
print('Title: ' + title)
|
|
print('Date: ' + date)
|
|
print('Channel: {} ({})'.format(channel, channelId) )
|
|
print('Description: ' + description)
|
|
print('Tags: ', tags)
|
|
print('Privacy: ' + privacy)
|
|
|
|
api = YouTubeAPI(getYouTubeAPIKey())
|
|
print(len(api.getPlaylistVideos(sys.argv[1])))
|