-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add config flow to media extractor #32590
Merged
+16
−49
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
329f517
Add config flow to media extractor
joostlek 401f6b0
Merge branch 'refs/heads/next' into me-cf
joostlek 0b3f0f3
Update source/_integrations/media_extractor.markdown
joostlek c693efd
Update source/_integrations/media_extractor.markdown
c0ffeeca7 01a2d43
Update source/_integrations/media_extractor.markdown
c0ffeeca7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,61 +15,15 @@ related: | |
title: Configuration file | ||
--- | ||
|
||
The `media_extractor` {% term integration %} gets a stream URL and sends it to a media player entity. This integration can extract entity specific streams if configured accordingly. | ||
The Media extractor {% term integration %} gets a stream URL and sends it to a media player entity. This integration can extract entity specific streams if configured accordingly. | ||
|
||
<div class='note'> | ||
Media extractor doesn't transcode streams, it just tries to find a stream that matches the requested query. | ||
</div> | ||
|
||
To use the media extractor service in your installation, add the following to your {% term "`configuration.yaml`" %} file. | ||
{% include integrations/restart_ha_after_config_inclusion.md %} | ||
|
||
```yaml | ||
# Example configuration.yaml entry | ||
media_extractor: | ||
``` | ||
|
||
{% configuration %} | ||
default_query: | ||
description: Set default stream query for all devices. | ||
required: false | ||
default: best | ||
type: string | ||
customize: | ||
description: Set entity specific values. | ||
required: false | ||
type: list | ||
{% endconfiguration %} | ||
|
||
```yaml | ||
# Example configuration.yaml entry | ||
media_extractor: | ||
default_query: worst | ||
customize: | ||
media_player.my_sonos: | ||
video: bestvideo | ||
music: bestaudio[ext=mp3] | ||
``` | ||
|
||
This configuration sets query for all service calls like to 'bestaudio' with the mp3 extension: | ||
|
||
```yaml | ||
entity_id: media_player.my_sonos | ||
media_content_id: https://soundcloud.com/bruttoband/brutto-11 | ||
media_content_type: music | ||
``` | ||
{% include integrations/config_flow.md %} | ||
|
||
Query examples with explanations: | ||
|
||
- **bestvideo**: Best video only stream | ||
- **best**: Best video + audio stream | ||
- **bestaudio[ext=m4a]**: Best audio stream with m4a extension | ||
- **worst**: Worst video + audio stream | ||
- **bestaudio[ext=m4a]/bestaudio[ext=ogg]/bestaudio**: Best m4a audio, otherwise best ogg audio and only then any best audio | ||
|
||
More info about queries can be found [here](https://github.com/ytdl-org/youtube-dl#format-selection). | ||
|
||
### Use the service | ||
### Play media service | ||
|
||
Navigate to the **Services** tab inside **Developer Tools**. From the "Service" dropdown menu select `media_extractor.play_media` and then press the "Fill Example Data" button at the bottom of the page. Use the "Entity ID" dropdown to select your media player and then press the **Call Service** button. | ||
|
||
|
@@ -90,6 +44,19 @@ There is also a service that will directly return the URL in the response of the | |
| `url` | no | The URL of the media to extract. | | ||
| `format_query` | yes | The query that will be used to select the right media. | | ||
|
||
### Format query | ||
|
||
The query can be used to select the right media. | ||
Query examples with explanations: | ||
|
||
- **bestvideo**: Best video-only stream | ||
- **best**: Best video + audio stream | ||
- **bestaudio[ext=m4a]**: Best audio stream with m4a extension | ||
c0ffeeca7 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- **worst**: Worst video + audio stream | ||
- **bestaudio[ext=m4a]/bestaudio[ext=ogg]/bestaudio**: Best m4a audio, otherwise best ogg audio and only then any best audio | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean OGG file format? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think so yes
c0ffeeca7 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
More info about queries can be found [here](https://github.com/ytdl-org/youtube-dl#format-selection). | ||
|
||
### Cookies | ||
|
||
Some supported video services provide a better experience when you are logged in. For example, if you use Twitch Turbo or are subscribed to a Twitch streamer, logging in prevents the video stream from showing an "An ad is currently playing. Come back after the break." message until the ad is over. Other examples are private or purchased YouTube videos which you can only watch while logged in. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by best? High resolution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of scope for this PR I guess.