yunuseduran commited on
Commit
5e3608e
·
verified ·
1 Parent(s): eb8002b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -69,14 +69,11 @@ def get_transcript_via_rapidapi(video_url):
69
  if response.status_code == 200:
70
  try:
71
  data = response.json()
72
-
73
  # API'nin yanıt formatına göre ayarla - YouTube Transcriptor API için:
74
- if data and 'transcription' in data:
75
- transcript_parts = []
76
- for item in data['transcription']:
77
- if 'text' in item:
78
- transcript_parts.append(item['transcriptionAsText'])
79
- return " ".join(transcript_parts)
80
 
81
  # Ultimate YouTube API formatı için:
82
  # if data and isinstance(data, list):
 
69
  if response.status_code == 200:
70
  try:
71
  data = response.json()
72
+
73
  # API'nin yanıt formatına göre ayarla - YouTube Transcriptor API için:
74
+ if data and 'transcriptionAsText' in data[0]:
75
+ transcript = data[0]['transcriptionAsText']
76
+ return transcript
 
 
 
77
 
78
  # Ultimate YouTube API formatı için:
79
  # if data and isinstance(data, list):