This is my script.

```
import MySQLdb import feedparser import string

def checkunique(t):
    #t1 = ''.join(filter(lambda c: c in string.printable, t))
    cur.execute("SELECT title from linkstwo")
    titles = cur.fetchall()
    for k in titles:
        #k1 = ''.join(filter(lambda c: c in string.printable, k))
        print "'%s'" % k
        if t == k:
            return False
    return True

db = MySQLdb.connect ("localhost","root",password,"torrents") print "DB connection successful" cur  = db.cursor()

url = "https://extratorrent.cc/rss.xml?type=popular&cid=4"

feed = feedparser.parse(url)

print "Parsing successful"

for post in feed.entries:
    t = post.title
    m = post.magneturi
    #print "'%s'" % t
    if checkunique(t):
       cur.execute("INSERT INTO linkstwo (title, maglink) VALUES ('%s', '%s')" % \
                    (t, m))
    db.commit()

print "Script ended"

```

It parses an RSS feed and adds any new entries to a database.

My problem is the the function `checkunique` always returns true and I keep getting duplicate entries. I tried some of the solutions to remove any non-printable characters that might have found its way in, still no luck.