#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sqlite3

db_path = r'\\ll\D\xtrssvjj\db\dpd.db'
adid = 8437

try:
    conn = sqlite3.connect(db_path)
    cursor = conn.cursor()
    
    cursor.execute("SELECT COUNT(*) FROM srts WHERE adid = ?", (adid,))
    count = cursor.fetchone()[0]
    
    print(f"苏小小的美丽传说 (adid={adid}) 总共有 {count} 句字幕")
    
    # 获取最后几句字幕的索引
    cursor.execute("SELECT idx FROM srts WHERE adid = ? ORDER BY idx DESC LIMIT 5", (adid,))
    last_idxs = cursor.fetchall()
    print("最后5句字幕的索引:", [idx[0] for idx in last_idxs])
    
finally:
    conn.close()