Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make some methods public for legal reasons :) #185

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private JsonBrowser generateLicenceToken(boolean useArl) {
return this.getJsonResponse(request, useArl);
}

private SourceWithFormat getSource(boolean tryFlac, boolean isRetry) throws URISyntaxException {
public SourceWithFormat getSource(boolean tryFlac, boolean isRetry) throws URISyntaxException {
var json = this.generateLicenceToken(tryFlac);
this.checkResponse(json, "Failed to get user token: ");

Expand Down Expand Up @@ -146,7 +146,7 @@ private void checkResponse(JsonBrowser json, String message) throws IllegalState
}
}

private byte[] getTrackDecryptionKey() throws NoSuchAlgorithmException {
public byte[] getTrackDecryptionKey() throws NoSuchAlgorithmException {
var md5 = Hex.encodeHex(MessageDigest.getInstance("MD5").digest(this.trackInfo.identifier.getBytes()), true);
var master_key = this.sourceManager.getMasterDecryptionKey().getBytes();

Expand Down Expand Up @@ -188,7 +188,7 @@ public AudioSourceManager getSourceManager() {
return this.sourceManager;
}

private static class SourceWithFormat {
public static class SourceWithFormat {
private final URI url;
private final String format;
private final long contentLength;
Expand All @@ -199,6 +199,18 @@ private SourceWithFormat(String url, String format, long contentLength) throws U
this.contentLength = contentLength;
}

public URI getUrl() {
return this.url
}

public String getFormat() {
return this.format;
}

public long getContentLength() {
return this.contentLength;
}

private BiFunction<AudioTrackInfo, PersistentHttpStream, InternalAudioTrack> getTrackFactory() {
return this.format.equals("FLAC") ? FlacAudioTrack::new : Mp3AudioTrack::new;
}
Expand Down