Skip to content

Commit 781813e

Browse files
committed
Remove comment and duplicate code
1 parent 08e2568 commit 781813e

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

zeeguu/core/youtube_api/youtube_api.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,6 @@ def _get_thumbnail(item):
155155
video_info["broken"] = NOT_IN_EXPECTED_LANGUAGE
156156
return video_info
157157

158-
# if has_dubbed_audio(video_unique_key):
159-
# print(f"Video {video_unique_key} has dubbed audio.")
160-
# video_info["broken"] = DUBBED_AUDIO
161-
162158
captions = get_captions_from_json(video_unique_key, lang)
163159
if captions is None:
164160
print(f"Could not fetch captions for video {video_unique_key} in {lang}")
@@ -209,10 +205,6 @@ def get_captions_with_yttapi(video_unique_key, lang):
209205
"text": "\n".join(full_text),
210206
"captions": caption_list,
211207
}
212-
return {
213-
"text": "\n".join(full_text),
214-
"captions": caption_list,
215-
}
216208

217209
except TranscriptsDisabled:
218210
print("Transcript is disabled for this video.")
@@ -231,23 +223,6 @@ def get_captions_with_yttapi(video_unique_key, lang):
231223
except Exception as e:
232224
print(f"Error fetching captions for {video_unique_key}: {e}")
233225
return None
234-
except TranscriptsDisabled:
235-
print("Transcript is disabled for this video.")
236-
return None
237-
except NoTranscriptFound:
238-
print(
239-
"No manually added transcript was found for this video in the specified language."
240-
)
241-
return None
242-
except VideoUnavailable:
243-
print("Video is unavailable.")
244-
return None
245-
except CouldNotRetrieveTranscript as e:
246-
print(f"Could not retrieve transcript: {e}")
247-
return None
248-
except Exception as e:
249-
print(f"Error fetching captions for {video_unique_key}: {e}")
250-
return None
251226

252227

253228
def get_captions_from_json(video_unique_key, lang):

0 commit comments

Comments
 (0)