Infinite Loop in Spotify / LastFM song retrieval

Expected behavior

Display currently playing spotify / lastfm song

Actual behavior

Displays all songs other than ones including " instead throwing an infinite loop error

Steps to reproduce

Go to textoverlay, in the HTML section put either $spotifySong / $lastfmSong and play a song such as Spotify and check both the overlay itself which should display value: “”, and the console which should complain about an infinite loop

Additional informations

2022-10-29T01:03:18.471 DEBUG: * ======= COPY DEBUG MESSAGE FROM HERE =======
2022-10-29T01:03:18.472 DEBUG: * GENERAL | OS: npm/8.19.2 node/v16.18.0 linux x64 workspaces/false
2022-10-29T01:03:18.494 DEBUG: * | Bot version: 16.4.1
2022-10-29T01:03:18.495 DEBUG: * | DB: better-sqlite3
2022-10-29T01:03:18.495 DEBUG: * | HEAP: 139.13 MB
2022-10-29T01:03:18.496 DEBUG: * | Uptime: 01:20:00
2022-10-29T01:03:18.496 DEBUG: * | Language: en
2022-10-29T01:03:18.497 DEBUG: * | Mute: false
2022-10-29T01:03:18.497 DEBUG: * SYSTEMS | -Ranks, -Songs, CustomCommands, Alias, -Highlights, -AntiHateRaid, Bets, -Checklist, Commercial, -Cooldown, -EmotesCombo, -HowLongToBeat, -Keywords, -Levels, -Moderation, Points, -Polls, -Price, -Queue, -Quotes, -Raffles, -Scrim, Timers, Top, UserInfo
2022-10-29T01:03:18.498 DEBUG: * GAMES | Duel, FightMe, Gamble, Heist, Roulette, Seppuku
2022-10-29T01:03:18.498 DEBUG: * INTEGRATIONS | LastFM, Spotify, Discord, -Donatello, -Donationalerts, -Kofi, OBSWebsocket, -ProtonDB, -PUBG, -Qiwi, StreamElements, -Streamlabs, -Tiltify, -TipeeeStream, -Twitter
2022-10-29T01:03:18.498 DEBUG: * OAUTH | BOT notlazer#265065055 | BROADCASTER iazer#70190312
2022-10-29T01:03:18.499 DEBUG: * ======= END OF DEBUG MESSAGE =======

Will check thanks!

I don’t seem able to reproduce on overlay v33.0.8

Can you check your version and post your error?

My overlay is also running version v33.0.8 and my error is

2022-10-29T14:13:42.288 !!! ERROR !!! vm.js:1
(async function () { let __opCount__ = 0; function __opCounter__() { if (__opCount__ > 100000) { throw new Error("Running script seems to be in infinite loop."); } else { __opCount__++; }}; __opCounter__();let t = {    Spotify: "Still Falling For You - From "Bridget Jones\'s Baby" - Ellie Gouldings",    LastFM: "Still Falling For You - From "Bridget Jones's Baby" - Ellie Goulding"}, o = "Not Playing";__opCounter__();Object.keys(t).forEach((function(n) {    "Not Playing" != t[n] && (o = t[n]);__opCounter__();}));__opCounter__();return o; })
SyntaxError: Unexpected identifier
    at makeNiceSyntaxError (/home/container/node_modules/vm2/lib/transformer.js:41:16)
    at transformer (/home/container/node_modules/vm2/lib/transformer.js:84:8)
    at (/home/container/node_modules/vm2/lib/vm.js:491:16)
    at runScript (/home/container/src/helpers/customvariables/runScript.ts:186:28)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at getValueOf (/home/container/src/helpers/customvariables/getValueOf.ts:28:22)
    at executeVariablesInText (/home/container/src/helpers/customvariables/executeVariablesInText.ts:11:15)
    at Object.callback (/home/container/src/registries/text.ts:88:36)

Can I see how exactly you have set your text overlay?

JS isn’t used at all for this

I did also test this on a completely fresh text overlay with just the $lastfmSong and $spotifySong standalone and they both filled the console for the bot with the infinite loop

I see, what confused me that you are saying $lastfmSong and $spotifySong, but you are not using any of these.

You have bug in your code for $_current custom variable. Its not related to text overlay.

I see, but how can I go about fixing that becuase I would’ve thought what it’s pulling is just a string but it’s somehow interpreting the " within the middle of the song as the end point

No idea if I don’t see a code for that variable :wink:


Thanks I can reproduce now.

Fixed in 16.5.2 Release SOGEBOT 16.5.2 · sogebot/sogeBot · GitHub

thank you! appreciate it

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.