aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/App.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/App.java')
-rw-r--r--src/main/java/App.java34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/main/java/App.java b/src/main/java/App.java
index 2183afd..6095c9b 100644
--- a/src/main/java/App.java
+++ b/src/main/java/App.java
@@ -1,7 +1,11 @@
import com.pina.Holodex;
import com.pina.HolodexException;
+import com.pina.datatypes.Channel;
import com.pina.datatypes.SimpleVideo;
-import com.pina.query.VideoSearchQueryBuilder;
+import com.pina.datatypes.Video;
+import com.pina.query.ChannelQueryBuilder;
+import com.pina.query.VideoByVideoIdQueryBuilder;
+import com.pina.query.VideoQueryBuilder;
import java.util.List;
@@ -10,17 +14,27 @@ public class App
public static void main( String[] args )
{
try {
- Holodex holodex = new Holodex("e6bf4c1a-b58c-4b25-bb13-47cdc1146321");
- Object srv = holodex.searchVideo(new VideoSearchQueryBuilder().setOrg(List.of("Nijisanji")).setSort("newest").
- setTarget(List.of("stream")).setPaginated(false).setLimit(10).setOffset(0)
- .setTopic(List.of("singing"))
- );
- System.out.println("--- Search Results ---");
- for (SimpleVideo video : (List<SimpleVideo>) srv) {
- System.out.println(video.title + " - " + video.channel.name);
+ Holodex holodex = new Holodex("YOUR_API_KEY_HERE");
+ Channel channel = holodex.getChannel("UC4WvIIAo89_AzGUh1AZ6Dkg");
+ System.out.println(channel.name + " is a member of " + channel.org + " and has " + channel.suborg + " as a suborg");
+
+ VideoQueryBuilder liveVideoQuery = new VideoQueryBuilder().setStatus("live").setOrg("Hololive");
+ List<SimpleVideo> currentlyLiveVideos = holodex.getLiveAndUpcomingVideos(liveVideoQuery);
+ System.out.println("Currently there are " + currentlyLiveVideos.size() + " livestreams on going in Hololive");
+
+ for (SimpleVideo video : currentlyLiveVideos) {
+ System.out.println(video.channel.name + " is currently live with " + video.live_viewers + " views");
}
- } catch (HolodexException ex) {
+ ChannelQueryBuilder channelQuery = new ChannelQueryBuilder();
+ channelQuery.setOrg("Nijisanji");
+ channelQuery.setLimit(75);
+ List<Channel> nijisanjiMembers = holodex.getChannels(channelQuery);
+
+ Video anotherVideo = holodex.getVideo(new VideoByVideoIdQueryBuilder().setVideoId("9-O_IWM3184").setLang("en"));
+ System.out.println(anotherVideo.channel.name + " uploaded a video titled " + anotherVideo.title +
+ " on " + anotherVideo.published_at);
+ } catch (HolodexException ex) {
throw new RuntimeException(ex);
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage