Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Simple asx decoder (See related posts)

asx decoder: associate it to MIME: video/x-ms-asf in your browser.

#! /usr/bin/env python

from xml.dom.minidom import parse;
from sys import argv
from os import system

if __name__ == '__main__':
    if len(argv)>1:
# print >> file('/tmp/asp.log', 'w'), argv 
        d = parse(file(argv[1]));
        links = [ ref.getAttribute('HREF')
                  for ref in d.getElementsByTagName('REF')
                  if ref.hasAttribute('HREF') ]
        for link in links:
            system('mplayer ' + link)



You need to create an account or log in to post comments to this site.


Related Posts