CamsterRecorder
CamsterRecorder copied to clipboard
Program stops
Not sure why but I have all the other recorders running but camster is the most unstable for me.
I''m getting this error
Traceback (most recent call last):
File "D:\Lockbox\Others\camster\CamsterRecorder.py", line 62, in
Everything else works fine
Thank you for reporting. Is this an error you have had often?
This is one of the less popular scripts I have written, and therefor fewer bug reports, as well as less attention from myself. It seems the error is caused because it's not getting a response from the site. This is most likely an issue on their end, but I will change the script to better handle this issue.
Yes it happens everyday. Usually I just restart the program, but after a while this error comes up again
Ok. I'll lol into it and see if I can't get it fixed. If I don't get to it today, I should have it done tomorrow.
I just posted an update. It should now retry after 20 seconds instead of killing the process.
Please let me know how it works for you. I did about 1 minute of testing to make sure everything worked proper and recordings started.
I also added a config file, so make sure to set your paths in it.
Thanks downloaded it. Will keep it running
Update
Slightly Bad: It throws exceptions every few hours Good: It still records nonetheless. It seems like every time it would have crash it throws an exception. However whatever changes you made is keeping the program a live.
Did you by chance try visiting camster in a browser?
Was there any logged output?
If I'm not mistaking, I don't believe it will log anything on an error. It's possible it kept trying and kept failing. I'm wondering if they temporarily block IP address that are making too many requests. Just a thought. I can add some code to help see what's going on (log "connection failed" to the console for example)
When you restarted it, did it work right away?
I'll look at the code again when I get back to my computer and see if I can figure out what it is.
I may have misread... When you say exceptions, is it just logging errors to the screen and it continues to run fine? Do new recordings continue to start?
Sorry, I quickly read the email notification on my phone, sat it aside, and just now opened it without re reading what I read before.
Yes it keeps recording I don't think it anything critical at all. I've checked and it making playingable files.
This is an example of the errors that it throws Traceback (most recent call last): File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916, in _bootstrap_inner self.run() File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "D:\Lockbox\Others\camster\CamsterRecorder.py", line 48, in startRecording fd = stream.open() File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\livestreamer\stream\hls.py", line 258, in open reader.open() File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\livestreamer\stream\segmented.py", line 185, in open self.worker = self.worker(self) File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\livestreamer\stream\hls.py", line 125, in init self.reload_playlist() File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\livestreamer\stream\hls.py", line 135, in reload_playlist **self.reader.request_params) File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\sessions.py", line 521, in get return self.request('GET', url, **kwargs) File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\livestreamer\plugin\api\http_session.py", line 135, in request raise err livestreamer.exceptions.StreamError: Unable to open URL: http://transcode.k8s-do.naked.com/hls/hls_400s_1504737168653x/index.m3u8 (404 Client Error: Not Found for url: http://transcode.k8s-do.naked.com/hls/hls_400s_1504737168653x/index.m3u8) 0 model(s) are being recorded. Next check in 20 seconds Exception in thread Thread-418:ecorded: [] Traceback (most recent call last): File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\livestreamer\plugin\api\http_session.py", line 130, in request res.raise_for_status() File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\models.py", line 935, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://transcode.k8s-do.naked.com/hls/hls_400s_1504737168653x/index.m3u8
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916, in _bootstrap_inner self.run() File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "D:\Lockbox\Others\camster\CamsterRecorder.py", line 48, in startRecording fd = stream.open() File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\livestreamer\stream\hls.py", line 258, in open reader.open() File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\livestreamer\stream\segmented.py", line 185, in open self.worker = self.worker(self) File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\livestreamer\stream\hls.py", line 125, in init self.reload_playlist() File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\livestreamer\stream\hls.py", line 135, in reload_playlist **self.reader.request_params) File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\sessions.py", line 521, in get return self.request('GET', url, **kwargs) File "C:\Users\tobif\AppData\Local\Programs\Python\Python36\lib\site-packages\livestreamer\plugin\api\http_session.py", line 135, in request raise err livestreamer.exceptions.StreamError: Unable to open URL: http://transcode.k8s-do.naked.com/hls/hls_400s_1504737168653x/index.m3u8 (404 Client Error: Not Found for url: http://transcode.k8s-do.naked.com/hls/hls_400s_1504737168653x/index.m3u8)
But Like I said it still doing the check and will keep recording when a model hits the list
Ok. Thanks for clarifying. I'm glad it's working as it should be regardless of the exceptions being thrown.
from quickly looking at it (on my phone at that), it doesn't seem it's anything wrong with the script, but rather the exceptions are being thrown by other modules (livestreamer in particular). I'm wondering if it's trying to start a recording, but the model maybe is no longer in public at that time, so it can not connect to the stream. I wouldn't think this would happen every few hours though.
I am unaware of a way to silence the exceptions from an imported module, so the logging will just have to be a bit ugly because of that, at least for now.