mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-27 23:40:36 +05:30
Catch every exception instead of only IOException and ExtractionException and add a Javadoc
Catch every exception instead of only IOException and ExtractionException. Add JavaDoc for fetchAndroidMobileJsonPlayer method of YoutubeStreamExtractor
This commit is contained in:
parent
6921e80ded
commit
a59c2a3577
@ -819,6 +819,12 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch the Android Mobile API or fallback to the desktop streams.
|
||||||
|
* If something went wrong when parsing this API, fallback to the desktop JSON player, fetched
|
||||||
|
* again if the {@code signatureTimestamp} of the JS player is unknown (because signatures
|
||||||
|
* without a {@code signatureTimestamp} included in the player request are invalid).
|
||||||
|
*/
|
||||||
private void fetchAndroidMobileJsonPlayer(final ContentCountry contentCountry,
|
private void fetchAndroidMobileJsonPlayer(final ContentCountry contentCountry,
|
||||||
final Localization localization,
|
final Localization localization,
|
||||||
final String videoId,
|
final String videoId,
|
||||||
@ -833,7 +839,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||||||
try {
|
try {
|
||||||
mobilePlayerResponse = getJsonMobilePostResponse("player", mobileBody,
|
mobilePlayerResponse = getJsonMobilePostResponse("player", mobileBody,
|
||||||
contentCountry, localization);
|
contentCountry, localization);
|
||||||
} catch (final IOException | ExtractionException ignored) {
|
} catch (final Exception ignored) {
|
||||||
}
|
}
|
||||||
if (mobilePlayerResponse != null && mobilePlayerResponse.has("streamingData")) {
|
if (mobilePlayerResponse != null && mobilePlayerResponse.has("streamingData")) {
|
||||||
final JsonObject mobileStreamingData = mobilePlayerResponse.getObject(
|
final JsonObject mobileStreamingData = mobilePlayerResponse.getObject(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user