Skip to content

Commit a59c2a3

Browse files
committed
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
1 parent 6921e80 commit a59c2a3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,12 @@ private void checkPlayabilityStatus(final JsonObject youtubePlayerResponse,
819819
}
820820
}
821821

822+
/**
823+
* Fetch the Android Mobile API or fallback to the desktop streams.
824+
* If something went wrong when parsing this API, fallback to the desktop JSON player, fetched
825+
* again if the {@code signatureTimestamp} of the JS player is unknown (because signatures
826+
* without a {@code signatureTimestamp} included in the player request are invalid).
827+
*/
822828
private void fetchAndroidMobileJsonPlayer(final ContentCountry contentCountry,
823829
final Localization localization,
824830
final String videoId,
@@ -833,7 +839,7 @@ private void fetchAndroidMobileJsonPlayer(final ContentCountry contentCountry,
833839
try {
834840
mobilePlayerResponse = getJsonMobilePostResponse("player", mobileBody,
835841
contentCountry, localization);
836-
} catch (final IOException | ExtractionException ignored) {
842+
} catch (final Exception ignored) {
837843
}
838844
if (mobilePlayerResponse != null && mobilePlayerResponse.has("streamingData")) {
839845
final JsonObject mobileStreamingData = mobilePlayerResponse.getObject(

0 commit comments

Comments
 (0)