I wrote a simple Python script youtube-video-info to dump any information of a YouTube video. It does more than I wanted. Using videos.list to retrieve any data the API can provide, you can view a sample output on the Gist.
It can list multiple videos and any combination of parts from the following list:
- id
- snippet
- contentDetails
- fileDetails
- liveStreamingDetails
- player
- processingDetails
- recordingDetails
- statistics
- status
- suggestions
- topicDetails
Default are snippet, contentDetails, player, statistics, and status. If you include some parts which require authorization, you can use --auth to authorize this script to access the private data, a yt.dat credential file would be created if successful.
For example:
./youtube-video-info -a \
-p snippet fileDetails status suggestions -- ID1 ID2 ID3
Note that -- is used to indicate the end of parts.
The output format isn’t easy to read, because I only wanted to grab the thumbnail URL, so I could use image instead of embedding a Flash in my blog posts, therefore simple sections with prettyprint is all it does.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.