Hellowlol / bw_plex

binge watching for plex
MIT License
368 stars 23 forks source link

WindowsError: [Error 2] The system cannot find the file specified #76

Closed Velkas closed 5 years ago

Velkas commented 5 years ago

Plex && bw_plex environment: Windows 10 Pro 1809 Plex Server for windows Version 1.14.1.5488 latest pip update from bw_plex git watching plex playback on firefox 65.0.1

The file being read / passed to ffmpeg contains spaces. So this possibly is related to ticket: #54

bw_plex was launched via powershell with admin rights with the following input:

bw_plex --username [user] --password [pass] --servername [servername] --url [url] watch

I get the title error after starting up bw_plex, relevant log details below;

2019-02-24 10:01:58,007 :: bw_plex :: INFO :: __init__.py:162 :: default folder set to C:\Users\<user>/.config/bw_plex
2019-02-24 10:02:03,513 :: bw_plex :: DEBUG :: misc.py:64 :: Getting server <server>
2019-02-24 10:02:03,513 :: bw_plex :: DEBUG :: misc.py:625 :: Getting hashtable
2019-02-24 10:02:03,605 :: bw_plex :: INFO :: misc.py:711 :: Loading existing files in db
2019-02-24 10:02:06,016 :: bw_plex :: DEBUG :: misc.py:640 :: Files in the hashtable
Watching for media on <server>
2019-02-24 10:02:13,710 :: bw_plex :: DEBUG :: plex.py:1024 :: Failed to find ratingkey 4867 in the db
2019-02-24 10:02:13,726 :: bw_plex :: DEBUG :: plex.py:897 :: Found <episode>
2019-02-24 10:02:13,726 :: bw_plex :: DEBUG :: plex.py:902 :: Download the first 10 minutes of <episode> as .wav
2019-02-24 10:02:13,726 :: bw_plex :: DEBUG :: plex.py:727 :: Checking if we can reach <episode> directly
2019-02-24 10:02:13,726 :: bw_plex :: DEBUG :: plex.py:738 :: Found S:\Plex\TV\<show>\<season>\<episode>.mkv
2019-02-24 10:02:13,730 :: bw_plex :: DEBUG :: misc.py:380 :: calling ffmpeg with ffmpeg -i "S:\Plex\TV\<show>\<season>\<episode>.mkv" -ac 1 -ar 11025 -ss 0 -t 600 -acodec pcm_s16le c:\users\<user>\appdata\local\temp\offset_5gwnrl.wav
2019-02-24 10:02:13,734 :: bw_plex :: ERROR :: plex.py:48 :: There was an exception in task
Traceback (most recent call last):
  File "c:\users\<user>\src\bw-plex\bw_plex\plex.py", line 43, in inner
    return func(*args)
  File "c:\users\<user>\src\bw-plex\bw_plex\plex.py", line 904, in task
    trim=CONFIG['tv'].get('check_for_theme_sec', 600))
  File "c:\users\<user>\src\bw-plex\bw_plex\misc.py", line 385, in convert_and_trim
    psox = subprocess.Popen(cmd, stderr=subprocess.PIPE)
  File "c:\python27\lib\subprocess.py", line 394, in __init__
    errread, errwrite)
  File "c:\python27\lib\subprocess.py", line 644, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
Velkas commented 5 years ago

Update:

Still digging around and I realized the .wav file it's looking for is not in the directory it specified in the log. Wondering if that's the missing file it's complaining about.

Velkas commented 5 years ago

update 2:

Further digging shows this error when running bw_plex process <n>:

DownloadError: ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.

The problem is, I ran pip install ffmpeg and pip install ffprobe but still get the error.

Hellowlol commented 5 years ago

Sorry for the late response. I didnt get notified. ffmeg need to be available in the system. What they mean by that is that you should be able to use cmd.exe and do ffmpeg and should get some kind of output.

It should be be related to containing space as you can see in the log we wrap the command in "" Do you have space in your user?

(pip install ffmpeg will try to install a python package called ffmpeg, but we need to install the ffmpeg.exe file)

Velkas commented 5 years ago

Yeah sorry @Hellowlol my account got flagged for spam and they deleted my latest update that showed I did get ffmpeg installed properly and it was finally working with bw_plex.

Unfortunately, skips are not actually working still. See below;

2019-03-01 18:11:39,723 :: bw_plex :: DEBUG :: plex.py:987 :: Found <show> theme start 01:31, theme end 01:56, ffmpeg_end 00:00 progress 01:40 best_time 01:56 credits_start 20:36 credits_end 21:10
2019-03-01 18:11:39,723 :: bw_plex :: DEBUG :: plex.py:1018 :: <show> is in the correct time range theme_end
2019-03-01 18:11:39,724 :: bw_plex :: DEBUG :: plex.py:974 :: Called jump with <show> 2 116.842811791 None
2019-03-01 18:11:39,726 :: bw_plex :: INFO :: plex.py:767 :: Called client_action with 116.842811791 01:56 2 None
2019-03-01 18:11:39,726 :: plexapi :: DEBUG :: server.py:341 :: GET http://<localhost>:32400/clients
2019-03-01 18:11:39,727 :: urllib3.connectionpool :: DEBUG :: connectionpool.py:240 :: Resetting dropped connection: <localhost>
2019-03-01 18:11:39,730 :: urllib3.connectionpool :: DEBUG :: connectionpool.py:393 :: http://<localhost>:32400 "GET /clients HTTP/1.1" 200 90
2019-03-01 18:11:39,732 :: plexapi :: DEBUG :: server.py:341 :: GET http://<localhost>:32400/status/sessions
2019-03-01 18:11:39,734 :: urllib3.connectionpool :: DEBUG :: connectionpool.py:393 :: http://<localhost>:32400 "GET /status/sessions HTTP/1.1" 200 1521
2019-03-01 18:11:39,753 :: bw_plex :: INFO :: plex.py:802 :: client Firefox 100
2019-03-01 18:11:39,753 :: bw_plex :: DEBUG :: plex.py:830 :: We couldnt match the client. Trying a hail marry.
2019-03-01 18:11:39,753 :: bw_plex :: INFO :: plex.py:835 :: Connectiong to Firefox
2019-03-01 18:11:39,755 :: bw_plex :: ERROR :: plex.py:48 :: There was an exception in client_action
Traceback (most recent call last):
  File "c:\users\<user>\src\bw-plex\bw_plex\plex.py", line 43, in inner
    return func(*args)
  File "c:\users\<user>\src\bw-plex\bw_plex\plex.py", line 838, in client_action
    requests.exceptions.ConnectionRefusedError):
AttributeError: 'module' object has no attribute 'ConnectionRefusedError'
Hellowlol commented 5 years ago

Thanks for the catch. It’s a bug. I have fixed it.

Velkas commented 5 years ago

Sorry for the delay @Hellowlol. I got the latest and skips seem to be sending now, which is great! However I'm still seeing an exception (though it's not causing problems so far). This happens right after a successful skip send.

2019-03-08 20:46:38,006 :: bw_plex :: ERROR :: plex.py:48 :: There was an exception in client_action
Traceback (most recent call last):
  File "c:\src\bw-plex\bw_plex\plex.py", line 43, in inner
    return func(*args)
  File "c:\src\bw-plex\bw_plex\plex.py", line 854, in client_action
    proxy_on_fail(correct_client.seekTo(int(offset * 1000)))
  File "c:\src\bw-plex\bw_plex\plex.py", line 772, in proxy_on_fail
    @wraps(func)
  File "c:\python27\lib\functools.py", line 33, in update_wrapper
    setattr(wrapper, attr, getattr(wrapped, attr))
AttributeError: 'NoneType' object has no attribute '__module__'
Hellowlol commented 5 years ago

Thanks. Ill fix that bug. Closing this as the original bug was fixed. Let me know if you have any more issues