diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..2e8d3ac --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: appujet # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: sdip521 # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: appujet # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..7f9c4db --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,23 @@ +--- +name: Technical issue +about: Use this if you are having a problem with Lavalink +title: '' +labels: '' +assignees: '' + +--- + +## Description + + + +## Version info +**Client used:** + +Output of `java -version`: +``` +(paste here) +``` + + + diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml new file mode 100644 index 0000000..240e196 --- /dev/null +++ b/.github/workflows/release-beta.yml @@ -0,0 +1,31 @@ +name: Release Beta + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + path: './' + fetch-depth: 0 + - name: Set up java + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '17' + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: dependencies + run: ./gradlew --no-daemon dependencies + - name: Release to github + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + RELEASE_TARGET: ${{ github.sha }} + PRERELEASE: true + run: ./gradlew --no-daemon build githubRelease diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..49cdaa3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + workflow_dispatch: + inputs: + prerelease: + description: Whether or not this is a prerelease + type: boolean + default: false + required: true +# push: +# branches: +# - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + path: './' + fetch-depth: 0 + - name: Set up java + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '17' + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: dependencies + run: ./gradlew --no-daemon dependencies + - name: Release to github + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + USERNAME: ${{ secrets.USERNAME }} + PASSWORD: ${{ secrets.PASSWORD }} + RELEASE_TARGET: ${{ github.sha }} + run: ./gradlew --no-daemon build publish githubRelease -x test diff --git a/README.md b/README.md index 83ec897..3bd9499 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ -## JioSaavn Plugin For Lavalink +# JioSaavn Plugin For Lavalink - This is a plugin for [Lavalink](https://github.com/lavalink-devs/Lavalink) - This plugin allows you to play songs from JioSaavn in your discord server. - This plugin uses the [JioSaavn API](https://github.com/sumitkolhe/jiosaavn-api) to fetch songs. - Special thanks to [topi314](https://github.com/topi314/LavaSrc) and [duncte123](https://github.com/duncte123) because most of the code for this plugin is based on [Lavasrc](https://github.com/topi314/LavaSrc) and [skybot-lavalink-plugin](https://github.com/DuncteBot/skybot-lavalink-plugin). - ## Configuration For all supported urls and queries see [here](#supported-urls-and-queries) (YES `plugins` IS AT ROOT IN THE YAML) + ```yaml server: # REST and WS server port: 2333 @@ -18,7 +18,7 @@ server: # REST and WS server lavalink: # plugins would go here, but they are auto-loaded when developing # plugins: -# - dependency: "com.appujet:jiosaavan-plugin:VERSION" +# - dependency: "com.appujet:jiosaavn-plugin:VERSION" # repository: "https://jitpack.io" server: password: "youshallnotpass" @@ -45,7 +45,7 @@ lavalink: #retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times plugins: - jiosaavan: + jiosaavn: apiURL: "https://saavn.dev/api" # JioSaavn API URL metrics: prometheus: @@ -70,28 +70,32 @@ logging: lavalink: INFO ``` - ## Advantages of Using JioSaavn -* No region-based content blocking (unlike Deezer and Yandex). -* A better alternative for playing mirrored audio sources not dependent on YouTube. -* Similar content library size as Spotify and Apple Music. -* Superior to Deezer as it doesn't require any decryption key and provides slightly higher bitrate audio than Deezer's 128KBPS MP3. +- No region-based content blocking (unlike Deezer and Yandex). +- A better alternative for playing mirrored audio sources not dependent on YouTube. +- Similar content library size as Spotify and Apple Music. +- Superior to Deezer as it doesn't require any decryption key and provides slightly higher bitrate audio than Deezer's 128KBPS MP3. ## Supported URLs and Queries -### JioSaavan -* `jssearch:animals architects` -* https://www.jiosaavn.com/song/apna-bana-le/ATIfejZ9bWw -* https://www.jiosaavn.com/album/bhediya/wSM2AOubajk_ -* https://www.jiosaavn.com/artist/arijit-singh-songs/LlRWpHzy3Hk_ -* https://www.jiosaavn.com/featured/jai-hanuman/8GIEhrr8clSO0eMLZZxqsA__ + +### JioSaavn + +- `jssearch:animals architects` - Search for a song on JioSaavn. +- `jsrec:identifier` - Get a song recommendation based on the identifier. + +- +- _ +- _ +- __ ## How to get API URL ? -* You can host the api locally using [this guide](https://github.com/sumitkolhe/jiosaavn-api) -* You can easily deploy your own instance of the API by clicking the button below: + +- You can host the api locally using [this guide](https://github.com/sumitkolhe/jiosaavn-api) + +- You can easily deploy your own instance of the API by clicking the button below: [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/sumitkolhe/jiosaavn-api) > [!TIP] > To ensure the API provides results in the intended language, configure the [Serverless Function Region](https://vercel.com/docs/concepts/functions/serverless-functions/regions) in Vercel to `Mumbai, India (South) - > bom1`. - diff --git a/main/src/main/java/com/github/appujet/jiosaavn/source/JioSaavnAudioSourceManager.java b/main/src/main/java/com/github/appujet/jiosaavn/source/JioSaavnAudioSourceManager.java index cff03d5..483f3d6 100644 --- a/main/src/main/java/com/github/appujet/jiosaavn/source/JioSaavnAudioSourceManager.java +++ b/main/src/main/java/com/github/appujet/jiosaavn/source/JioSaavnAudioSourceManager.java @@ -83,7 +83,7 @@ public void encodeTrack(AudioTrack audioTrack, DataOutput dataOutput) { @Override public AudioTrack decodeTrack(AudioTrackInfo audioTrackInfo, DataInput dataInput) { - return new JioSaavanAudioTrack(audioTrackInfo, this); + return new JioSaavnAudioTrack(audioTrackInfo, this); } private AudioItem getSearchResult(String query) throws IOException { @@ -123,7 +123,7 @@ public AudioItem getAlbum(String identifier) { if (data.get("songs").isNull()) { return AudioReference.NO_TRACK; } - return new JioSaavanAudioPlaylist( + return new JioSaavnAudioPlaylist( data.get("name").text(), this.buildTracks(data.get("songs")), ExtendedAudioPlaylist.Type.ALBUM, @@ -144,7 +144,7 @@ public AudioItem getPlaylist(String identifier) { if (data.get("songs").isNull()) { return AudioReference.NO_TRACK; } - return new JioSaavanAudioPlaylist( + return new JioSaavnAudioPlaylist( data.get("name").text(), this.buildTracks(data.get("songs")), ExtendedAudioPlaylist.Type.PLAYLIST, @@ -165,7 +165,7 @@ private AudioItem getArtist(String identifier) { if (data.get("topSongs").isNull()) { return AudioReference.NO_TRACK; } - return new JioSaavanAudioPlaylist( + return new JioSaavnAudioPlaylist( data.get("name").text(), this.buildTracks(data.get("topSongs")), ExtendedAudioPlaylist.Type.ARTIST, @@ -189,7 +189,7 @@ public AudioItem getRecommendations(String identifier) { var tracks = this.buildTracks(data); - return new JioSaavanAudioPlaylist( + return new JioSaavnAudioPlaylist( "Recommendations", tracks, ExtendedAudioPlaylist.Type.RECOMMENDATIONS, @@ -231,7 +231,7 @@ private AudioTrack buildTrack(JsonBrowser data) { final long duration = data.get("duration").asLong(1) * 1000; final String url = data.get("url").text(); var artist = cleanString(this.parseArtist(data)); - return new JioSaavanAudioTrack( + return new JioSaavnAudioTrack( new AudioTrackInfo( title, artist, diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index ae5297e..51d7efc 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -8,7 +8,7 @@ plugins { id("com.github.breadmoirai.github-release") } -val pluginVersion = Version(0, 0, 2) +val pluginVersion = Version(0, 1, 0) group = "com.github.appujet" version = "$pluginVersion"