Skip to content

Commit

Permalink
Fix advanced options example, add more debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin committed Aug 14, 2024
1 parent 52415db commit f5fd58a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,15 @@ plugins:
# WARNING!: UNDERSTANDING WHAT IT DOES. MISCONFIGURATION WILL HINDER YOUTUBE-SOURCE'S ABILITY TO WORK PROPERLY.
# Write the names of clients as they are specified under the heading "Available Clients".
WEB:
# Example: Disabling a client's playback capabilities.
playback: false
videoLoading: false # Disables loading of videos for this client. A client may still be used for playback even if this is set to 'false'.
TVHTML5EMBEDDED:
# Example: Configuring a client to exclusively be used for video loading and playback.
playlistLoading: false # Disables loading of playlists and mixes.
searching: false # Disables the ability to search for videos.
clientOptions:
WEB:
# Example: Disabling a client's playback capabilities.
playback: false
videoLoading: false # Disables loading of videos for this client. A client may still be used for playback even if this is set to 'false'.
TVHTML5EMBEDDED:
# Example: Configuring a client to exclusively be used for video loading and playback.
playlistLoading: false # Disables loading of playlists and mixes.
searching: false # Disables the ability to search for videos.
```

## Available Clients
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,10 @@ public ClientOptions copy() {
options.setSearching(this.searching);
return options;
}

@Override
public String toString() {
return String.format("ClientOptions{playback=%s, playlistLoading=%s, videoLoading=%s, searching=%s}",
playback, playlistLoading, videoLoading, searching);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ static Client getClientByName(ClientReference[] enumValues,
return Arrays.stream(enumValues)
.filter(it -> it.getName().equals(name))
.findFirst()
.map(ref -> ref.getClient(provider.getOptionsForClient(name)))
.map(ref -> {
ClientOptions options = provider.getOptionsForClient(name);

log.debug("Initialising client {} with options {}", ref.getName(), options);
return ref.getClient(options);
})
.orElse(null);
}

Expand Down

0 comments on commit f5fd58a

Please sign in to comment.