mrtopf.de

Suche
Close this search box.

Announcement: bliptv.reader for easy access to blip.tv hosted videos from Python

Motivation

Right now I am in the process of converting all of the EuroPython conference footage for streaming on the web in order to publish it on COM.lounge TV and the EuroPython blog. This means not only some work in editing and converting but also in uploading it and making blog posts out of them.

As video hosting service I use blip.tv which is a great service because it gives you quite a lot of flexibility. It even has blog functionality included and allows you to cross-post your videos to many services including your external blog. The downside however is that you cannot really control how that blog post looks like.

Because of this I was searching for a solution which gives me easy access to my videos on blip.tv in order to format them myself and upload them to COM.lounge TV (which is a wordpress blog) via the this Python library for WordPress (PyPI record).

The same should happen for the EuroPython blog but the difference here is that it’s a blog hosted on wordpress.com and does not support embeds but only certain short codes. So I also need to be able to generate those short codes automatically.

In order to automate this as much as possible I needed an easy to use API for accessing my video files on blip.tv and bliptv.reader was born.

bliptv.reader

Here is a little example of how you can use it:


from bliptv.reader import Show
show = Show('comlounge') # show name to use

# get page 1 (most recent episodes)
page1 = show.episodes.pages[1]

# get the next page (older episodes)
page2 = page1.next

# get one episode (the page is a list like object)
episode = page1[0]

# get the URL and title and other information about the episode
url = episode.url
title = episode.title
rating = episode.rating
description = episode.description # HTML version
puredesc = episode.pureDescription # plain text version
keywords = episode.keywords # tags as a list

# now retrieve the enclosures
enclosures = episode.enclosures

# get the flash version and some properties of it
flash = enclosures['video/x-flv']
filesize = flash.filesize
width = flash.width
height = flash.height
url = flash.url # this is the actual flv file

As you can see, everything I need should be included and I can easily create my blog entry from it (e.g. by using the JW FLV Player).
You can read the full documentation on the bliptv.reader PyPI page.

Download and Installation

The easiest way to install it is of course EasyInstall. If you don’t have it you can of course still install it manually (but you need to have setuptools installed. This will be changed in the next release to make it also work with plain distutils). You can find everything on the PyPI page for it. I will put up the source code on Google Code as well soon.

Download bliptv.reader

TODO

In the next release I will add support for accessing the shortcode of an episode in order to be able to create the codesnippet needed for wordpress.com. Probably even more information could be exposed such as license, more information about the actual show etc. As mentioned above the setup routine will then also be made distutils compatible. More in the future one could also see a writer which help uploading videos to blip.tv etc.

Teile diesen Beitrag