Skip to content

Commit 25ed9de

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents b05fa45 + 99915e4 commit 25ed9de

7 files changed

Lines changed: 29 additions & 87 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,9 @@ public String getErrorMessage() {
568568
private final static String DECYRYPTION_SIGNATURE_FUNCTION_REGEX =
569569
"(\\w+)\\s*=\\s*function\\((\\w+)\\)\\{\\s*\\2=\\s*\\2\\.split\\(\"\"\\)\\s*;";
570570
private final static String DECRYPTION_AKAMAIZED_STRING_REGEX =
571-
"yt\\.akamaized\\.net/\\)\\s*\\|\\|\\s*.*?\\s*c\\s*&&\\s*d\\.set\\([^,]+\\s*,\\s*([a-zA-Z0-9$]+)\\(";
571+
"yt\\.akamaized\\.net/\\)\\s*\\|\\|\\s*.*?\\s*c\\s*&&\\s*d\\.set\\([^,]+\\s*,\\s*(:encodeURIComponent\\s*\\()([a-zA-Z0-9$]+)\\(";
572572
private final static String DECRYPTION_AKAMAIZED_SHORT_STRING_REGEX =
573-
"\\bc\\s*&&\\s*d\\.set\\([^,]+\\s*,\\s*([a-zA-Z0-9$]+)\\(";
573+
"\\bc\\s*&&\\s*d\\.set\\([^,]+\\s*,\\s*(:encodeURIComponent\\s*\\()([a-zA-Z0-9$]+)\\(";
574574

575575
private volatile String decryptionCode = "";
576576

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ private static StreamInfo extractOptionalData(StreamInfo streamInfo, StreamExtra
270270
}
271271

272272
private StreamType streamType;
273-
private String thumbnailUrl;
274-
private String uploadDate;
273+
private String thumbnailUrl = "";
274+
private String uploadDate = "";
275275
private long duration = -1;
276276
private int ageLimit = -1;
277277
private String description;
@@ -280,26 +280,26 @@ private static StreamInfo extractOptionalData(StreamInfo streamInfo, StreamExtra
280280
private long likeCount = -1;
281281
private long dislikeCount = -1;
282282

283-
private String uploaderName;
284-
private String uploaderUrl;
285-
private String uploaderAvatarUrl;
283+
private String uploaderName = "";
284+
private String uploaderUrl = "";
285+
private String uploaderAvatarUrl = "";
286286

287-
private List<VideoStream> videoStreams;
288-
private List<AudioStream> audioStreams;
289-
private List<VideoStream> videoOnlyStreams;
287+
private List<VideoStream> videoStreams = new ArrayList<>();
288+
private List<AudioStream> audioStreams = new ArrayList<>();
289+
private List<VideoStream> videoOnlyStreams = new ArrayList<>();
290290

291-
private String dashMpdUrl;
292-
private List<VideoStream> segmentedVideoStreams;
293-
private List<AudioStream> segmentedAudioStreams;
294-
private List<VideoStream> segmentedVideoOnlyStreams;
291+
private String dashMpdUrl = "";
292+
private List<VideoStream> segmentedVideoStreams = new ArrayList<>();
293+
private List<AudioStream> segmentedAudioStreams = new ArrayList<>();
294+
private List<VideoStream> segmentedVideoOnlyStreams = new ArrayList<>();
295295

296296

297-
private String hlsUrl;
297+
private String hlsUrl = "";
298298
private StreamInfoItem nextVideo;
299-
private List<InfoItem> relatedStreams;
299+
private List<InfoItem> relatedStreams = new ArrayList<>();
300300

301301
private long startPosition = 0;
302-
private List<SubtitlesStream> subtitles;
302+
private List<SubtitlesStream> subtitles = new ArrayList<>();
303303

304304
/**
305305
* Get the stream type

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractorDASHTest.java

Lines changed: 0 additions & 67 deletions
This file was deleted.

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractorDefaultTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
*/
4444
public class YoutubeStreamExtractorDefaultTest {
4545

46+
/**
47+
* Test for {@link StreamExtractor}
48+
*/
4649
public static class AdeleHello {
4750
private static YoutubeStreamExtractor extractor;
4851

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeSearchCountTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import static junit.framework.TestCase.assertTrue;
1414
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
1515

16+
/**
17+
* Test for {@link YoutubeSearchExtractor}
18+
*/
1619
public class YoutubeSearchCountTest {
1720
public static class YoutubeChannelViewCountTest extends YoutubeSearchExtractorBaseTest {
1821
@BeforeClass
@@ -28,7 +31,7 @@ public static void setUpClass() throws Exception {
2831
public void testViewCount() {
2932
ChannelInfoItem ci = (ChannelInfoItem) itemsPage.getItems().get(0);
3033
assertTrue("Count does not fit: " + Long.toString(ci.getSubscriberCount()),
31-
69043316 < ci.getSubscriberCount() && ci.getSubscriberCount() < 73043316);
34+
69043316 < ci.getSubscriberCount() && ci.getSubscriberCount() < 103043316);
3235
}
3336
}
3437
}

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeSearchExtractorDefaultTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public void testGetSecondPageUrl() throws Exception {
6262

6363
@Test
6464
public void testResultList_FirstElement() {
65-
InfoItem firstInfoItem = itemsPage.getItems().get(1);
65+
InfoItem firstInfoItem = itemsPage.getItems().get(0);
66+
if(! (firstInfoItem instanceof ChannelInfoItem))
67+
firstInfoItem = itemsPage.getItems().get(1);
6668

6769
// The channel should be the first item
6870
assertTrue(firstInfoItem instanceof ChannelInfoItem);
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Fri Jan 18 11:51:40 CET 2019
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip

0 commit comments

Comments
 (0)