else/TotalDL/timesearch_dl.py

18 lines
416 B
Python
Raw Normal View History

2015-05-15 06:02:21 +00:00
import sqlite3
import totaldl
sql = sqlite3.connect('!!testdata.db')
cur = sql.cursor()
cur.execute('SELECT * FROM posts WHERE self=0 AND url IS NOT NULL')
while True:
item = cur.fetchone()
if item is None:
break
2015-05-15 21:46:32 +00:00
title = item[6]
for character in '\\/?:*"><|.':
title = title.replace(character, '')
if len(title) > 35:
title = title[:34] + '-'
2015-05-15 06:02:21 +00:00
url = item[7]
2015-05-15 21:46:32 +00:00
totaldl.handle_master(url, customname=title)