mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-14 22:30:33 +05:30
empty support returns "", same for empty description
This commit is contained in:
parent
74439f692a
commit
20da4750f8
@ -76,7 +76,7 @@ public class PeertubeStreamExtractor extends StreamExtractor {
|
|||||||
try {
|
try {
|
||||||
desc = JsonUtils.getString(json, "description");
|
desc = JsonUtils.getString(json, "description");
|
||||||
} catch (ParsingException e) {
|
} catch (ParsingException e) {
|
||||||
return "No description";
|
return "";
|
||||||
}
|
}
|
||||||
if (desc.length() == 250 && desc.substring(247).equals("...")) {
|
if (desc.length() == 250 && desc.substring(247).equals("...")) {
|
||||||
//if description is shortened, get full description
|
//if description is shortened, get full description
|
||||||
@ -256,7 +256,11 @@ public class PeertubeStreamExtractor extends StreamExtractor {
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public String getSupportInfo() throws ParsingException {
|
public String getSupportInfo() throws ParsingException {
|
||||||
return JsonUtils.getString(json, "support");
|
try {
|
||||||
|
return JsonUtils.getString(json, "support");
|
||||||
|
} catch (ParsingException e) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getRelatedStreamsUrl(List<String> tags) throws UnsupportedEncodingException {
|
private String getRelatedStreamsUrl(List<String> tags) throws UnsupportedEncodingException {
|
||||||
|
@ -61,7 +61,7 @@ public class PeertubeStreamExtractorDefaultTest {
|
|||||||
public void testGetEmptyDescription() throws Exception {
|
public void testGetEmptyDescription() throws Exception {
|
||||||
PeertubeStreamExtractor extractorEmpty = (PeertubeStreamExtractor) PeerTube.getStreamExtractor("https://framatube.org/api/v1/videos/d5907aad-2252-4207-89ec-a4b687b9337d");
|
PeertubeStreamExtractor extractorEmpty = (PeertubeStreamExtractor) PeerTube.getStreamExtractor("https://framatube.org/api/v1/videos/d5907aad-2252-4207-89ec-a4b687b9337d");
|
||||||
extractorEmpty.fetchPage();
|
extractorEmpty.fetchPage();
|
||||||
assertEquals("No description", extractorEmpty.getDescription());
|
assertEquals("", extractorEmpty.getDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user