You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(youtube): use YouTubeTranscriptApi().list() for v1+ compatibility (#335)
### Summary
This fixes an AttributeError caused by
`YouTubeTranscriptApi.list_transcripts()` being removed in recent
versions of `youtube-transcript-api`. The loader now instantiates
`YouTubeTranscriptApi()` and calls the instance method
`.list(video_id)`.
### Problem
Reproduction:
```python
from langchain_community.document_loaders import YoutubeLoader
loader = YoutubeLoader.from_youtube_url("https://www.youtube.com/watch?v=QsYGlZkevEg", add_video_info=False)
loader.load()
# => AttributeError: type object 'YouTubeTranscriptApi' has no attribute 'list_transcripts'
Co-authored-by: Mason Daugherty <[email protected]>
0 commit comments