20 lines
614 B
Python
20 lines
614 B
Python
|
|
"""Quick peek: grep finished transcripts for saga keywords."""
|
||
|
|
import json
|
||
|
|
import sys
|
||
|
|
|
||
|
|
KEYS = ["isom", "eric july", "rippa", "comic book", "yellowflash"]
|
||
|
|
|
||
|
|
for f in sys.argv[1:] or ["transcripts/ep0361.json", "transcripts/ep0362.json"]:
|
||
|
|
with open(f, encoding="utf-8") as fh:
|
||
|
|
d = json.load(fh)
|
||
|
|
print("===", d["title"])
|
||
|
|
n = 0
|
||
|
|
for s in d["segments"]:
|
||
|
|
t = s["text"].lower()
|
||
|
|
if any(k in t for k in KEYS):
|
||
|
|
m, sec = divmod(int(s["start"]), 60)
|
||
|
|
print(f' [{m:02d}:{sec:02d}] {s["text"][:110]}')
|
||
|
|
n += 1
|
||
|
|
if n >= 8:
|
||
|
|
break
|