shazamio / ShazamIO

🎵 Is a free asynchronous library from reverse engineered Shazam API written in Python 3.8+ with asyncio and aiohttp.
MIT License
519 stars 75 forks source link

Shazam recognized, ShazamIO is not recognizing #127

Open ariand9 opened 1 week ago

ariand9 commented 1 week ago

Shazam app recognizes (Using iOS), but the ShazamIO it's not recognizing. im sending chunk files, trying with 5 seconds, 7 seconds, 10 seconds, chunking the whole mp3 file, and no results. I've made the process of chunking automated, you can try using the api: https://shazam-api.com/api/recognize

Post request:

{
    "url": "https://cdn.plugbeatz.com/uploads/8dc2452f-9a64-473f-b43d-1c359dac9ad0.mp3"
}

Then it will return an url in response (You can make GET request on that), which will show the data when completed, it will add every track found in a JSON object from every chunk "Now using 10 second chunks".

It's recognizing some tracks, but not all of them.. not all that Shazam app does.

Best regards

MBEDEVEREAUX commented 5 days ago

I can confirm the same issue - shazamio does not report something while the app (iOS and shazam website) is.

dotX12 commented 19 hours ago

Hello @ariand9, I just trimmed your song down to a random 6 second snippet somewhere in the middle of the song and recognized it, in which case I have everything working without problems. Post your snippet to see what's wrong. And yes, when you send requests from a mobile device, the client app actually slices whatever you record into the microphone and may send 5-10-20 requests hoping to find that song, shazam doesn't rely on a single request to the server :)))))

P.S: I don't know why the file sent below is 52 seconds, maybe a bug :) but I actually sent a 6 second snippet to shazam server. 8dc2452f-9a64-473f-b43d-1c359dac9ad0_jF7eAHxL.webm

{
    "matches": [
        {
            "id": "718680318",
            "offset": 114.527421875,
            "timeskew": -0.00028038025,
            "frequencyskew": 4.6014786e-05
        }
    ],
    "location": {
        "accuracy": 0.01
    },
    "timestamp": 1430018144,
    "timezone": "Europe/Moscow",
    "track": {
        "layout": "5",
        "type": "MUSIC",
        "key": "718680318",
        "title": "GASS",
        "subtitle": "SKO",
        "images": {
            "background": "https://is1-ssl.mzstatic.com/image/thumb/Music211/v4/e3/8c/ae/e38cae3e-b2c0-ea76-009d-f6e1819aa6f0/artwork.jpg/400x400cc.jpg",
            "coverart": "https://is1-ssl.mzstatic.com/image/thumb/Music211/v4/e3/8c/ae/e38cae3e-b2c0-ea76-009d-f6e1819aa6f0/artwork.jpg/400x400cc.jpg",
            "coverarthq": "https://is1-ssl.mzstatic.com/image/thumb/Music211/v4/e3/8c/ae/e38cae3e-b2c0-ea76-009d-f6e1819aa6f0/artwork.jpg/400x400cc.jpg"
        },
        "share": {
            "subject": "GASS - SKO",
            "text": "GASS by SKO",
            "href": "https://www.shazam.com/track/718680318/gass",
            "image": "https://is1-ssl.mzstatic.com/image/thumb/Music211/v4/e3/8c/ae/e38cae3e-b2c0-ea76-009d-f6e1819aa6f0/artwork.jpg/400x400cc.jpg",
            "twitter": "I used @Shazam to discover GASS by SKO.",
            "html": "https://www.shazam.com/snippets/email-share/718680318?lang=en-US&country=GB",
            "snapchat": "https://www.shazam.com/partner/sc/track/718680318"
        },
        "hub": {
            "type": "APPLEMUSIC",
            "image": "https://images.shazam.com/static/icons/hub/web/v5/applemusic.png",
            "options": [
                {
                    "caption": "OPEN IN",
                    "actions": [
                        {
                            "name": "hub:applemusic:subscribe",
                            "type": "applemusicopen",
                            "uri": "https://music.apple.com/subscribe?mttnagencyid=s2n&mttnsiteid=125115&mttn3pid=Apple-Shazam&mttnsub1=Shazam_web&mttnsub2=5348615A-616D-3235-3830-44754D6D5973&itscg=30201&app=music&itsct=Shazam_web"
                        },
                        {
                            "name": "hub:applemusic:subscribe",
                            "type": "uri",
                            "uri": "https://music.apple.com/subscribe?mttnagencyid=s2n&mttnsiteid=125115&mttn3pid=Apple-Shazam&mttnsub1=Shazam_web&mttnsub2=5348615A-616D-3235-3830-44754D6D5973&itscg=30201&app=music&itsct=Shazam_web"
                        }
                    ],
                    "beacondata": {
                        "type": "open",
                        "providername": "applemusic"
                    },
                    "image": "https://images.shazam.com/static/icons/hub/web/v5/overflow-open-option.png",
                    "type": "open",
                    "listcaption": "Open in Apple Music",
                    "overflowimage": "https://images.shazam.com/static/icons/hub/web/v5/applemusic-overflow.png",
                    "colouroverflowimage": false,
                    "providername": "applemusic"
                }
            ],
            "explicit": false,
            "displayname": "APPLE MUSIC"
        },
        "sections": [
            {
                "type": "SONG",
                "metapages": [
                    {
                        "image": "https://is1-ssl.mzstatic.com/image/thumb/Music211/v4/e3/8c/ae/e38cae3e-b2c0-ea76-009d-f6e1819aa6f0/artwork.jpg/400x400cc.jpg",
                        "caption": "GASS"
                    }
                ],
                "tabname": "Song",
                "metadata": []
            }
        ],
        "url": "https://www.shazam.com/track/718680318/gass",
        "artists": [
            {
                "alias": "sko",
                "id": "42",
                "adamid": "1506724880"
            }
        ],
        "alias": "gass",
        "genres": {
            "primary": "Hip-Hop/Rap"
        },
        "urlparams": {
            "{tracktitle}": "GASS",
            "{trackartist}": "SKO"
        },
        "highlightsurls": {}
    },
    "tagid": "A9058556-9DFD-4B77-BA21-E3A13937C1CC"
}
ariand9 commented 17 hours ago

Hi @dotX12, Thanks for your response,

The above track, you've sent results now works as expected same on ShazamIO and Shazam iOS app, but didn't worked using 10 seconds chunks, so i've made 15 seconds chunks, which somehow works now. I'm using a different track now, which i've also checked on it from Shazam app on iOS, see the results from ShazamIO and Shazam iOS app below:

Track used: https://cdn.plugbeatz.com/uploads/ab1610f8-8b44-48d7-8666-18f8087f27bb.mp3 Results from ShazamIO: https://shazam-api.com/api/results/dba5df32-f041-4b8a-aac5-e6649e6051b9 I've check entire track in 15 seconds chunks now, the 10 second chunks didn't worked at all (No results using 10 seconds chunks).

Results from Shazam iOS app: WhatsApp Image 2024-11-22 at 21 44 41 (1) WhatsApp Image 2024-11-22 at 21 44 41

Using ShazamIO, i got just one "ONG BAK" ! The API I've build using ShazamIO, checks each chunk, and appends the results in JSON object which will be returned on given result url.

Best regards