Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def load(self) -> List[Document]:
self._metadata.update(video_info)

try:
transcript_list = YouTubeTranscriptApi.list_transcripts(self.video_id)
transcript_list = YouTubeTranscriptApi().list(self.video_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduces a breaking API modification. The code transitions from calling the static method YouTubeTranscriptApi.list_transcripts() to calling an instance method YouTubeTranscriptApi().list(). This alteration breaks backward compatibility by:

  1. Requiring instantiation of the YouTubeTranscriptApi class instead of static method access
  2. Changing the method name from list_transcripts to list

This modification could impact downstream code dependencies and any direct callers of this method. To maintain compatibility, either preserve the original static method call or document this as a breaking change with appropriate version increment.

Suggested change
transcript_list = YouTubeTranscriptApi().list(self.video_id)
transcript_list = YouTubeTranscriptApi.list_transcripts(self.video_id)

Spotted by Diamond (based on custom rule: Code quality)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

except TranscriptsDisabled:
return []

Expand Down Expand Up @@ -412,7 +412,7 @@ def validate_channel_or_videoIds_is_set(cls, values: Any) -> Any:
def _get_transcripe_for_video_id(self, video_id: str) -> str:
from youtube_transcript_api import NoTranscriptFound, YouTubeTranscriptApi

transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
transcript_list = YouTubeTranscriptApi().list(video_id)
try:
transcript = transcript_list.find_transcript([self.captions_language])
except NoTranscriptFound:
Expand Down