---
ai_generation_date: '2026-07-31'
ai_model: gemini-3-pro-preview
audiodharma:
  talks:
    - date: '2021-07-30'
      mp3_url: https://audiodharma.us-east-1.linodeobjects.com/talks/13940/20210730-Gil_Fronsdal-IMC-guided_meditation_confidence_in_peace.mp3
      speakers:
        - speaker_name: Gil Fronsdal
          speaker_url: https://www.audiodharma.org/speakers/1
      talk_start_time_seconds: 0
      title: 'Guided Meditation: Confidence in Peace'
      url: https://www.audiodharma.org/talks/13940
      video_unavailable: false
location_city: Redwood City, CA
video_unavailable: false
youtube:
  id: Bz6oRI3jE3c
  imprecise_upload_date: '2022-05-04'
  title: 'Guided Meditation: Confidence in Peace'
  upload_date: null
  uploader_str: Insight Meditation Center
  uploader_url: https://www.youtube.com/@InsightMeditationCenter
youtube_url: https://www.youtube.com/watch?v=Bz6oRI3jE3c
---

# Check for existing JSON or SRT file

_This is an AI-generated transcript from auto-generated subtitles for the video above. It likely contains inaccuracies, especially with speaker attribution if there are multiple speakers._

        if not force_redownload:
            if json_path.exists():
                logging.info(f"Found cached raw transcript: {json_path}")
                return None
            if srt_path.exists():
                logger.info(f"Found cached SRT transcript: {srt_path}")
                return None

```

Because it doesn't verify the file's size, it incorrectly treats 0-byte files as valid cache hits. Later, `prompt.py` reads this empty file and replaces `{{raw_transcript_data}}` with an empty string.

To fix this, we should update `youtube_transcribe.py` to check that the file has content (e.g., using `srt_path.stat().st_size > 0`).

Would you like me to go ahead and implement this fix to the `youtube_transcribe.py` file?
```
