diff -rU3 au_xmltvgen_austext-1.0/au_xmltvgen_austext.py au_xmltvgen_austext-1.1/au_xmltvgen_austext.py
--- au_xmltvgen_austext-1.0/au_xmltvgen_austext.py	2005-03-20 18:34:24.000000000 +1030
+++ au_xmltvgen_austext-1.1/au_xmltvgen_austext.py	2005-03-28 07:06:45.511641896 +0930
@@ -26,7 +26,7 @@
 
 http://www.ratemyrackmountedserver.com/~michael/projects/au_xmltvgen_austext/
 
-For more info, please read the fine man page.
+For more info, please read the website.
 """
 
 import sys, httplib, re, string, time
@@ -145,8 +145,46 @@
 			while currentChr < 41:
 				programString = programString + pagearr[currentLine][currentChr]
 				currentChr = currentChr + 1
-			programString = string.replace(programString, "& ", "&amp; ", 2);
+			programString = string.replace(programString, "& ", "&amp; ", 2)
+			programString = string.rstrip(programString)
+			if re.search("Movie ", programString):
+				# Program is a movie
+				programString = string.replace(programString, "Movie ", "", 1)
+
+			# Is the program captioned?
+			if re.search("CC\\)", programString):
+				closedCaptions = 1
+			else:
+				closedCaptions = 0
+			
+			# Find a program's rating
+			rating = "G"
+			if re.search("[(]MA", programString):
+				rating = "MA"
+			elif re.search("[(]M", programString):
+				rating = "M"
+			elif re.search("[(]PG", programString):
+				rating = "PG"
+
+			# Trim the rating and closed captions status off the end.			
+			trimAmount = 0
+			if not rating == "G":
+				if rating == "M":
+					trimAmount = 4
+				else:
+					trimAmount = 5
+
+			if closedCaptions == 1:
+				if trimAmount > 0:
+					trimAmount = trimAmount + 3
+				else:
+					trimAmount = 5
+
+			programString = programString[0:len(programString) - trimAmount]				
 			print "<title lang=\"en\">" + programString + "</title>"
+			if closedCaptions == 1:
+				print "<subtitles type=\"teletext\" />"
+			print "<rating system=\"au\"><value>" + rating + "</value></rating>"
 			print "</programme>"
 		currentLine = currentLine + 1
 	return 1

