Skip to content

Unable to fetch enhanced metadata of videos #2

@nischalsoni

Description

@nischalsoni

from the youtubeloader.ipynb file, i used the below snippet to fetch the metadata of the video like publishing date, views etc. but is throwing me an error.

Code:
loader = YoutubeLoader.from_youtube_url("https://youtu.be/zJBpRn2zTco", add_video_info=True)
docs = loader.load()
metadata = docs[0].metadata
print(metadata)

Error:
Traceback (most recent call last):
File "XXXXX\Lib\site-packages\pytube_main_.py", line 341, in title
self._title = self.vid_info['videoDetails']['title']
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'videoDetails'

raise exceptions.PytubeError(

pytube.exceptions.PytubeError: Exception while accessing title of https://youtube.com/watch?v=zJBpRn2zTco. Please file a bug report at https://github.com/pytube/pytube

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions