Open postlund opened 9 months ago
I have started the work in #2187. Some caveats here though:
pyatv
to depend on yt-dlp
, so it is not a dependency for now and must be installed manually (an exception is raised otherwise)play_url
This Is still an early attempt, but would love some feedback on this!
I can create a variant that installs yt-dlp
as an optional dependency:
https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies
To continue with the other bullets:
Thinking about it once more... most people would like this as a transparent feature, i.e. pass a URL and let pyatv deal with it. That's what I would prefer as well. So merging with play_url
sounds reasonable, but also add a flag to disable auto extraction in case it becomes a problem. I will have to check if I can validate if a URL is supported by yt-dlp though.
I can probably check if the URL is supported by yt-dlp like this:
https://github.com/yt-dlp/yt-dlp/issues/8101#issuecomment-1718341135
Just need to await if this is to be considered a stable API.
Would this work playing an MP4/MKV from a NAS with something like Infuse as well? https://firecore.com/infuse
This will not add support for any new formats (MP4 is still your best bet) and will only support services supported by yt-dlp, where Infuse does not seem to be included. So in that particular case: no, it will not. But I imagine you can get the URL to media directly in Infuse somehow? Maybe even transcoded to an appropriate format? Since they have an Apple TV app, you could also opt for using launch_app
with deep links instead (see https://pyatv.dev/development/apps/#app-deep-links).
What feature would you like?
Add support for streaming directly from online services, like Youtube. This is probably not possible with all services, but some should work.
Describe the solution you'd like
The intention is to use yt-dlp to extract the underlying video URL, then passing that URL on via AirPlay (
play_url
). It's an easy solution that yields a simple API for most users. Testing it would be something like this:As
play_url
is used, that feature must be available.Any other information to share?
TBD