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

Tidal & Jiosaavn , Advanced mirroring #247

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
08988b1
apply StringCompareMirroringAudioTrackResolver to DefaultMirroringAud…
WeeeeeeeeeeS Dec 25, 2024
b05dfd8
Used Nansess tidal implementation
WeeeeeeeeeeS Jan 3, 2025
a811daa
Used Nansess tidal implementation
WeeeeeeeeeeS Jan 3, 2025
bd58425
Added "useLocalNetwork" as a proxy option.
WeeeeeeeeeeS Jan 3, 2025
800f308
Made saavn use localnetwork for playback
WeeeeeeeeeeS Jan 3, 2025
f49e5ff
Used fuzzywuzzy:1.4.0
WeeeeeeeeeeS Jan 4, 2025
ba952cc
added TidalToken option & changed application.example.yml
WeeeeeeeeeeS Jan 4, 2025
f51e2f2
updated application.example.yml
WeeeeeeeeeeS Jan 4, 2025
4ef9c2b
Updated ReadMe.md & added more constructors to ProxyConfig & Saavn au…
WeeeeeeeeeeS Jan 4, 2025
2c83c1b
Updated Readme.md
WeeeeeeeeeeS Jan 4, 2025
38bb861
Updated Readme.md
WeeeeeeeeeeS Jan 4, 2025
5a7cfd1
if it works don't touch it? Fixed Saavn
WeeeeeeeeeeS Jan 4, 2025
37c14c3
Added tidal recommendations
WeeeeeeeeeeS Jan 12, 2025
be58db1
Fixed deezer null exception when not using proxies
WeeeeeeeeeeS Jan 13, 2025
2bc7ee6
Update application.example.yml
WeeeeeeeeeeS Jan 15, 2025
9b97a9c
updated apiurl search endpoint in jiosaavn
WeeeeeeeeeeS Jan 15, 2025
6f65617
rewrote StringCompareMirroringAudioTrackResolver
WeeeeeeeeeeS Jan 18, 2025
8b6bc51
changed the configurations to make them more logical, commented out u…
WeeeeeeeeeeS Jan 19, 2025
e22175d
changed Saavn to JioSaavn
WeeeeeeeeeeS Jan 19, 2025
1ad32e1
ProxyManager now implements HttpInterfaceManager, now debugging make …
WeeeeeeeeeeS Jan 19, 2025
2c783cc
changed Deezer & jiosaavn to take ProxyManager instead of configs
WeeeeeeeeeeS Jan 19, 2025
ac3e29d
changed Deezer & jiosaavn to take ProxyManager instead of configs
WeeeeeeeeeeS Jan 19, 2025
da80949
updated README.md & application.example.yml to match the new Proxyman…
WeeeeeeeeeeS Jan 19, 2025
78561ed
added an example of how to use ProxyConfig
WeeeeeeeeeeS Jan 19, 2025
87bf40e
Updated JioSaavn jsrec README.md
WeeeeeeeeeeS Jan 19, 2025
e057b03
updated tidal http link to https
WeeeeeeeeeeS Jan 19, 2025
5909ed0
removed secret key
WeeeeeeeeeeS Jan 21, 2025
e0c2f08
replaced apiUrl with a generic proxy (even easier to self host)
WeeeeeeeeeeS Jan 23, 2025
00909a4
Removed old apiUrl in README.md
WeeeeeeeeeeS Jan 23, 2025
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
103 changes: 96 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ A collection of additional [Lavaplayer v2](https://github.com/sedmelluq/lavaplay
* [Flowery TTS](https://flowery.pw/docs) (Thx to [bachtran02](https://github.com/bachtran02) for implementing it)
* [YouTube](https://youtube.com) & [YouTubeMusic](https://music.youtube.com/) [LavaSearch](https://github.com/topi314/LavaSearch)/[LavaLyrics](https://github.com/topi314/LavaLyrics) (Thx to [DRSchlaubi](https://github.com/DRSchlaubi) for helping me)
* [Vk Music](https://music.vk.com/) playlists/albums/songs/artists(top tracks)/search results/[LavaLyrics](https://github.com/topi314/LavaLyrics)/[LavaSearch](https://github.com/topi314/LavaSearch) (Thx to [Krispeckt](https://github.com/Krispeckt) for implementing it)
* [JioSaavn](https://www.jiosaavn.com) playlists/albums/songs/artists/featured/search results
* [Tidal](https://tidal.com) playlists/albums/songs/search results

> [!IMPORTANT]
> Tracks from Spotify & Apple Music don't actually play from their sources, but are instead resolved via the configured providers
> Tracks from Spotify & Apple Music & Tidal don't actually play from their sources, but are instead resolved via the configured providers

## Summary

Expand Down Expand Up @@ -71,9 +73,16 @@ plugins:
providers: # Custom providers for track loading. This is the default
# - "dzisrc:%ISRC%" # Deezer ISRC provider
# - "dzsearch:%QUERY%" # Deezer search provider
# - 'jssearch:%QUERY%' # JioSaavn search provider (recommended to use with advanced mirroring & search proxies)
- "ytsearch:\"%ISRC%\"" # Will be ignored if track does not have an ISRC. See https://en.wikipedia.org/wiki/International_Standard_Recording_Code
- "ytsearch:%QUERY%" # Will be used if track has no ISRC or no track could be found for the ISRC
# you can add multiple other fallback sources here
# advancedmirroring: # A custom resolver that will be used for regular QUERY searches, and get you the best results from the sources you provide (Recommended for use with bad search platforms)
# sources: # The sources to use for the advanced mirroring
# - jssearch # JioSaavn search source
# skipSoundCloudGo: true # Whether to skip the SoundCloud Go tracks (preview tracks) (optional)
# You can also set the threshold for the title, author & total match (titleThreshold, authorThreshold (1 -> 100), totalMatchThreshold (1 -> 300)) (optional)
# levelOnePenalty: 1, levelTwoPenalty: 2, levelThreePenalty: 0.8 (0 -> 1) # Penalties for the first, second, and third levels (optional)
sources:
spotify: false # Enable Spotify source
applemusic: false # Enable Apple Music source
Expand All @@ -82,6 +91,8 @@ plugins:
flowerytts: false # Enable Flowery TTS source
youtube: false # Enable YouTube search source (https://github.com/topi314/LavaSearch)
vkmusic: false # Enable Vk Music source
jiosaavn: false # Enable JioSaavn source
tidal: false # Enable Tidal source
lyrics-sources:
spotify: false # Enable Spotify lyrics source
deezer: false # Enable Deezer lyrics source
Expand Down Expand Up @@ -113,6 +124,13 @@ plugins:
masterDecryptionKey: "your master decryption key" # the master key used for decrypting the deezer tracks. (yes this is not here you need to get it from somewhere else)
# arl: "your deezer arl" # the arl cookie used for accessing the deezer api this is optional but required for formats above MP3_128
formats: [ "FLAC", "MP3_320", "MP3_256", "MP3_128", "MP3_64", "AAC_64" ] # the formats you want to use for the deezer tracks. "FLAC", "MP3_320", "MP3_256" & "AAC_64" are only available for premium users and require a valid arl
# useLocalNetwork: true # whether to use the local network for accessing the deezer api or just rely on the proxies
# proxies:
# - protocol: "http" # the protocol of the proxy
# host: "192.0.2.146" # the host of the proxy (ip or domain)
# port: 8080 # the port of the proxy
# user: "user" # the user of the proxy (optional)
# password: "youShallPass" # the password of the proxy (optional)
yandexmusic:
accessToken: "your access token" # the token used for accessing the yandex music api. See https://github.com/TopiSenpai/LavaSrc#yandex-music
playlistLoadLimit: 1 # The number of pages at 100 tracks each
Expand All @@ -131,6 +149,23 @@ plugins:
playlistLoadLimit: 1 # The number of pages at 50 tracks each
artistLoadLimit: 1 # The number of pages at 10 tracks each
recommendationsLoadLimit: 10 # Number of tracks
tidal:
countryCode: "US"
searchLimit: 6 # How many search results should be returned
#token: "your tidal token" # optional (in case you want to change the token & use your own)
jiosaavn:
decryption: # The decryption configuration for the jiosaavn tracks
algorithm: "??" # The algorithm used for decryption (Default "DES")
transformation: "??/??/??" # The transformation used for decryption (Default "DES/ECB/PKCS5Padding")
secretKey: "??" # The secret key used for decryption (Find your own secret key)
useLocalNetwork: false # whether to use the local network for accessing the jiosaavn api or just rely on the proxies (keep it false if your server is not in India)
genericProxy: "https://domain.dev/url?url=%LINK%" # A generic HTTP proxy used for search ONLY. The %LINK% will be replaced with the search URL and its parameters.
proxies:
- protocol: "http" # the protocol of the proxy (use http or https)
host: "192.0.2.146" # the host of the proxy (ip or domain)
port: 8080 # the port of the proxy
user: "user" # the user of the proxy (optional)
password: "youShallPass" # the password of the proxy (optional)
```

### Plugin Info
Expand Down Expand Up @@ -492,8 +527,13 @@ Use Google to find a guide on how to get the arl cookie. It's not that hard.
AudioPlayerManager playerManager = new DefaultAudioPlayerManager();

// create a new DeezerSourceManager with the master decryption key and register it

var deezer = new DeezerSourceManager("the master decryption key", "your arl", formats);

// To use Deezer with proxies (user & password are optional)
// proxies = new ProxyConfig[]{new ProxyConfig(proxyProtocol, host, proxyPort, proxyUser, proxyPassword)};
// ProxyManager proxyManager = new ProxyManager(proxies, isUseLocalNetwork);
// deezer = new DeezerAudioSourceManager("the master decryption key", "your arl", formats, proxyManager);

playerManager.registerSourceManager(deezer);
```

Expand Down Expand Up @@ -662,17 +702,53 @@ lyricsManager.registerLyricsManager(vkmusic);
<summary>Click to expand</summary>

```java
// create new search manager
var searchManager = new SearchManager();
AudioPlayerManager playerManager = new DefaultAudioPlayerManager();

// register source
searchManager.registerSearchManager(vkmusic);
// create a new VkMusicSourceManager with the user token and register it
playerManager.registerSourceManager(new VkMusicSourceManager("...");
```

</details>

---

### JioSaavn

<details>
<summary>Supported proxy regions</summary>
India, Pakistan, Afghanistan, Bahrain, Bangladesh, Bhutan, Egypt, Iraq, Jordan, Kuwait, Lebanon, Maldives, Nepal, Oman, Qatar, Saudi Arabia, Sri Lanka, UAE, and Yemen.
</details>

```java
AudioPlayerManager playerManager = new DefaultAudioPlayerManager();

// create a new JioSaavnAudioSourceManager and register it (ONLY IF YOUR SERVER IS IN A SUPPORTED REGION)
var jioSaavn = new JioSaavnAudioSourceManager(new JioSaavnDecryptionConfig(secretKey));

// to use JioSaavn with proxies (user & password are optional)
// proxies = new ProxyConfig[]{new ProxyConfig(proxyProtocol, host, proxyPort, proxyUser, proxyPassword)};
// ProxyManager proxyManager = new ProxyManager(proxies, isUseLocalNetwork);
// var jioSaavn = new JioSaavnAudioSourceManager(proxyManager, new JioSaavnDecryptionConfig(secretKey));

playerManager.registerSourceManager(jioSaavn);
```

---


### Tidal

```java
AudioPlayerManager playerManager = new DefaultAudioPlayerManager();

// Tidal token is optional (in case you want to change the token & use your own)
// country code is optional (default is US)
var tidal = new TidalSourceManager(countryCode, playerManager, DefaultMirroringAudioTrackResolver, tidalToken);
playerManager.registerSourceManager(tidal);
````



## Supported URLs and Queries

### Spotify
Expand Down Expand Up @@ -740,4 +816,17 @@ You can read about all the available options [here](https://flowery.pw/docs), a
* https://vk.com/audios700949584?q=phonk%20album&z=audio_playlist-2000933493_13933493%2Fbe3494d46d310b0d0d
* https://vk.ru/audios700949584?q=phonk%20album&z=audio_playlist-2000933493_13933493

---
### JioSaavn
* `jssearch:animals architects`
* `jsrec:Oj0JdT5yZFo` (`jsrec:{TRACK_ID}`)
* https://www.jiosaavn.com/song/hello/Oj0JdT5yZFo
* https://www.jiosaavn.com/artist/adele-songs/yc6n84bIDm8
* https://www.jiosaavn.com/album/25/NGUmkn-uYyY
* https://www.jiosaavn.com/featured/lets-play-adele/pVh19D03XxOvz,QNANKgeg

### Tidal
* `tdsearch:animals architects`
* `tdrec:205573155` (`tdrec:{TRACK_ID}`)
WeeeeeeeeeeS marked this conversation as resolved.
Show resolved Hide resolved
* https://www.tidal.com/track/205573155
* https://tidal.com/browse/album/165814025
* https://tidal.com/browse/mix/00527d2ae9ccc1721dc
46 changes: 40 additions & 6 deletions application.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ plugins:
providers: # Custom providers for track loading. This is the default
# - "dzisrc:%ISRC%" # Deezer ISRC provider
# - "dzsearch:%QUERY%" # Deezer search provider
# - 'jssearch:%QUERY%' # JioSaavn search provider (recommended to use with advanced mirroring & search proxies)
- "ytsearch:\"%ISRC%\"" # Will be ignored if track does not have an ISRC. See https://en.wikipedia.org/wiki/International_Standard_Recording_Code
- "ytsearch:%QUERY%" # Will be used if track has no ISRC or no track could be found for the ISRC
# you can add multiple other fallback sources here
# you can add multiple other fallback sources here
#advancedmirroring: # A custom resolver that will be used for regular QUERY searches, and get you the best results from the sources you provide (Recommended for use with bad search platforms)
#sources: # The sources to use for the advanced mirroring
# - jssearch # JioSaavn search source
# skipSoundCloudGo: true # Whether to skip the SoundCloud Go tracks (preview tracks) (optional)
# You can also set the threshold for the title, author & total match (titleThreshold, authorThreshold (1 - 100), totalMatchThreshold (1 - 300)) (optional)
# levelOnePenalty: 1, levelTwoPenalty: 2, levelThreePenalty: 0.8 # Penalties for the first, second, and third levels (optional)
sources:
spotify: false # Enable Spotify source
applemusic: false # Enable Apple Music source
Expand All @@ -14,6 +21,8 @@ plugins:
flowerytts: false # Enable Flowery TTs source
youtube: false # Enable YouTube search source (https://github.com/topi314/LavaSearch)
vkmusic: false # Enable Vk Music source
jiosaavn: false # Enable JioSaavn source
tidal: false # Enable Tidal source
lyrics-sources:
spotify: false # Enable Spotify lyrics source
deezer: false # Enable Deezer lyrics source
Expand All @@ -37,6 +46,13 @@ plugins:
masterDecryptionKey: "your master decryption key" # the master key used for decrypting the deezer tracks. (yes this is not here you need to get it from somewhere else)
arl: "your deezer arl" # the arl cookie used for accessing the deezer api
formats: [ "FLAC", "MP3_320", "MP3_256", "MP3_128", "MP3_64", "AAC_64" ] # the formats you want to use for the deezer tracks. "FLAC", "MP3_320", "MP3_256" & "AAC_64" are only available for premium users and require a valid arl
useLocalNetwork: true # whether to use the local network for accessing the deezer api or just rely on the proxies
proxies:
- protocol: "http" # the protocol of the proxy
host: "192.0.2.146" # the host of the proxy (ip or domain)
port: 8080 # the port of the proxy
user: "user" # the user of the proxy (optional)
password: "youShallPass" # the password of the proxy (optional)
yandexmusic:
accessToken: "your access token" # the token used for accessing the yandex music api. See https://github.com/TopiSenpai/LavaSrc#yandex-music
playlistLoadLimit: 1 # The number of pages at 100 tracks each
Expand All @@ -55,6 +71,24 @@ plugins:
playlistLoadLimit: 1 # The number of pages at 50 tracks each
artistLoadLimit: 1 # The number of pages at 10 tracks each
recommendationsLoadLimit: 10 # Number of tracks
tidal:
countryCode: "US"
searchLimit: 6 # The total number of tracks in the search results.
# token: "your tidal token" # optional (in case you want to change the token & use your own)
jiosaavn:
decryption: # The decryption configuration for the jiosaavn tracks
algorithm: "??" # The algorithm used for decryption (Default "DES")
transformation: "??/??/??" # The transformation used for decryption (Default "DES/ECB/PKCS5Padding")
secretKey: "??" # The secret key used for decryption (Find your own secret key)
useLocalNetwork: false # whether to use the local network for accessing the jiosaavn or just rely on the proxies (keep it false if your server is not in India)
genericProxy: "https://domain.dev/url?url=%LINK%" # A generic HTTP proxy used for search ONLY. The %LINK% will be replaced with the search URL and its parameters.
proxies:
- protocol: "http" # the protocol of the proxy (use http or https)
host: "192.0.2.146" # the host of the proxy (ip or domain)
port: 8080 # the port of the proxy
user: "user" # the user of the proxy (optional)
password: "youShallPass" # the password of the proxy (optional)


server: # REST and WS server
port: 2333
Expand Down Expand Up @@ -115,10 +149,10 @@ lavalink:
# email: "" # Email of Google account
# password: "" # Password of Google account
# httpConfig: # Useful for blocking bad-actors from ip-grabbing your music node and attacking it, this way only the http proxy will be attacked
# proxyHost: "localhost" # Hostname of the proxy, (ip or domain)
# proxyPort: 3128 # Proxy port, 3128 is the default for squidProxy
# proxyUser: "" # Optional user for basic authentication fields, leave blank if you don't use basic auth
# proxyPassword: "" # Password for basic authentication
# host: "localhost" # Hostname of the proxy, (ip or domain)
# port: 3128 # Proxy port, 3128 is the default for squidProxy
# user: "" # Optional user for basic authentication fields, leave blank if you don't use basic auth
# password: "" # Password for basic authentication

metrics:
prometheus:
Expand Down Expand Up @@ -152,4 +186,4 @@ logging:
logback:
rollingpolicy:
max-file-size: 1GB
max-history: 30
max-history: 30
2 changes: 2 additions & 0 deletions main/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ dependencies {
implementation("com.auth0:java-jwt:4.4.0")
compileOnly("org.slf4j:slf4j-api:2.0.7")

implementation("me.xdrop:fuzzywuzzy:1.4.0")

lyricsDependency("protocol")
lyricsDependency("client")
}
Expand Down
Loading