Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
feat(YouTube/Spoof format stream data): check endpoint url is non-null
Browse files Browse the repository at this point in the history
  • Loading branch information
inotia00 authored and anddea committed May 16, 2024
1 parent f869a37 commit a25d7d7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ public static void hookStreamData(Object protobufList) {
* @param endpointUrl It has a similar format to the 'baseEndpointUrl' variable in the {@link YoutubeParsingHelper#getMobilePostResponse} method.
*/
public static void newEndpointUrlResponse(@Nullable String endpointUrl) {
if (endpointUrl == null) return;
// Example format for EndpointUrl:
// https://youtubei.googleapis.com/youtubei/v1/player?key=AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w&t=J2aJjSG9n2pQ&id=dQw4w9WgXcQ
String videoId = Uri.parse(endpointUrl).getQueryParameter("id");
if (videoId != null) {
Logger.printDebug(() -> "newEndpointUrlResponse: " + endpointUrl);
setFormatStreamData(videoId);
}
if (videoId == null) return;
Logger.printDebug(() -> "newEndpointUrlResponse: " + endpointUrl);
setFormatStreamData(videoId);
}

private static void setFormatStreamData(@NonNull String videoId) {
Expand Down

0 comments on commit a25d7d7

Please sign in to comment.