A PyFilesystem2 implementation for accessing YouTube Videos and Playlists
Install directly from PyPI, using pip:
pip install fs.youtube
Use fs.open_fs
to open a filesystem with an Youtube
FS URL:
import fs
yt_fs = fs.open_fs('youtube://youtubeplaylistid')
The opener can use either use the YouTube Playlist ID or the whole Youtube URL.
Also Single Youtube Videos are supported.
import fs.youtube
yt_fs = fs.youtube.YoutubeFS(
url, playlist=True, seekable=True
)
with each argument explained below:
url
The Playlist/Video URL or simly use the YouTube ID
playlist
If the ID or URL is one Video only, set this to False
seekable
Use a seekable implementation to move inside the videofile.
Once created, the YoutubeFS
filesystem behaves like any other filesystem
(see the Pyfilesystem2 documentation).
Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker of the project if you need to report or ask something. If you are filling in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproductible situation.
- fs, the core Pyfilesystem2 library
- Index of Filesystems, a list of PyFilesystem 2 implementations