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,
|
||||
final Localization localization,
|
||||
final String videoId,
|
||||
|
@ -833,7 +839,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||
try {
|
||||
mobilePlayerResponse = getJsonMobilePostResponse("player", mobileBody,
|
||||
contentCountry, localization);
|
||||
} catch (final IOException | ExtractionException ignored) {
|
||||
} catch (final Exception ignored) {
|
||||
}
|
||||
if (mobilePlayerResponse != null && mobilePlayerResponse.has("streamingData")) {
|
||||
final JsonObject mobileStreamingData = mobilePlayerResponse.getObject(
|
||||
|
|
Loading…
Reference in New Issue