PyInstaLive icon indicating copy to clipboard operation
PyInstaLive copied to clipboard

Exception in thread Thread-1

Open pplswr opened this issue 3 years ago • 2 comments

  • [x] I am using the latest version of PyInstaLive: 4.0.2
  • [x] I have python installed 3.6+: 3.8.10
  • [x] I have read the README.
  • [x] I have read the FAQ.
  • [x] I have checked all existing issues, none of which could solve my issue.

I am using:

  • [x] Windows 10
  • [ ] Windows 8.1
  • [ ] Windows 8
  • [ ] Windows 7
  • [ ] Linux (distribution: )
  • [ ] macOS (version: )
  • [ ] Other (device & OS name: )
PyInstaLive information
pyinstalive --info
---------------------------------------------------------------------------
[I] PYINSTALIVE (SCRIPT V4.0.2 - PYTHON V3.8.10) - 07-09-2022 11:07:49 PM
---------------------------------------------------------------------------
[I] To see all the available arguments, use the -h argument.

[I] PyInstaLive version:        4.0.2
[I] Python version:             3.8.10
[I] FFmpeg framework:           Available
[I] Login session files:        1 (*****.dat matches configuration username)
[I] CLI supports color:         No

[I] Configuration file:

    [pyinstalive]
    username = *****
    password = *****
    download_path = *****
    download_comments = False
    clear_temp_files = True
    cmd_on_started =
    cmd_on_ended =
    ffmpeg_path =
    log_to_file = True
    no_assemble = False
    use_locks = True
    send_heartbeat = False
    proxy =

[I] End of PyInstaLive information screen.
---------------------------------------------------------------------------

I'm getting this error message randomly on some lives, ~~but it doesn't seems to affect the recording at all and is just that part~~, Edit: when the error occurs, pyinstalive will keep downloading the video segments, but it stop adding them to the json file, so the final merged video will stop at the momment this error occurs (usually after 1 min or so) the rest of the log is completely normal. And the account I'm using doesn't have any warning Also, this started happening after upgrading to v4.0.2. I've never seen this error in the previous version I was using (v3.2.4)

Command used

pyinstalive -d "username"


...

[I] Downloading livestream, press [CTRL+C] to abort.
---------------------------------------------------------------------------
[I] Airing time  : 2 minutes and 18 seconds
[I] Status       : Active
[I] Viewers      : 194
Exception in thread Thread-1:
Traceback (most recent call last):
  File "c:\python38\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "c:\python38\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "c:\python38\lib\site-packages\pyinstalive\helpers.py", line 183, in handle_tasks_worker
    globals.download.update_stream_data(from_thread=True)
  File "c:\python38\lib\site-packages\pyinstalive\download.py", line 279, in update_stream_data
    stream_heartbeat = api.do_heartbeat() if globals.config.send_heartbeat else api.get_stream_data()
  File "c:\python38\lib\site-packages\pyinstalive\api.py", line 45, in get_stream_data
    return json.loads(response.text)
  File "c:\python38\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "c:\python38\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "c:\python38\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
---------------------------------------------------------------------------
[I] The livestream has been ended.
---------------------------------------------------------------------------

...

pplswr avatar Jul 10 '22 03:07 pplswr

Thanks for reporting I would recommend manually generating the video afterwards using the segment folder (rename or delete the associated json file) whenever this occurs

dvingerh avatar Jul 10 '22 10:07 dvingerh

Did some more testing with v4.0.2 and when send_heartbeat = False it happens randomly, sometimes right after I start recording and sometimes 1, 6 or even 10 minutes after I start recording

It seems that this does not happen when send_heartbeat = True

pplswr avatar Jul 17 '22 04:07 pplswr