Explorer
/proc/106/root/tmp/p22_probe_after.py
← Zurück ↓ Download
import sqlite3,time,json,sys
sys.path.insert(0,'/opt/struktur/youtube-research')
from e2e_worker import fetch_segments
c=sqlite3.connect('file:/opt/struktur/youtube-research/knowledge.db?mode=ro',uri=True); rows=c.execute("SELECT youtube_id FROM e2e_jobs WHERE status='blocked_transcript_fetch' ORDER BY updated_at DESC LIMIT 5").fetchall(); c.close()
for (yid,) in rows:
 try:
  segs=fetch_segments(yid); print(json.dumps({'video_id':yid,'result':'ERFOLG','segments':len(segs)}),flush=True)
 except Exception as e: print(json.dumps({'video_id':yid,'result':type(e).__name__,'message':str(e)[:220]}),flush=True)
 time.sleep(2)