Skip to content

Commit

Permalink
Added LiveStreamOffline exception
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeucelli committed Sep 27, 2024
1 parent b2aac9f commit e1a2b8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/github/felipeucelli/javatube/Youtube.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ void checkAvailability() throws Exception {
throw new VideoPrivateError(videoId());
}
}

case "LIVE_STREAM_OFFLINE" -> throw new LiveStreamOffline(videoId(), reason);

case "ERROR" -> {
if (reason.equals("Video unavailable")) {
throw new VideoUnavailableError(videoId());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.github.felipeucelli.javatube.exceptions;

public class LiveStreamOffline extends Exception{
public LiveStreamOffline(String videoId, String reason){
super(videoId + " " + reason);
}
}

0 comments on commit e1a2b8d

Please sign in to comment.