samp.directory
← Betikler ve kütüphaneler

senaaforgerr/spotify.lua

Spotify-style music player for GTA SA-MP Mobile (MonetLoader) with full-length YouTube audio.

Araç★ 115 saat önce güncellendiGPL-3.0Lua
GitHub’da aç

README.md

spotify.lua

Pemutar musik bergaya Spotify untuk GTA SA-MP Mobile lewat MonetLoader. Pencarian dan metadata lagu diambil dari endpoint web Spotify, audio penuh diputar dari YouTube. Tidak perlu akun Spotify atau Premium, dan tidak ada preview 30 detik.

Bahasa: Bahasa Indonesia · English

Bahasa Indonesia

Fitur

  • Pencarian lagu dan metadata dari endpoint web Spotify tanpa login.
  • Audio penuh dari YouTube, bukan preview 30 detik.
  • UI mimgui dengan tab Home, Search, Now Playing, Queue, dan Info.
  • Empat playlist publik di Home, lengkap dengan halaman detail, Play, dan Shuffle.
  • Queue, shuffle, repeat, seek, dan volume. Audio tetap berjalan saat panel ditutup.
  • Tab Info berisi author, lisensi, Discord, dan YouTube. Link dibuka lewat Android intent, jadi aplikasi Discord atau YouTube langsung terbuka jika terpasang.
  • Native libspaudio.so untuk armeabi-v7a dan arm64-v8a, dipilih otomatis sesuai ABI perangkat.

Kebutuhan

  • Android dengan GTA SA-MP Mobile.
  • MonetLoader yang menyediakan mimgui, cjson, jsoncfg, sha1, dan basexx.
  • Native library sesuai ABI perangkat. Keduanya sudah disertakan di lib/.

Instalasi

  1. Clone atau unduh repo ini.

  2. Salin spotify.lua, folder asset/, dan folder lib/ ke folder loader:

    /storage/emulated/0/Android/media/<package>/monetloader/
    

    Ganti <package> dengan package client yang dipakai. Contoh untuk GTA SA: com.rockstargames.gtasa. Pertahankan struktur folder asset/ dan lib/.

  3. Force-stop game, lalu buka lagi. Script menyalin libspaudio.so yang sesuai ABI ke direktori internal aplikasi saat pertama kali dijalankan.

  4. Tunggu pesan [spotify] v1.0.2 ready. Type /spotify to open the player.

Pemakaian

  1. Ketik /spotify atau /sp untuk membuka panel. Ketik lagi atau tekan tombol close untuk menutupnya.
  2. Di Home, ketuk kartu playlist untuk membuka detail, lalu tekan Play atau Shuffle.
  3. Di Search, ketik judul atau nama artis lalu tekan Enter atau tombol Search. Ketuk hasil untuk memutar. Pencarian mengembalikan maksimal 20 lagu.
  4. Gunakan halaman Now Playing atau dock bawah untuk seek, previous, play/pause, next, shuffle, repeat, dan volume.
  5. Buka tab Queue atau panel antrean kanan untuk melihat dan memilih lagu berikutnya.
  6. Buka tab Info untuk melihat author, lisensi, dan link komunitas.

Audio tetap berjalan saat panel ditutup.

Konfigurasi

File config dibuat otomatis saat pertama kali dijalankan. MonetLoader menyimpannya di config/spotify.json di dalam folder loader:

/storage/emulated/0/Android/media/<package>/monetloader/config/spotify.json
KeyDefaultKeterangan
volume0.8Volume 0.0 sampai 1.0.
tabhomeTab terakhir: home, search, now, queue, atau info.
device_iddibuat otomatis32 karakter hex untuk client token Spotify.
search_hashbawaanHash query searchTracks; diperbarui otomatis.
client_versionbawaanVersi web client Spotify; diperbarui otomatis.

Volume dan tab disimpan otomatis. Hapus file config untuk kembali ke default.

Build native

Hanya perlu jika ingin membangun ulang libspaudio.so. Butuh Rust 1.100 atau lebih baru, target aarch64-linux-android dan armv7-linux-androideabi, dua sysroot NDK yang sudah disiapkan, clang, lld, dan llvm-strip.

rustup target add aarch64-linux-android armv7-linux-androideabi

SP_NDK_ARMV7=/path/to/ndk-armv7 \
SP_NDK_ARM64=/path/to/ndk-arm64 \
./build.sh

Direktori NDK harus berisi sysroot/ dan resource directory clang yang sesuai; lihat build.sh untuk layout yang dipakai. Output ada di build/<abi>/libspaudio.so, lalu disalin ke lib/<abi>/libspaudio.so dalam keadaan stripped.

./test.sh menjalankan pemeriksaan host: format, clippy, unit test Rust, cek sintaks dan lint Lua, harness UI headless, serta pemeriksaan simbol dan ELF kedua library. Tool yang dibutuhkan: cargo, rustfmt, clippy, luacheck, luac5.1, luajit, readelf, dan nm.

Struktur

spotify.lua              script utama
Cargo.toml               manifest crate Rust
Cargo.lock               lockfile dependensi
build.sh                 build libspaudio untuk dua ABI
src/                     sumber Rust libspaudio
tests/                   test Rust dan harness Lua
lib/armeabi-v7a/         library untuk perangkat 32-bit
lib/arm64-v8a/           library untuk perangkat 64-bit
asset/fonts/             Roboto dan Font Awesome
docs/now-playing.jpg     screenshot

Batasan

  • Tidak ada login Spotify, library pribadi, unduhan audio, atau pemutaran offline.
  • Home memakai empat playlist publik yang ditentukan di spotify.lua.
  • Pencarian mengembalikan maksimal 20 lagu.
  • Endpoint Spotify dan YouTube yang dipakai adalah endpoint internal web player, bukan API publik resmi. Perubahan dari sisi layanan bisa memutus pencarian atau pemutaran.
  • Audio yang tersedia bergantung pada region, ketersediaan video, dan format yang diberikan YouTube.
  • Kecocokan video memakai judul, artis, dan durasi. Video dengan durasi mirip tetap bisa terpilih walaupun bukan rekaman yang dimaksud.

Masalah umum

GejalaPemeriksaan
Script tidak munculPastikan spotify.lua ada di folder monetloader/. Cek log MonetLoader.
Failed to start: ...Baca pesan setelah titik dua dan cek lib/<abi>/libspaudio.so.
Font atau ikon tidak munculPastikan folder asset/fonts ada di root loader.
HTTP queue full / native not readyPastikan libspaudio.so sesuai ABI dan berasal dari repo ini, lalu force-stop dan buka ulang game.
Lagu gagal diputarCoba lagu lain; YouTube mungkin tidak menyediakan audio penuh yang cocok.
Link Info tidak terbukaPastikan ada aplikasi atau browser yang bisa menangani link.

Lisensi

Author: Senaa (senaaforgerr). Copyright (C) 2026 sena.

Kode dilisensikan di bawah GNU General Public License v3.0 only. Teks lengkap ada di LICENSE. Sumber native Rust di src/, Cargo.toml, Cargo.lock, dan build.sh disertakan agar lib/<abi>/libspaudio.so bisa dibangun ulang.

Roboto di asset/fonts/ memakai Apache License 2.0; lihat asset/fonts/LICENSE-Roboto.txt. Font Awesome mengikuti lisensi di asset/fonts/LICENSE-FontAwesome.txt.

Proyek ini tidak berafiliasi dengan Spotify atau YouTube.

Komunitas

English

Spotify-style music player for GTA SA-MP Mobile on MonetLoader. Search and track metadata come from Spotify's web endpoints, full-length audio comes from YouTube. No Spotify account or Premium needed, and no 30-second preview.

Features

  • Track search and metadata from Spotify's web endpoints without login.
  • Full-length audio from YouTube, not a 30-second preview.
  • mimgui UI with Home, Search, Now Playing, Queue, and Info tabs.
  • Four public playlists on Home, with a detail page, Play, and Shuffle.
  • Queue, shuffle, repeat, seek, and volume. Audio keeps playing when the panel is closed.
  • Info tab with author, license, Discord, and YouTube. Links open through an Android intent, so the Discord or YouTube app opens directly when installed.
  • Native libspaudio.so for armeabi-v7a and arm64-v8a, selected automatically for the device ABI.

Requirements

  • Android with GTA SA-MP Mobile.
  • MonetLoader with mimgui, cjson, jsoncfg, sha1, and basexx.
  • The native library for the device ABI. Both are included in lib/.

Installation

  1. Clone or download this repository.

  2. Copy spotify.lua, the asset/ folder, and the lib/ folder into the loader directory:

    /storage/emulated/0/Android/media/<package>/monetloader/
    

    Replace <package> with the client package. For GTA SA, for example: com.rockstargames.gtasa. Keep the asset/ and lib/ folder structure.

  3. Force-stop the game, then open it again. On first run the script copies the libspaudio.so matching the device ABI into the app's internal directory.

  4. Wait for [spotify] v1.0.2 ready. Type /spotify to open the player.

Usage

  1. Type /spotify or /sp to open the panel. Use the same command or the close button to hide it.
  2. On Home, tap a playlist card to open its detail page, then press Play or Shuffle.
  3. On Search, type a title or artist and press Enter or the Search button. Tap a result to play it. Search returns at most 20 tracks.
  4. Use Now Playing or the bottom dock to seek, go to the previous track, play/pause, go to the next track, toggle shuffle or repeat, and change the volume.
  5. Open the Queue tab or the right-side queue drawer to see and select upcoming tracks.
  6. Open the Info tab for the author, license, and community links.

Audio keeps playing when the panel is closed.

Configuration

The config file is created on first run. MonetLoader stores it as config/spotify.json inside the loader directory:

/storage/emulated/0/Android/media/<package>/monetloader/config/spotify.json
KeyDefaultNotes
volume0.80.0 to 1.0.
tabhomeLast tab: home, search, now, queue, or info.
device_idgenerated32 hex characters for the Spotify client token.
search_hashbuilt insearchTracks query hash; updated automatically.
client_versionbuilt inSpotify web client version; updated automatically.

Volume and tab are saved automatically. Delete the file to return to the defaults.

Building the native library

Only needed to rebuild libspaudio.so. Requires Rust 1.100 or newer, the aarch64-linux-android and armv7-linux-androideabi targets, two prepared NDK sysroots, clang, lld, and llvm-strip.

rustup target add aarch64-linux-android armv7-linux-androideabi

SP_NDK_ARMV7=/path/to/ndk-armv7 \
SP_NDK_ARM64=/path/to/ndk-arm64 \
./build.sh

The NDK directories must contain sysroot/ and the matching clang resource directory; see build.sh for the expected layout. Output goes to build/<abi>/libspaudio.so, then to lib/<abi>/libspaudio.so in stripped form.

./test.sh runs the host checks: formatting, clippy, Rust unit tests, Lua syntax and lint checks, headless UI harnesses, and symbol/ELF checks on both libraries. Required tools: cargo, rustfmt, clippy, luacheck, luac5.1, luajit, readelf, and nm.

Layout

spotify.lua              main script
Cargo.toml               Rust crate manifest
Cargo.lock               dependency lockfile
build.sh                 libspaudio build for both ABIs
src/                     Rust libspaudio sources
tests/                   Rust tests and Lua harnesses
lib/armeabi-v7a/         library for 32-bit devices
lib/arm64-v8a/           library for 64-bit devices
asset/fonts/             Roboto and Font Awesome
docs/now-playing.jpg     screenshot

Limitations

  • No Spotify login, private library, audio download, or offline playback.
  • Home uses the four public playlists defined in spotify.lua.
  • Search returns at most 20 tracks.
  • The Spotify and YouTube endpoints are internal web-player endpoints, not the official public APIs. Changes on their side can break search or playback.
  • Available audio depends on region, video availability, and the formats YouTube returns.
  • Matching uses title, artist, and duration. A video with a similar duration can still be selected even if it is not the intended recording.

Troubleshooting

SymptomCheck
Script does not appearMake sure spotify.lua is in monetloader/. Check the MonetLoader log.
Failed to start: ...Read the message after the colon and check lib/<abi>/libspaudio.so.
Fonts or icons are missingMake sure asset/fonts exists in the loader root.
HTTP queue full / native not readyMake sure libspaudio.so matches the device ABI and comes from this repo, then force-stop and reopen the game.
A track fails to playTry another track; YouTube may not provide a matching full-length audio source.
Info links do not openMake sure an app or browser is available to handle the link.

License

Author: Senaa (senaaforgerr). Copyright (C) 2026 sena.

The project is licensed under the GNU General Public License v3.0 only. The full text is in LICENSE. The Rust native sources in src/, Cargo.toml, Cargo.lock, and build.sh are included so lib/<abi>/libspaudio.so can be rebuilt.

Roboto in asset/fonts/ is under the Apache License 2.0; see asset/fonts/LICENSE-Roboto.txt. Font Awesome follows the license in asset/fonts/LICENSE-FontAwesome.txt.

This project is not affiliated with Spotify or YouTube.

Community

androidgta-salualuajitmimguimonetloadermusic-playerrustsa-mpsampspotifyyoutube

Bu sayfa GitHub’ın depo hakkında yayımladıklarından oluşturulur. samp.directory kodu barındırmaz. Bu ilanla ilgili bir sorun bildir

senaaforgerr/spotify.lua: SA-MP Araç | samp.directory