Skip to content

Commit

Permalink
Restore Android client playback ability and upgrade client version (…
Browse files Browse the repository at this point in the history
…without changing mobile player params) (#76)

* fixed android client without removing or changing mobile player params

* Update README.md
  • Loading branch information
munishkhatri720 authored Dec 2, 2024
1 parent 8742c34 commit ee00297
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Log file
*.log


# BlueJ files
*.ctxt

Expand All @@ -28,6 +29,7 @@ replay_pid*
.DS_Store
*/build/*
build
.vscode/*

application.yml
playerconfigs/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Currently, the following clients are available for use:
- `ANDROID`
- ❌ Heavily restricted, frequently dysfunctional.
- `ANDROID_MUSIC`
- Opus formats.
- No opus formats for livestreams (requires transcoding).
- ❌ No playlist/livestream support.
- `ANDROID_VR`
- ✔ Opus formats.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected ClientConfig getBaseClientConfig(@NotNull HttpInterface httpInterface)
@Override
@NotNull
public String getPlayerParams() {
return MOBILE_PLAYER_PARAMS;
return null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ protected ClientConfig getBaseClientConfig(@NotNull HttpInterface httpInterface)
return BASE_CONFIG.copy();
}

@Override
@NotNull
public String getPlayerParams() {
return MOBILE_PLAYER_PARAMS;
}

@Override
@NotNull
protected JsonBrowser extractMixPlaylistData(@NotNull JsonBrowser json) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ protected ClientConfig getBaseClientConfig(@NotNull HttpInterface httpInterface)
return BASE_CONFIG.copy();
}

@Override
@NotNull
public String getPlayerParams() {
return MOBILE_PLAYER_PARAMS;
}

@Override
@NotNull
public String getIdentifier() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,15 @@ protected JsonBrowser loadTrackInfoFromInnertube(@NotNull YoutubeAudioSourceMana
.withThirdPartyEmbedUrl("https://google.com");
}

String payload = config.withRootField("videoId", videoId)
config.withRootField("videoId", videoId)
.withRootField("racyCheckOk", true)
.withRootField("contentCheckOk", true)
.withRootField("params", getPlayerParams())
.withPlaybackSignatureTimestamp(signatureCipher.scriptTimestamp)
.withRootField("contentCheckOk", true);

if (getPlayerParams() != null) {
config.withRootField("params" , getPlayerParams());
}

String payload = config.withPlaybackSignatureTimestamp(signatureCipher.scriptTimestamp)
.setAttributes(httpInterface)
.toJsonString();

Expand Down

0 comments on commit ee00297

Please sign in to comment.