fix failing watch links
This commit is contained in:
parent
1e7bcfbd66
commit
49c2eb5185
|
@ -177,12 +177,10 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||||
// if link is null the a tag is a hashtag.
|
// if link is null the a tag is a hashtag.
|
||||||
// They refer to the youtube search. We do not handle them.
|
// They refer to the youtube search. We do not handle them.
|
||||||
a.text(link);
|
a.text(link);
|
||||||
|
} else if(redirectLink.toString().contains("https://www.youtube.com/")) {
|
||||||
|
a.text(redirectLink.toString());
|
||||||
}
|
}
|
||||||
} else if(redirectLink.toString().contains("watch?v=")
|
} else if(redirectLink.toString().contains("https://www.youtube.com/")) {
|
||||||
|| redirectLink.toString().contains("https://www.youtube.com/")) {
|
|
||||||
// Another posibility is that this link is pointing to another video
|
|
||||||
// we need to put the redirectLink in here explicitly in order to add the domain part to the link.
|
|
||||||
a.text(redirectLink.toString());
|
a.text(redirectLink.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,7 @@ public class YoutubeStreamExtractorDefaultTest {
|
||||||
public static void setUp() throws Exception {
|
public static void setUp() throws Exception {
|
||||||
NewPipe.init(Downloader.getInstance());
|
NewPipe.init(Downloader.getInstance());
|
||||||
extractor = (YoutubeStreamExtractor) YouTube
|
extractor = (YoutubeStreamExtractor) YouTube
|
||||||
.getStreamExtractor("https://www.youtube.com/watch?v=dJY8iT341F4");
|
.getStreamExtractor("https://www.youtube.com/watch?v=LUldijpMUew");
|
||||||
extractor.fetchPage();
|
extractor.fetchPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,14 +189,14 @@ public class YoutubeStreamExtractorDefaultTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGetFullLinksInDescriptlion() throws ParsingException {
|
public void testGetFullLinksInDescriptlion() throws ParsingException {
|
||||||
assertTrue(extractor.getDescription().contains("https://www.reddit.com/r/PewdiepieSubmissions/"));
|
assertTrue(extractor.getDescription().contains("https://www.reddit.com/r/PewdiepieSubmissions/"));
|
||||||
assertTrue(extractor.getDescription().contains("https://www.youtube.com/channel/UC3e8EMTOn4g6ZSKggHTnNng"));
|
assertTrue(extractor.getDescription().contains("https://www.youtube.com/channel/UCeKXymg6S6Pt4EjjOlA759w"));
|
||||||
|
assertTrue(extractor.getDescription().contains("https://www.youtube.com/watch?v=N6hVmn9FM7o"));
|
||||||
|
assertTrue(extractor.getDescription().contains("https://usa.clutchchairz.com/product/pewdiepie-edition-throttle-series/"));
|
||||||
|
|
||||||
assertFalse(extractor.getDescription().contains("https://www.reddit.com/r/PewdiepieSub..."));
|
assertFalse(extractor.getDescription().contains("https://www.reddit.com/r/PewdiepieSub..."));
|
||||||
|
assertFalse(extractor.getDescription().contains("https://www.youtube.com/channel/UCeKX..."));
|
||||||
|
assertFalse(extractor.getDescription().contains("https://www.youtube.com/watch?v=qpaV3..."));
|
||||||
assertFalse(extractor.getDescription().contains("https://usa.clutchchairz.com/product/..."));
|
assertFalse(extractor.getDescription().contains("https://usa.clutchchairz.com/product/..."));
|
||||||
assertFalse(extractor.getDescription().contains("https://europe.clutchchairz.com/en/pr..."));
|
|
||||||
assertFalse(extractor.getDescription().contains("https://canada.clutchchairz.com/produ..."));
|
|
||||||
assertFalse(extractor.getDescription().contains("http://store.steampowered.com/app/703..."));
|
|
||||||
assertFalse(extractor.getDescription().contains("https://www.youtube.com/channel/UC3e8..."));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue