#!/opt/local/bin/python2.7 #!/usr/bin/env python # -*- coding: UTF-8 -*- #--------------------------- # Name: delete_recordings.py # Python Script # Original Author: Raymond Wagner # Modified by: Scott Gruby # Purpose # This python script provides a command line tool to search and # delete recordings. #--------------------------- from MythTV import MythDB, MythLog import sys import datetime from datetime import timedelta today = datetime.datetime.today()-timedelta(days=2) older_string = today.strftime('%Y-%m-%dT%H:%M:%S') force = True recs = list(MythDB().searchRecorded(olderthan=(older_string))) if len(recs) == 0: print 'no matching recordings found' sys.exit(0) for rec in recs: #print 'deleting ',str(rec) rec.delete() sys.exit(0)