elibroftw / music-caster

Music Caster is a modern music player with the ability to cast audio files, system audio, and URLs to Google Chromecasts, Google Home/Nest Minis, etc.
https://elijahlopez.ca/music-caster/
Other
144 stars 16 forks source link

Failed to execute script music_caster #14

Closed joonaskaustel closed 3 years ago

joonaskaustel commented 3 years ago

image

elibroftw commented 3 years ago

Have you tried reinstalling?

joonaskaustel commented 3 years ago

tried, same error. even with portable version

elibroftw commented 3 years ago

Can you see if the file music_caster.log was created in the directory you have installed Music Caster? If so could you either upload it here or send it to me? If it does not exist let me know.

joonaskaustel commented 3 years ago

its empty :D 0kb both in the installed version and in portable dir.

elibroftw commented 3 years ago

That's actually a good thing because now I know what the issue is not. Okay, I added more logging so install the latest version, run it, and tell me what's in the log file this time.

joonaskaustel commented 3 years ago

download latest, installed, run, still empty log :( image

elibroftw commented 3 years ago

Okay, two things now. First, try again with the latest version. Second, try using tasklist /NH /FI "IMAGENAME eq Music Caster.exe" in the command line and tell me what happens.

joonaskaustel commented 3 years ago

same result and ❯ tasklist /NH /FI "IMAGENAME eq Music Caster.exe" INFO: No tasks are running which match the specified criteria.

elibroftw commented 3 years ago

How about when you delete the log file and run Music Caster?

joonaskaustel commented 3 years ago

2020-11-01 19:12:27,558 INFO (2308): quit_if_running() called

elibroftw commented 3 years ago

Do you have Python installed? If so could you try running the following?

from subprocess import Popen, DEVNULL, PIPE
import re
import os

def get_running_processes():
    # edited from https://stackoverflow.com/a/22914414/7732434
    cmd = 'tasklist /NH /FI "IMAGENAME eq Music Caster.exe"'
    p = Popen(cmd, shell=True, stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL)
    task = p.stdout.readline()
    while task != '':
        task = p.stdout.readline().decode().strip()
        m = re.match(r'(.+?) +(\d+) (.+?) +(\d+) +(\d+.* K).*', task)
        if m is not None:
            process = {'name': m.group(1),  # Image name
                       'pid': m.group(2),
                       'session_name': m.group(3),
                       'session_num': m.group(4),
                       'mem_usage': m.group(5)}
            yield process

def is_already_running(threshold=1 if os.path.exists('unins000.exe') else 2):
    for process in get_running_processes():
        process_name = process['name']
        if process_name == 'Music Caster.exe':
            threshold -= 1
            if threshold < 0: return True
    return False

if is_already_running(threshold=1):
    print('Music Caster is already running')
print('CODE WORKS FINE')
joonaskaustel commented 3 years ago

❯ Python tes.py CODE WORKS FINE

elibroftw commented 3 years ago

Okay, I still don't know what the issue is but I did reorganize the code so that if you encounter an error in the latest version, the exception message will be sent to me.

elibroftw commented 3 years ago

Should be fixed in the latest update (4.71.10). It was a UnicodeDecodeError in case you are wondering what the issue was. Close this issue if it works fine.

joonaskaustel commented 3 years ago

still its not starting... {'EXCEPTION TYPE': 'UnicodeDecodeError', 'FATAL': True, 'LINE': 2336, 'LOG': [], 'MAC': 'd8:cb:8a:31:91:05', 'OS': 'Windows-10-10.0.18362-SP0', 'PLAYING_TYPE': 'none', 'TIME': '2020-11-04 18:13:55.190979', 'TRACEBACK': 'Traceback (most recent call last):\n' ' File "music_caster.py", line 2336, in <module>\n' ' File "helpers.py", line 160, in is_already_running\n' ' File "helpers.py", line 151, in get_running_processes\n' "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in " 'position 70: invalid start byte\n', 'VERSION': '4.71.10'} {'EXCEPTION TYPE': 'UnicodeDecodeError', 'FATAL': True, 'LINE': 2336, 'LOG': [], 'MAC': 'd8:cb:8a:31:91:05', 'OS': 'Windows-10-10.0.18362-SP0', 'PLAYING_TYPE': 'none', 'TIME': '2020-11-04 18:13:40.704977', 'TRACEBACK': 'Traceback (most recent call last):\n' ' File "music_caster.py", line 2336, in <module>\n' ' File "helpers.py", line 160, in is_already_running\n' ' File "helpers.py", line 151, in get_running_processes\n' "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in " 'position 70: invalid start byte\n', 'VERSION': '4.71.10'} {'EXCEPTION TYPE': 'UnicodeDecodeError', 'FATAL': True, 'LINE': 2336, 'LOG': [], 'MAC': 'd8:cb:8a:31:91:05', 'OS': 'Windows-10-10.0.18362-SP0', 'PLAYING_TYPE': 'none', 'TIME': '2020-11-04 18:12:13.111301', 'TRACEBACK': 'Traceback (most recent call last):\n' ' File "music_caster.py", line 2336, in <module>\n' ' File "helpers.py", line 160, in is_already_running\n' ' File "helpers.py", line 151, in get_running_processes\n' "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in " 'position 70: invalid start byte\n', 'VERSION': '4.71.10'} {'EXCEPTION TYPE': 'UnicodeDecodeError', 'FATAL': True, 'LINE': 2336, 'LOG': [], 'MAC': 'd8:cb:8a:31:91:05', 'OS': 'Windows-10-10.0.18362-SP0', 'PLAYING_TYPE': 'none', 'TIME': '2020-11-04 18:11:25.563060', 'TRACEBACK': 'Traceback (most recent call last):\n' ' File "music_caster.py", line 2336, in <module>\n' ' File "helpers.py", line 160, in is_already_running\n' ' File "helpers.py", line 151, in get_running_processes\n' "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in " 'position 70: invalid start byte\n', 'VERSION': '4.71.10'}

joonaskaustel commented 3 years ago

shows up in task manager for few seconds and then quits

elibroftw commented 3 years ago

Ok check out the latest update.

joonaskaustel commented 3 years ago

started now, thanks!