Python library for interacting with FreeTube's playlists.db file
Project description
freetubedb
Python library for interacting with FreeTube's playlists.db file
Table of Contents
Installation
pip install freetubedb
Usage
FreetubePlaylist
@dataclass(frozen=True)
class FreetubePlaylist:
"""
FreetubePlaylist class. Contains all the information stored about a playlist.
"""
id: str
name: str
description: str
protected: bool
videos: list[FreetubeVideo] = field(default_factory=list[FreetubeVideo])
FreetubeVideo
@dataclass(frozen=True)
class FreetubeVideo:
"""
FreetubeVideo class. Contains all the information stored about a video in a FreetubePlaylist.
"""
id: str
title: str
author_id: str
author_name: str
length: int # seconds
date_published: int # unix timestamp
date_added: int # unix timestamp
playlist_item_id: str
Example
from pathlib import Path
from freetubedb import parse_playlists_file, FreetubePlaylist
# uses default FreeTube path based on operating system
playlists: list[FreetubePlaylist] = parse_playlists_file()
# alternatively, you can supply your own custom path:
# playlists: list[FreetubePlaylist] = parse_playlists_file(Path("./playlists.db"))
for playlist in playlists:
print(f"Playlist: {playlist.name} (ID: {playlist.id})")
print(f"Description: {playlist.description}")
print(f"Number of videos: {len(playlist.videos)}")
for video in playlist.videos:
print(f" - {video.title} by {video.author_name}")
print(f" Video ID: {video.id}")
print(f" Length: {video.length} seconds")
print(f" Published: {video.date_published} (unix timestamp)")
print(f" Added to playlist: {video.date_added} (unix timestamp)")
License
freetubedb is distributed under the terms of the GPL-3.0 license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file freetubedb-1.0.1.tar.gz.
File metadata
- Download URL: freetubedb-1.0.1.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e258019f3ce5146150d88e9c45c66fc307a0148e3f9c8cc41a146d8c09a5cf8
|
|
| MD5 |
94acebc1061ded69928631da1423a9d4
|
|
| BLAKE2b-256 |
52f1ae3ffa260fc24db8c39f6171ba9d55fb3471b804501b831c3cf2a5d96c08
|
Provenance
The following attestation bundles were made for freetubedb-1.0.1.tar.gz:
Publisher:
python-publish.yml on FawkesOficial/python-freetubedb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
freetubedb-1.0.1.tar.gz -
Subject digest:
6e258019f3ce5146150d88e9c45c66fc307a0148e3f9c8cc41a146d8c09a5cf8 - Sigstore transparency entry: 227959621
- Sigstore integration time:
-
Permalink:
FawkesOficial/python-freetubedb@1950703b7fd550f4689dfac2c2911bd799b019c1 -
Branch / Tag:
refs/tags/1.0.1 - Owner: https://github.com/FawkesOficial
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1950703b7fd550f4689dfac2c2911bd799b019c1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file freetubedb-1.0.1-py3-none-any.whl.
File metadata
- Download URL: freetubedb-1.0.1-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f650f5308a1ea2f04758bb72a9ec7d71cac035f02cf76cf8ce7006395fadda39
|
|
| MD5 |
aa11a930c2c58c97472bf7096c83aa00
|
|
| BLAKE2b-256 |
67b3a0071a737fed7e5dbe0181418625b44d363e79b1ea580e61230331759980
|
Provenance
The following attestation bundles were made for freetubedb-1.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on FawkesOficial/python-freetubedb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
freetubedb-1.0.1-py3-none-any.whl -
Subject digest:
f650f5308a1ea2f04758bb72a9ec7d71cac035f02cf76cf8ce7006395fadda39 - Sigstore transparency entry: 227959625
- Sigstore integration time:
-
Permalink:
FawkesOficial/python-freetubedb@1950703b7fd550f4689dfac2c2911bd799b019c1 -
Branch / Tag:
refs/tags/1.0.1 - Owner: https://github.com/FawkesOficial
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1950703b7fd550f4689dfac2c2911bd799b019c1 -
Trigger Event:
release
-
Statement type: