Don't use the youtubei.googleapis.com but the websites domains + update client version of the desktop internal API
Use again www.youtube.com and music.youtube.com domains instead of youtubei.googleapis.com domain because it spoofs more a web client of YouTube or YouTube Music and may reduce Google's detection of NewPipe Extractor users.
This commit is contained in:
parent
effcdaa4f2
commit
f73c923f60
4 changed files with 8 additions and 9 deletions
|
@ -64,9 +64,9 @@ public class YoutubeParsingHelper {
|
|||
private YoutubeParsingHelper() {
|
||||
}
|
||||
|
||||
private static final String HARDCODED_CLIENT_VERSION = "2.20210429.07.00";
|
||||
private static final String HARDCODED_CLIENT_VERSION = "2.20210506.07.00";
|
||||
private static final String HARDCODED_KEY = "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8";
|
||||
private static final String YOUTUBEI_V1_URL = "https://youtubei.googleapis.com/youtubei/v1/";
|
||||
private static final String YOUTUBEI_V1_URL = "https://www.youtube.com/youtubei/v1/";
|
||||
private static String clientVersion;
|
||||
private static String key;
|
||||
|
||||
|
@ -464,7 +464,8 @@ public class YoutubeParsingHelper {
|
|||
|
||||
public static boolean areHardcodedYoutubeMusicKeysValid() throws IOException,
|
||||
ReCaptchaException {
|
||||
final String url = YOUTUBEI_V1_URL + "music/get_search_suggestions?alt=json&key="
|
||||
final String url =
|
||||
"https://music.youtube.com/youtubei/v1/music/get_search_suggestions?alt=json&key="
|
||||
+ HARDCODED_YOUTUBE_MUSIC_KEYS[0];
|
||||
|
||||
// @formatter:off
|
||||
|
@ -474,7 +475,7 @@ public class YoutubeParsingHelper {
|
|||
.object("client")
|
||||
.value("clientName", "WEB_REMIX")
|
||||
.value("clientVersion", HARDCODED_YOUTUBE_MUSIC_KEYS[2])
|
||||
.value("hl", "en")
|
||||
.value("hl", "en-GB")
|
||||
.value("gl", "GB")
|
||||
.array("experimentIds").end()
|
||||
.value("experimentsToken", "")
|
||||
|
|
|
@ -383,8 +383,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
|
|||
.done())
|
||||
.getBytes(UTF_8);
|
||||
|
||||
return new Page("https://youtubei.googleapis.com/youtubei/v1/browse?key=" + getKey(),
|
||||
body);
|
||||
return new Page("https://www.youtube.com/youtubei/v1/browse?key=" + getKey(), body);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -259,8 +259,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor {
|
|||
.done())
|
||||
.getBytes(UTF_8);
|
||||
|
||||
return new Page("https://youtubei.googleapis.com/youtubei/v1/browse?key="
|
||||
+ getKey(), body);
|
||||
return new Page("https://www.youtube.com/youtubei/v1/browse?key=" + getKey(), body);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -263,7 +263,7 @@ public class YoutubeSearchExtractor extends SearchExtractor {
|
|||
final String token = continuationItemRenderer.getObject("continuationEndpoint")
|
||||
.getObject("continuationCommand").getString("token");
|
||||
|
||||
final String url = "https://youtubei.googleapis.com/youtubei/v1/search?key=" + getKey();
|
||||
final String url = "https://www.youtube.com/youtubei/v1/search?key=" + getKey();
|
||||
|
||||
return new Page(url, token);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue