Skip to content

Commit 629d750

Browse files
committed
Fix some comments
1 parent 0478822 commit 629d750

2 files changed

Lines changed: 14 additions & 16 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/extractors/PeertubeStreamExtractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ private List<VideoStream> getVideoStreamsFromArray(final JsonArray streams,
375375
}
376376
return videoStreams;
377377
} catch (final Exception e) {
378-
throw new ParsingException("Could not get video streams from array", e);
378+
throw new ParsingException("Could not get audio streams from array", e);
379379
}
380380
}
381381

extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfo.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ public static StreamInfo getInfo(@Nonnull final StreamingService service,
7272
public static StreamInfo getInfo(@Nonnull final StreamExtractor extractor)
7373
throws ExtractionException, IOException {
7474
extractor.fetchPage();
75-
StreamInfo streamInfo;
75+
final StreamInfo streamInfo;
7676
try {
7777
streamInfo = extractImportantData(extractor);
7878
extractStreams(streamInfo, extractor);
7979
extractOptionalData(streamInfo, extractor);
8080
} catch (final ExtractionException e) {
81-
// Currently YouTube does not distinguish between age restricted videos and videos
81+
// Currently, YouTube does not distinguish between age restricted videos and videos
8282
// blocked by country. This means that during the initialisation of the extractor, the
83-
// extractor will assume that a video is age restricted while in reality it it blocked
83+
// extractor will assume that a video is age restricted while in reality it is blocked
8484
// by country.
8585
//
8686
// We will now detect whether the video is blocked by country or not.
@@ -99,9 +99,9 @@ public static StreamInfo getInfo(@Nonnull final StreamExtractor extractor)
9999
@Nonnull
100100
private static StreamInfo extractImportantData(@Nonnull final StreamExtractor extractor)
101101
throws ExtractionException {
102-
/* ---- Important data, without the video can't be displayed goes here: ---- */
103-
// If one of these is not available an exception is meant to be thrown directly
104-
// into NewPipe.
102+
/* ---- Important data, without it the stream can't be displayed: ---- */
103+
// If one of these is not available an exception is meant to be thrown directly into
104+
// NewPipe.
105105

106106
final int serviceId = extractor.getServiceId();
107107
final String url = extractor.getUrl();
@@ -123,9 +123,9 @@ private static StreamInfo extractImportantData(@Nonnull final StreamExtractor ex
123123
private static StreamInfo extractStreams(final StreamInfo streamInfo,
124124
final StreamExtractor extractor)
125125
throws ExtractionException {
126-
/* ---- stream extraction goes here ---- */
127-
// At least one type of stream has to be available,
128-
// otherwise an exception will be thrown directly into the frontend.
126+
/* ---- Stream extraction goes here ---- */
127+
// At least one type of stream has to be available, otherwise an exception will be thrown
128+
// directly into the frontend.
129129

130130
try {
131131
streamInfo.setDashMpdUrl(extractor.getDashMpdUrl());
@@ -160,7 +160,7 @@ private static StreamInfo extractStreams(final StreamInfo streamInfo,
160160
streamInfo.addError(new ExtractionException("Couldn't get video only streams", e));
161161
}
162162

163-
// Lists can be null if a exception was thrown during extraction
163+
// Lists can be null if an exception was thrown during extraction
164164
if (streamInfo.getVideoStreams() == null)
165165
streamInfo.setVideoStreams(Collections.emptyList());
166166
if (streamInfo.getVideoOnlyStreams() == null)
@@ -181,11 +181,9 @@ private static StreamInfo extractStreams(final StreamInfo streamInfo,
181181
@Nonnull
182182
private static StreamInfo extractOptionalData(final StreamInfo streamInfo,
183183
final StreamExtractor extractor) {
184-
/* ---- optional data goes here: ---- */
185-
// If one of these fails, the frontend needs to handle that they are not
186-
// available.
187-
// Exceptions are therefore not thrown into the frontend, but stored into the
188-
// error List,
184+
/* ---- Optional data goes here: ---- */
185+
// If one of these fails, the frontend needs to handle that they are not available.
186+
// Exceptions are therefore not thrown into the frontend, but stored into the error list,
189187
// so the frontend can afterwards check where errors happened.
190188

191189
try {

0 commit comments

Comments
 (0)