add original url for share

This commit is contained in:
yausername 2019-11-16 02:42:39 +05:30
parent d7582734e7
commit 193442d01c
3 changed files with 11 additions and 1 deletions

View File

@ -180,4 +180,9 @@ public class PeertubeChannelExtractor extends ChannelExtractor {
return JsonUtils.getString(json, "displayName"); return JsonUtils.getString(json, "displayName");
} }
@Override
public String getOriginalUrl() throws ParsingException {
return ServiceList.PeerTube.getBaseUrl() + "/accounts/" + getId();
}
} }

View File

@ -291,4 +291,9 @@ public class PeertubeStreamExtractor extends StreamExtractor {
return JsonUtils.getString(json, "name"); return JsonUtils.getString(json, "name");
} }
@Override
public String getOriginalUrl() throws ParsingException {
return ServiceList.PeerTube.getBaseUrl() + "/videos/watch/" + getId();
}
} }

View File

@ -64,7 +64,7 @@ public class PeertubeChannelExtractorTest {
@Test @Test
public void testOriginalUrl() throws ParsingException { public void testOriginalUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/api/v1/accounts/kde", extractor.getOriginalUrl()); assertEquals("https://peertube.mastodon.host/accounts/kde", extractor.getOriginalUrl());
} }
/*////////////////////////////////////////////////////////////////////////// /*//////////////////////////////////////////////////////////////////////////