-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ANDROID_VR and de-prioritise TVHTML5EMBEDDED (#70)
* Replace degraded TVHTML5 client with WEB EMBEDDED for limited age-restricted playback * Add ANDROID_VR client and deprioritise TVHTML5 * Formatting and readme update
- Loading branch information
Showing
6 changed files
with
64 additions
and
10 deletions.
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
39 changes: 39 additions & 0 deletions
39
common/src/main/java/dev/lavalink/youtube/clients/AndroidVr.java
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package dev.lavalink.youtube.clients; | ||
|
||
import com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface; | ||
import dev.lavalink.youtube.clients.ClientConfig.AndroidVersion; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class AndroidVr extends Android { | ||
public static String CLIENT_VERSION = "1.60.18"; | ||
public static AndroidVersion ANDROID_VERSION = AndroidVersion.ANDROID_12L; | ||
|
||
public static ClientConfig BASE_CONFIG = new ClientConfig() | ||
.withApiKey(Android.BASE_CONFIG.getApiKey()) | ||
.withUserAgent(String.format("com.google.android.apps.youtube.vr.oculus/%s (Linux; U; Android %s; eureka-user Build/SQ3A.220605.009.A1) gzip", CLIENT_VERSION, ANDROID_VERSION.getOsVersion())) | ||
.withClientName("ANDROID_VR") | ||
.withClientField("clientVersion", CLIENT_VERSION) | ||
.withClientField("androidSdkVersion", ANDROID_VERSION.getSdkVersion()); | ||
|
||
protected ClientOptions options; | ||
|
||
public AndroidVr() { | ||
this(ClientOptions.DEFAULT); | ||
} | ||
|
||
public AndroidVr(@NotNull ClientOptions options) { | ||
super(options, false); | ||
} | ||
|
||
@Override | ||
@NotNull | ||
protected ClientConfig getBaseClientConfig(@NotNull HttpInterface httpInterface) { | ||
return BASE_CONFIG.copy(); | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public String getIdentifier() { | ||
return BASE_CONFIG.getName(); | ||
} | ||
} |
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
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
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
14 changes: 14 additions & 0 deletions
14
v2/src/main/java/dev/lavalink/youtube/clients/AndroidVrWithThumbnail.java
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package dev.lavalink.youtube.clients; | ||
|
||
import dev.lavalink.youtube.clients.skeleton.NonMusicClientWithThumbnail; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class AndroidVrWithThumbnail extends AndroidVr implements NonMusicClientWithThumbnail { | ||
public AndroidVrWithThumbnail() { | ||
super(); | ||
} | ||
|
||
public AndroidVrWithThumbnail(@NotNull ClientOptions options) { | ||
super(options); | ||
} | ||
} |