mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-28 16:00:33 +05:30
[YouTube] Bypass crisis resources blocking search results
These crisis resources are preventing search results to be returned. See https://support.google.com/youtube/answer/10726080?hl=en for more info on them. This commit changes search parameters to include the property allowing to show search results.
This commit is contained in:
parent
7dea2d0d27
commit
6ba8251be1
@ -45,11 +45,14 @@ public final class YoutubeSearchQueryHandlerFactory extends SearchQueryHandlerFa
|
|||||||
final String contentFilter = contentFilters.get(0);
|
final String contentFilter = contentFilters.get(0);
|
||||||
switch (contentFilter) {
|
switch (contentFilter) {
|
||||||
case VIDEOS:
|
case VIDEOS:
|
||||||
return SEARCH_URL + encodeUrlUtf8(searchString) + "&sp=EgIQAQ%253D%253D";
|
return SEARCH_URL + encodeUrlUtf8(searchString)
|
||||||
|
+ "&sp=EgIQAfABAQ%253D%253D";
|
||||||
case CHANNELS:
|
case CHANNELS:
|
||||||
return SEARCH_URL + encodeUrlUtf8(searchString) + "&sp=EgIQAg%253D%253D";
|
return SEARCH_URL + encodeUrlUtf8(searchString)
|
||||||
|
+ "&sp=EgIQAvABAQ%253D%253D";
|
||||||
case PLAYLISTS:
|
case PLAYLISTS:
|
||||||
return SEARCH_URL + encodeUrlUtf8(searchString) + "&sp=EgIQAw%253D%253D";
|
return SEARCH_URL + encodeUrlUtf8(searchString)
|
||||||
|
+ "&sp=EgIQA_ABAQ%253D%253D";
|
||||||
case MUSIC_SONGS:
|
case MUSIC_SONGS:
|
||||||
case MUSIC_VIDEOS:
|
case MUSIC_VIDEOS:
|
||||||
case MUSIC_ALBUMS:
|
case MUSIC_ALBUMS:
|
||||||
@ -59,7 +62,7 @@ public final class YoutubeSearchQueryHandlerFactory extends SearchQueryHandlerFa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return SEARCH_URL + encodeUrlUtf8(searchString);
|
return SEARCH_URL + encodeUrlUtf8(searchString) + "&sp=8AEB";
|
||||||
} catch (final UnsupportedEncodingException e) {
|
} catch (final UnsupportedEncodingException e) {
|
||||||
throw new ParsingException("Could not encode query", e);
|
throw new ParsingException("Could not encode query", e);
|
||||||
}
|
}
|
||||||
@ -83,24 +86,24 @@ public final class YoutubeSearchQueryHandlerFactory extends SearchQueryHandlerFa
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
public static String getSearchParameter(final String contentFilter) {
|
public static String getSearchParameter(final String contentFilter) {
|
||||||
if (isNullOrEmpty(contentFilter)) {
|
if (isNullOrEmpty(contentFilter)) {
|
||||||
return "";
|
return "8AEB";
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (contentFilter) {
|
switch (contentFilter) {
|
||||||
case VIDEOS:
|
case VIDEOS:
|
||||||
return "EgIQAQ%3D%3D";
|
return "EgIQAfABAQ%3D%3D";
|
||||||
case CHANNELS:
|
case CHANNELS:
|
||||||
return "EgIQAg%3D%3D";
|
return "EgIQAvABAQ%3D%3D";
|
||||||
case PLAYLISTS:
|
case PLAYLISTS:
|
||||||
return "EgIQAw%3D%3D";
|
return "EgIQA_ABAQ%3D%3D";
|
||||||
case ALL:
|
|
||||||
case MUSIC_SONGS:
|
case MUSIC_SONGS:
|
||||||
case MUSIC_VIDEOS:
|
case MUSIC_VIDEOS:
|
||||||
case MUSIC_ALBUMS:
|
case MUSIC_ALBUMS:
|
||||||
case MUSIC_PLAYLISTS:
|
case MUSIC_PLAYLISTS:
|
||||||
case MUSIC_ARTISTS:
|
case MUSIC_ARTISTS:
|
||||||
default:
|
|
||||||
return "";
|
return "";
|
||||||
|
default:
|
||||||
|
return "8AEB";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user