[GH-ISSUE #199] Lyric search is not possible when set to Apple Music #147

Open
opened 2026-02-27 19:26:31 +03:00 by kerem · 8 comments
Owner

Originally created by @karigane-cha on GitHub (Nov 4, 2025).
Original GitHub issue: https://github.com/Lambada10/SongSync/issues/199

Describe the bug
I set the lyrics provider to Apple Music and get an error when searching for a song.
If I use a provider other than Apple Music, such as Spotify or QQ Music, I can search without any problems.

To Reproduce
Steps to reproduce the behavior:

  1. Download and install this version
  2. Open the app
  3. Set Lyrics Provider to Apple Music
  4. Search for a song
  5. An error occurred (check the screenshot below)

Expected behavior
I can search for songs even if the lyrics provider is set to Apple Music.

Screenshots
Image

Smartphone (please complete the following information):

  • Device: Xiaomi 14 Ultra
  • OS: HyperOS 2 (Android 15)
  • App version: v4.3.3

Additional context
Add any other context about the problem here.

Originally created by @karigane-cha on GitHub (Nov 4, 2025). Original GitHub issue: https://github.com/Lambada10/SongSync/issues/199 **Describe the bug** I set the lyrics provider to Apple Music and get an error when searching for a song. If I use a provider other than Apple Music, such as Spotify or QQ Music, I can search without any problems. **To Reproduce** Steps to reproduce the behavior: 1. Download and install [this version](https://github.com/Lambada10/SongSync/actions/runs/19013907811) 2. Open the app 3. Set Lyrics Provider to Apple Music 4. Search for a song 5. An error occurred (check the screenshot below) **Expected behavior** I can search for songs even if the lyrics provider is set to Apple Music. **Screenshots** ![Image](https://github.com/user-attachments/assets/4b2a97cb-c953-44c9-bfc6-7ed210ce3026) **Smartphone (please complete the following information):** - Device: Xiaomi 14 Ultra - OS: HyperOS 2 (Android 15) - App version: v4.3.3 **Additional context** Add any other context about the problem here.
Author
Owner

@fergassss1 commented on GitHub (Nov 8, 2025):

I think thats actually the server's fault. I went to the link used for Apple Music results(paxsenix.alwaysdata.net/searchAppleMusic.php?q=Your+Text) and got the error: Failed to fetch data after 2 attempts
Hope that the server fixes

<!-- gh-comment-id:3506299849 --> @fergassss1 commented on GitHub (Nov 8, 2025): I think thats actually the server's fault. I went to the link used for Apple Music results(paxsenix.alwaysdata.net/searchAppleMusic.php?q=Your+Text) and got the error: Failed to fetch data after 2 attempts Hope that the server fixes
Author
Owner

@kerollosy commented on GitHub (Nov 15, 2025):

Working on it

<!-- gh-comment-id:3536561535 --> @kerollosy commented on GitHub (Nov 15, 2025): Working on it
Author
Owner

@kerollosy commented on GitHub (Nov 15, 2025):

Oh the base URL changed and this was actually fixed in this commit
and ofc I'd advise you to download the latest version here until lambada makes a new release

<!-- gh-comment-id:3536563880 --> @kerollosy commented on GitHub (Nov 15, 2025): Oh the base URL changed and this was actually fixed in this [commit](https://github.com/Lambada10/SongSync/commit/97bc57f5a2a2bb6cbd9ed58d8ccf50efc5970176) and ofc I'd advise you to download the [latest version here](https://github.com/Lambada10/SongSync/actions/runs/19285770796/artifacts/4538791418) until lambada makes a new release
Author
Owner

@karigane-cha commented on GitHub (Nov 15, 2025):

Thank you for your advice.

I installed the latest version of the app and tried searching for a song, and it worked fine.
I also tried the version where this problem had occurred, and searching now works.
Maybe the server issue has been fixed?

<!-- gh-comment-id:3536604139 --> @karigane-cha commented on GitHub (Nov 15, 2025): Thank you for your advice. I installed [the latest version of the app](https://github.com/Lambada10/SongSync/actions/runs/19285770796/artifacts/4538791418) and tried searching for a song, and it worked fine. I also tried the version where this problem had occurred, and searching now works. Maybe the server issue has been fixed?
Author
Owner

@kerollosy commented on GitHub (Nov 15, 2025):

No problem ofc!

Yes I just checked and the server that was down is back up now and is working so yes it should work on both versions fine!

<!-- gh-comment-id:3536606998 --> @kerollosy commented on GitHub (Nov 15, 2025): No problem ofc! Yes I just checked and the server that was down is back up now and is working so yes it should work on both versions fine!
Author
Owner

@iamvishalgavit commented on GitHub (Dec 9, 2025):

Is it isn't fixed it yet?

<!-- gh-comment-id:3633338215 --> @iamvishalgavit commented on GitHub (Dec 9, 2025): Is it isn't fixed it yet?
Author
Owner

@karigane-cha commented on GitHub (Dec 13, 2025):

Is it isn't fixed it yet?

I tried the latest debug build and the search worked.
The latest release build isn't fine.

<!-- gh-comment-id:3649473688 --> @karigane-cha commented on GitHub (Dec 13, 2025): > Is it isn't fixed it yet? I tried [the latest debug build](https://github.com/Lambada10/SongSync/actions/runs/19796515195) and the search worked. [The latest release build](https://github.com/Lambada10/SongSync/actions/runs/19531551658) isn't fine.
Author
Owner

@fergassss1 commented on GitHub (Dec 14, 2025):

Is it isn't fixed it yet?

the creator of the apple music lyrics provider is switching the link for getting results quite a lot
when looking through the latest debug changes, the link for the results is now https://lyrics.paxsenix.org/apple-music/lyrics?id=$id

if you can't get the debug version paste this code into google colab for now. im absolutely dumb in coding so chatgpt made it (but it works completely fine):

import requests
import urllib.parse

BASE_LYRICS_URL = "https://lyrics.paxsenix.org/apple-music/lyrics?id={}"
BASE_SEARCH_URL = "https://lyrics.paxsenix.org/apple-music/search?q={}"


def to_lrc_timestamp(ms):
    total_seconds = ms / 1000
    minutes = int(total_seconds // 60)
    seconds = total_seconds % 60
    return f"{minutes:02d}:{seconds:05.2f}"


def format_syllable_lyrics(lyrics, multi_person_word_by_word=True):
    synced_lyrics = []

    for line in lyrics:
        line_ts = to_lrc_timestamp(line["timestamp"])
        current_line = f"[{line_ts}]"

        if multi_person_word_by_word:
            current_line += "v2:" if line.get("oppositeTurn") else "v1:"

            for syllable in line["text"]:
                begin = f"<{to_lrc_timestamp(syllable['timestamp'])}>"
                end = f"<{to_lrc_timestamp(syllable['endtime'])}>" if syllable.get("endtime") else ""

                if not current_line.endswith(begin):
                    current_line += begin

                current_line += syllable["text"]

                if not syllable.get("part", False):
                    current_line += " "

                current_line += end

            if line.get("background") and multi_person_word_by_word:
                current_line += "\n[bg:"
                for syllable in line["backgroundText"]:
                    begin = f"<{to_lrc_timestamp(syllable['timestamp'])}>"
                    end = f"<{to_lrc_timestamp(syllable['endtime'])}>" if syllable.get("endtime") else ""

                    if not current_line.endswith(begin):
                        current_line += begin

                    current_line += syllable["text"]

                    if not syllable.get("part", False):
                        current_line += " "

                    current_line += end
                current_line += "]"

        synced_lyrics.append(current_line)

    return "\n".join(synced_lyrics)


def get_word_by_word_lyrics(apple_music_id):
    url = BASE_LYRICS_URL.format(apple_music_id)
    response = requests.get(url)
    response.raise_for_status()

    data = response.json()
    lyrics = data["content"]

    return format_syllable_lyrics(lyrics)


def search_apple_music(query):
    encoded_query = urllib.parse.quote(query)
    url = BASE_SEARCH_URL.format(encoded_query)

    response = requests.get(url)
    response.raise_for_status()

    return response.json()


def duration_to_mmss(ms):
    seconds = ms // 1000
    return f"{seconds // 60}:{seconds % 60:02d}"


def interactive_search_ui():
    query = input("\nSearch song / artist: ").strip()
    if not query:
        print("Empty search.")
        return

    results = search_apple_music(query)

    if not results:
        print("No results found.")
        return

    print("\nResults:\n")
    for i, song in enumerate(results, start=1):
        print(
            f"{i}. {song['songName']} — {song['artistName']} "
            f"({song['albumName']}) "
            f"[{duration_to_mmss(song['duration'])}]"
        )

    while True:
        try:
            choice = int(input("\nSelect a number: "))
            if 1 <= choice <= len(results):
                selected = results[choice - 1]
                return selected["id"]
            else:
                print("Invalid number.")
        except ValueError:
            print("Enter a valid number.")


# -----------------------------
# 🚀 MAIN
# -----------------------------
if __name__ == "__main__":
    apple_music_id = interactive_search_ui()

    if apple_music_id:
        print("\nFetching lyrics...\n")
        lyrics = get_word_by_word_lyrics(apple_music_id)
        print(lyrics)

<!-- gh-comment-id:3650801143 --> @fergassss1 commented on GitHub (Dec 14, 2025): > Is it isn't fixed it yet? the creator of the apple music lyrics provider is switching the link for getting results quite a lot when looking through the latest debug changes, the link for the results is now https://lyrics.paxsenix.org/apple-music/lyrics?id=$id if you can't get the debug version paste this code into google colab for now. im absolutely dumb in coding so chatgpt made it (but it works completely fine): ``` import requests import urllib.parse BASE_LYRICS_URL = "https://lyrics.paxsenix.org/apple-music/lyrics?id={}" BASE_SEARCH_URL = "https://lyrics.paxsenix.org/apple-music/search?q={}" def to_lrc_timestamp(ms): total_seconds = ms / 1000 minutes = int(total_seconds // 60) seconds = total_seconds % 60 return f"{minutes:02d}:{seconds:05.2f}" def format_syllable_lyrics(lyrics, multi_person_word_by_word=True): synced_lyrics = [] for line in lyrics: line_ts = to_lrc_timestamp(line["timestamp"]) current_line = f"[{line_ts}]" if multi_person_word_by_word: current_line += "v2:" if line.get("oppositeTurn") else "v1:" for syllable in line["text"]: begin = f"<{to_lrc_timestamp(syllable['timestamp'])}>" end = f"<{to_lrc_timestamp(syllable['endtime'])}>" if syllable.get("endtime") else "" if not current_line.endswith(begin): current_line += begin current_line += syllable["text"] if not syllable.get("part", False): current_line += " " current_line += end if line.get("background") and multi_person_word_by_word: current_line += "\n[bg:" for syllable in line["backgroundText"]: begin = f"<{to_lrc_timestamp(syllable['timestamp'])}>" end = f"<{to_lrc_timestamp(syllable['endtime'])}>" if syllable.get("endtime") else "" if not current_line.endswith(begin): current_line += begin current_line += syllable["text"] if not syllable.get("part", False): current_line += " " current_line += end current_line += "]" synced_lyrics.append(current_line) return "\n".join(synced_lyrics) def get_word_by_word_lyrics(apple_music_id): url = BASE_LYRICS_URL.format(apple_music_id) response = requests.get(url) response.raise_for_status() data = response.json() lyrics = data["content"] return format_syllable_lyrics(lyrics) def search_apple_music(query): encoded_query = urllib.parse.quote(query) url = BASE_SEARCH_URL.format(encoded_query) response = requests.get(url) response.raise_for_status() return response.json() def duration_to_mmss(ms): seconds = ms // 1000 return f"{seconds // 60}:{seconds % 60:02d}" def interactive_search_ui(): query = input("\nSearch song / artist: ").strip() if not query: print("Empty search.") return results = search_apple_music(query) if not results: print("No results found.") return print("\nResults:\n") for i, song in enumerate(results, start=1): print( f"{i}. {song['songName']} — {song['artistName']} " f"({song['albumName']}) " f"[{duration_to_mmss(song['duration'])}]" ) while True: try: choice = int(input("\nSelect a number: ")) if 1 <= choice <= len(results): selected = results[choice - 1] return selected["id"] else: print("Invalid number.") except ValueError: print("Enter a valid number.") # ----------------------------- # 🚀 MAIN # ----------------------------- if __name__ == "__main__": apple_music_id = interactive_search_ui() if apple_music_id: print("\nFetching lyrics...\n") lyrics = get_word_by_word_lyrics(apple_music_id) print(lyrics) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SongSync#147
No description provided.