import sqlite3
import os

db_path = r'\\ll\\d\\xtrssvjj\\dpd.db'
print('Checking database:', db_path)

if os.path.exists(db_path):
    print('Database exists')
    conn = sqlite3.connect(db_path)
    c = conn.cursor()
    
    # 查询前10行，包含idx字段
    c.execute('SELECT idx, start, end, en FROM srts WHERE adname LIKE ? ORDER BY idx LIMIT 10', ("%睡觉是人生头等大事%",))
    rows = c.fetchall()
    print('\nFound', len(rows), 'rows with idx:')
    for row in rows:
        idx = row[0]
        start = row[1] / 1000.0  # 转换为秒
        end = row[2] / 1000.0    # 转换为秒
        text = row[3]
        print(f'idx={idx}: start={start:.2f}s, end={end:.2f}s, text="{text}"')
    
    conn.close()
else:
    print('Database file not found')