From 2b1f7a511fdf77ec2ea390adb327a487dd7a08da Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 17 Sep 2026 11:05:49 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20optimize=20transcript=20processing?= =?UTF-8?q?=20in=20app.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eliminate redundant iteration over transcript data by building both timestamped and simple text formats in a single pass. This reduces O(n) overhead and improves architectural efficiency. Co-authored-by: ertugerata <225387+ertugerata@users.noreply.github.com> --- app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index be7fb3f..ad8478d 100644 --- a/app.py +++ b/app.py @@ -125,12 +125,14 @@ def get_transcript(video_id, language='tr'): print(f"Transkript verisi alındı: {len(transcript_data)} satır") full_transcript = [] + simple_text_parts = [] for item in transcript_data: timestamp = format_timestamp(item.start) text = item.text full_transcript.append(f"[{timestamp}] {text}") + simple_text_parts.append(text) - simple_text = ' '.join([item.text for item in transcript_data]) + simple_text = ' '.join(simple_text_parts) return { 'full_text': '\n'.join(full_transcript),