Balsamiq Mockups, donated license

The wonderful folks at Balsamiq have graciously donated a license for their Mockups user interface design software to the Tubecaster project to help with future improvements.  I just want to say a huge thank you to Mariah and the Balsamiq team for this, and to encourage everyone to check out this fantastic piece of software.

Tubecaster Balsamiq interface

Tubecaster Balsamiq interface

Python Line Counter

Yesterday I was looking for a Python source code line counter to give me a summary of some source files, but I couldn’t find a free one that would do the job as I wanted. So I created one. And you can have it for free (GNU GPL) – download it here:

Download Python Line Counter

Sample usage:

cmd> plc.py tubecore.py tubewx.py tubewxdialogs.py

Input files:
tubecore.py
tubewx.py
tubewxdialogs.py

Total lines:   1510
Code lines:    1111
Comment lines: 139
Blank lines:   260

-Wayne

Tubecaster 2.0.1 Released!

I’m pleased to report that Tubecaster 2.0.1 for Windows is now available for download.  Click here to go to the downloads page on the Tubecaster homepage.

Highlights of this release:

  • Supported media formats:
    • MP3
    • FLAC
    • WAV
    • Ogg Vorbis
    • AVI
    • MPG
    • MP4
    • 3GP
  • Additional language support: Afrikaans
  • Automatically downloads HD version of the chosen video if available
  • Proxy server support
  • Login support – for downloading videos marked as private or age restricted

I’m keen to get feedback on what people would like to see in the next release.  You can report bugs or request new features here.  On that same site you can also vote for features that have already been requested.  The more votes a feature gets the more likely and quickly it is to be implemented.

-Wayne

DPAPI user-mode access in Python

In the latest version of Tubecaster I’ve come to the point of needing to give users the option of storing passwords on disk. Needless to say the very thought sent shivers down my spine. I was stressing over the problem of how to store passwords for automatic retrieval and use by the software, but at the same time making them secure enough that they can’t easily be retrieved by nasty people. This led me to make this post on Stack Overflow.

Read More →

Python proxy client connections requiring authentication using urllib2 ProxyHandler

I’ve been playing around with trying to pass HTTP connections through a proxy server requiring authentication from Python and after a few hours of hunting around I’ve managed to find enough bits of information to cobble together into a working example.  Since I couldn’t find such an example myself I’ve put this one together.  It looks simple now, which it is (thanks Python!), but unfortunately I couldn’t find any documentation that presented it this clearly.

Just substitute the appropriate variable values and it should run as is.

# urllib2_proxy_handler.py
#
# Author: Wayne Koorts
# Date:   27/10/2008
#
# Example for using urllib2.urlopen() with a proxy server requiring authentication

import urllib2

uri = "http://www.python.org"
http_proxy_server = "someproxyserver.com"
http_proxy_port = "3128"
http_proxy_realm = http_proxy_server # Worked in my (limited) testing environment.
http_proxy_user = "username"
http_proxy_passwd = "password"

# Next line = "http://username:password@someproxyserver.com:3128"
http_proxy_full_auth_string = "http://%s:%s@%s:%s" % (http_proxy_user,
                                                      http_proxy_passwd,
                                                      http_proxy_server,
                                                      http_proxy_port)

def open_url_no_proxy():
    urllib2.urlopen(uri)
    
    print "Apparent success without proxy server!"
        
def open_url_installed_opener():
    proxy_handler = urllib2.ProxyHandler({"http": http_proxy_full_auth_string})
    
    opener = urllib2.build_opener(proxy_handler)
    urllib2.install_opener(opener)
    urllib2.urlopen(uri)
    
    print "Apparent success through proxy server!"
    
if __name__ == "__main__":
    open_url_no_proxy()
    open_url_installed_opener()

Tested using an Ubuntu 8.04 Server Edition proxy server with a mostly out-of-the-box Squid installation using ncsa_auth authentication.

-Wayne