Booplicate / MAS-Submods-YouTubeMusic

A submod for MAS which allows you to listen to music from youtube
9 stars 9 forks source link

Error message #43

Closed Chamelllemon closed 1 year ago

Chamelllemon commented 1 year ago

It just randomly gave this today. I updated say something submod with updater submod yesterday so maybe that's the problem

[code] I'm sorry, but an uncaught exception occurred.

While running game code: File "game/Submods/YouTube Music/ytm_utils.rpy", line 164, in script init python in ytm_utils: File "game/Submods/YouTube Music/ytm_utils.rpy", line 171, in import youtube_dl SyntaxError: invalid syntax (parser.py, line 86)

-- Full Traceback ------------------------------------------------------------

Full traceback: File "game/Submods/YouTube Music/ytm_utils.rpy", line 164, in script init python in ytm_utils: File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\ast.py", line 814, in execute renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store) File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\python.py", line 1719, in py_exec_bytecode exec bytecode in globals, locals File "game/Submods/YouTube Music/ytm_utils.rpy", line 171, in import youtube_dl File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\loader.py", line 711, in load_module exec code in mod.dict File "python-packages/youtube_dl/init.py", line 15, in File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\loader.py", line 711, in load_module exec code in mod.dict File "python-packages/youtube_dl/options.py", line 8, in File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\loader.py", line 711, in load_module exec code in mod.dict File "python-packages/youtube_dl/downloader/init.py", line 3, in File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\loader.py", line 711, in load_module exec code in mod.dict File "python-packages/youtube_dl/downloader/common.py", line 9, in File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\loader.py", line 711, in load_module exec code in mod.dict File "python-packages/youtube_dl/compat.py", line 2335, in SyntaxError: invalid syntax (parser.py, line 86)

Windows-8-6.2.9200 Ren'Py 6.99.12.4.2187 Monika After Story 0.12.14 [/code]

Booplicate commented 1 year ago

Are you sure you installed from the releases and not the source code?

Chamelllemon commented 1 year ago

Yep, updated again just now to be sure. This showed up, it's probably the same error message (The game works fine again when I remove only the submod) [code] I'm sorry, but an uncaught exception occurred.

While running game code: File "game/Submods/YouTube Music/ytm_utils.rpy", line 164, in script init python in ytm_utils: File "game/Submods/YouTube Music/ytm_utils.rpy", line 171, in import youtube_dl SyntaxError: invalid syntax (parser.py, line 86)

-- Full Traceback ------------------------------------------------------------

Full traceback: File "game/Submods/YouTube Music/ytm_utils.rpy", line 164, in script init python in ytm_utils: File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\ast.py", line 814, in execute renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store) File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\python.py", line 1719, in py_exec_bytecode exec bytecode in globals, locals File "game/Submods/YouTube Music/ytm_utils.rpy", line 171, in import youtube_dl File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\loader.py", line 711, in load_module exec code in mod.dict File "python-packages/youtube_dl/init.py", line 15, in File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\loader.py", line 711, in load_module exec code in mod.dict File "python-packages/youtube_dl/options.py", line 8, in File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\loader.py", line 711, in load_module exec code in mod.dict File "python-packages/youtube_dl/downloader/init.py", line 3, in File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\loader.py", line 711, in load_module exec code in mod.dict File "python-packages/youtube_dl/downloader/common.py", line 9, in File "C:\Users\Nikita\Desktop\DDLC-1.1.1-pc - kopie\renpy\loader.py", line 711, in load_module exec code in mod.dict File "python-packages/youtube_dl/compat.py", line 2335, in SyntaxError: invalid syntax (parser.py, line 86)

Windows-8-6.2.9200 Ren'Py 6.99.12.4.2187 Monika After Story 0.12.14 [/code]

Booplicate commented 1 year ago

I'm puzzled, can you provide logs from the log/ folder as well as a screenshot of your game/python-packages/ folder?

ZeitHeld commented 1 year ago

I had the same error, once I updated the "Say something" submod. But as I didn't use it much anyways, I removed the submod yet strange, that it happened

Chamelllemon commented 1 year ago

image image Like this?

Booplicate commented 1 year ago

Yes, but for the log/ folder, I need the files from it, not just a screenshot.

PCBoyGames commented 1 year ago

Wait a minute.

I remade this for myself, checked the log.txt in the main folder, and I got something that might be important here.

File "python-packages/youtube_dl/compat.py", line 2335, in <module> File "C:\Games\Doki Doki Literature Club\game\submods\Say Something\lib\html\parser.py", line 86

So then I moved the Say Something submod out from the folder, and MAS loaded YouTube Music properly. Is the HTML parser clashing?

I had the same error, once I updated the "Say something" submod. But as I didn't use it much anyways, I removed the submod yet strange, that it happened

Now I figure it's no coincidence that it errors when both mods are present.

dreamscached commented 1 year ago

Huh that's interesting... It actually may be the case, I add libs to sys.path but after importing I don't revert it. I'll release a fix for that.

Edit: it's weird though, path element is appended, but I found what's causing it. Edit 2: fixed it. Doesn't reproduce after fix, but I managed to reproduce it exactly as @PCBoyGames explained it.

dreamscached commented 1 year ago

@Booplicate that's more of a quickfix for now but the issue (in my understanding) was caused by youtube_dl importing html module which was already imported by Say Something and it had a syntax error, that part of the code wasn't used by Say Something but apparently was in use by youtube_dl - anyway, the Say Something's version was loaded before YoutubeDL's and then import html simply returned cached module.

This is critical so hopefully new submod framework will introduce a more isolated dependencies handling, if not I'll work on renaming the module or somehow isolating it in my own way. Anyway, it's resolved from my side, I don't think there is anything in your submod to do to fix the issue. I'm sorry for the trouble caused.

Booplicate commented 1 year ago

@dreamscached thanks for taking care of this. Question, why are you shipping and importing that py3 lib if you don't use it?

The new framework should allow isolation.

dreamscached commented 1 year ago

I backported it since the markdown library used it, and it's py3-only and I didn't want to rely on pure regexps. My bad, I couldn't foresee others using it.

I'll review the code and remove the dependency on it.

Booplicate commented 1 year ago

Ah I see. I think it's fine then, considering we're switching to Python 3 soon.

I will close this since it's resolved on your end.