#Platypush 1.3.5 is out!
The main feature of this release is the support for multiple backends in the youtube
plugin.
It allows you to watch ad-free YouTube videos on any supported media player and manage your playlists and subscriptions through multiple YouTube implementations.
Support for multiple YouTube backendsEarlier only #Piped was supported, but given the state of the project and most instances (all the ones I’ve tested, including my own, are still blocked by #YouTube’s new restrictions) I’ve added support for #Invidious too, and that’s currently the recommended backend.
The in-browser YouTube player now plays videos using the Invidious embedded player if you configure the invidious
backend, so the UI can be used as a full alternative frontend for Invidious.
I’ve also added a new google
backend that leverages the official YouTube Data API to search and fetch your playlists and subscriptions, but keep in mind that:
It requires you to register a project on the Google Cloud developers console.
It doesn’t support the get_feed()
action (YouTube has removed the endpoint in v3), so you won’t be able to get the latest videos published by your subscribed channel.
All searches and activities will be logged on your Google account, so it’s probably not the best option if you are looking for a privacy-aware experience (but video streaming will still be ad-free).
State of YouTube media supportThe youtube
plugin should work in tandem with any supported Platypush media integrations (tested with media.mpv
, media.vlc
, media.gstreamer
, media.kodi
and media.chromecast
), but media.mpv
is recommended. The reason is that mpv
provides the --ytdl
option out of the box to leverage yt-dlp
to download and stream videos on the fly, while other media plugins will have to first download the full video locally before streaming it (I’ve tried to implement my own real-time media streaming server, but I’m still not very happy with its stability).
Leveraging the support for multiple backends to migrate your data aroundI’ve always been baffled by the fact that there isn’t a standard format to export playlists/subscriptions across different backend implementations (even among alternative backends, such as Piped and Invidious).
As someone who has migrated through different YouTube backends and apps depending on the state of restrictions implemented by Google, I’ve often had to write my own scripts to convert CSV/JSON exports from one platform or app to a format understood by the new solution.
Since the Platypush youtube
plugin exposes the same API regardless of the backend, it is possible to configure multiple backends, and write a small script that fetches all playlists and subscriptions from one and imports them into another:
from platypush import run
# Get all the playlists from e.g. the Piped backend
piped_playlists = run("youtube.get_playlists", backend="piped")
piped_playlists_with_videos = {
pl["id"]: {
item["id"]
for item in run(
"youtube.get_playlist",
id=pl["id"],
backend="piped"
)
}
for pl in piped_playlists
}
# Create the playlists on Invidious and populate them
for pl in piped_playlists:
invidious_playlist = run(
"youtube.create_playlist",
name=pl["name"],
backend="invidious"
)
run(
"youtube.add_to_playlist",
playlist_id=invidious_playlist["id"],
item_ids=piped_playlists_with_videos[pl["id"]] or [],
backend="invidious"
)
Note that the simple script above doesn’t handle merge of existing playlists and items, but it can be easily adapted - if there’s enough interest I may write a small blog article with a more complete example.
Other release featuresThe full changelog of the new release is here. Besides the youtube
integration changes, this release includes the following features:
Many stability/performance improvements for the music.mopidy
integration - especially in handling connection recoveries.
Support for ungrouped lights in the light.hue
plugin.
Added a new Application tab to the UI, which allows you to monitor all events and requests handled by the service.
Adapted ssl
layer to Python 3.12 (which has deprecated ssl.wrap_socket()
).
Migrated the kafka
integration to kafka-python-ng
instead of kafka
, which is currently broken and basically unmaintained.