roleback using href for description links
This commit is contained in:
parent
3aa7ff6d0e
commit
fef71aeccc
|
@ -176,12 +176,12 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||
if(link != null) {
|
||||
// if link is null the a tag is a hashtag.
|
||||
// They refer to the youtube search. We do not handle them.
|
||||
a.attr("abs:href", link);
|
||||
a.text(link);
|
||||
|
||||
} else if(redirectLink.toString().contains("watch?v=")) {
|
||||
// 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.attr("abs:href", redirectLink.toString());
|
||||
a.text(redirectLink.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ public class YoutubeStreamExtractorDefaultTest {
|
|||
@Test
|
||||
public void testGetFullLinksInDescriptlion() throws ParsingException {
|
||||
assertTrue(extractor.getDescription().contains("http://smarturl.it/SubscribeAdele?IQid=yt"));
|
||||
assertTrue(extractor.getDescription().contains("http://smarturl.it/SubscribeAdele?IQi..."));
|
||||
assertFalse(extractor.getDescription().contains("http://smarturl.it/SubscribeAdele?IQi..."));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue