forked from lavalink-devs/youtube-source
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
22 changed files
with
151 additions
and
278 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
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
73 changes: 0 additions & 73 deletions
73
common/src/main/java/dev/lavalink/youtube/clients/AndroidLite.java
This file was deleted.
Oops, something went wrong.
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
76 changes: 0 additions & 76 deletions
76
common/src/main/java/dev/lavalink/youtube/clients/AndroidTestsuite.java
This file was deleted.
Oops, something went wrong.
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
67 changes: 67 additions & 0 deletions
67
common/src/main/java/dev/lavalink/youtube/clients/MWeb.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,67 @@ | ||
package dev.lavalink.youtube.clients; | ||
|
||
import com.sedmelluq.discord.lavaplayer.tools.JsonBrowser; | ||
import com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class MWeb extends Web { | ||
public static ClientConfig BASE_CONFIG = new ClientConfig() | ||
.withApiKey("AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8") | ||
.withClientName("MWEB") | ||
.withClientField("clientVersion", "2.20240726.11.00"); | ||
|
||
public MWeb() { | ||
super(); | ||
} | ||
|
||
public MWeb(@NotNull ClientOptions options) { | ||
super(options); | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public ClientConfig getBaseClientConfig(@NotNull HttpInterface httpInterface) { | ||
return BASE_CONFIG.copy(); | ||
} | ||
|
||
@Override | ||
@NotNull | ||
protected JsonBrowser extractMixPlaylistData(@NotNull JsonBrowser json) { | ||
return json.get("contents") | ||
.get("singleColumnWatchNextResults") | ||
.get("playlist") | ||
.get("playlist"); | ||
} | ||
|
||
@Override | ||
protected String extractPlaylistName(@NotNull JsonBrowser json) { | ||
return json.get("header") | ||
.get("pageHeaderRenderer") | ||
.get("pageTitle") | ||
.text(); | ||
} | ||
|
||
@Override | ||
@NotNull | ||
protected JsonBrowser extractPlaylistVideoList(@NotNull JsonBrowser json) { | ||
return json.get("contents") | ||
.get("singleColumnBrowseResultsRenderer") | ||
.get("tabs") | ||
.index(0) | ||
.get("tabRenderer") | ||
.get("content") | ||
.get("sectionListRenderer") | ||
.get("contents") | ||
.index(0) | ||
.get("itemSectionRenderer") | ||
.get("contents") | ||
.index(0) | ||
.get("playlistVideoListRenderer"); | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public String getIdentifier() { | ||
return BASE_CONFIG.getName(); | ||
} | ||
} |
Oops, something went wrong.