#๐Ÿ”’ I need assistance. I'm unable to fix the bugs in the script

13 messages ยท Page 1 of 1 (latest)

dull sequoiaBOT
#

@twilit yarrow

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

twilit yarrow
mellow salmon
twilit yarrow
#

Hello,

sorry, I'm new here and apparently the bot here deleted my text:
I am currently collaborating with Google AI Studio, as I lack programming skills, to create a bot that records TikTok livestreams, including chat and event gifts. My goal is to combine the overlay, video, chat, and event gifts into a single video using ffmpeg, which can then potentially be streamed live. So far, I am relying exclusively on the TikTok Live Connector.

Unfortunately, I am currently at a dead end. The AI is unable to assist me further, as the same errors keep recurring. To test the chat functionality, the chat should initially be displayed in the browser, as it is on the program's demo page. However, the likes, viewer count, and diamonds remain permanently at 0. Additionally, the chat does not display profile pictures of the participants, and the gifts only show the name and value, but not the gift image.

Later, the chat and gifts should also be output as video. Is there perhaps another reliable way to incorporate them as an additional source in ffmpeg?

Script Workflow:

A popup window opens where the streamer's name and session ID (if the stream is 18+ or private) can be entered.

Every 60 seconds, it checks if the streamer is online.

Once the streamer is online, recording begins. In addition, Firefox opens to display event gifts and chat.

#

:~/Desktop/ttlive$ python main.py
127.0.0.1 - - [22/Dec/2024 18:27:39] "GET / HTTP/1.1" 200 -
2024-12-22 18:27:43,456 - main - INFO - Session ID wurde gesetzt.
2024-12-22 18:27:43,998 - main - INFO - Gewรผnschter Client ist live!
2024-12-22 18:27:46,272 - main - INFO - Verbunden mit @livehaf.official!
Future exception was never retrieved
future: <Future finished exception=ConnectionClosedOK(Close(code=1000, reason=''), Close(code=<CloseCode.NORMAL_CLOSURE: 1000>, reason=''), False)>
websockets.exceptions.ConnectionClosedOK: sent 1000 (OK); then received 1000 (OK)
2024-12-22 18:28:06,382 - main - INFO - Verbindung getrennt!
127.0.0.1 - - [22/Dec/2024 18:28:07] "GET / HTTP/1.1" 304 -
127.0.0.1 - - [22/Dec/2024 18:28:10] "GET / HTTP/1.1" 304 -
^CException in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.10/tkinter/init.py", line 1921, in call
return self.func(*args)
File "/home/kurtmidas/Desktop/ttlive/main.py", line 193, in start_recording
self.stop_recording()
File "/home/kurtmidas/Desktop/ttlive/main.py", line 228, in stop_recording
asyncio.run(self.disconnect_from_live())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
self.run_forever()
File "/usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
self._run_once()
File "/usr/lib/python3.10/asyncio/base_events.py", line 1871, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.10/selectors.py", line 469, in select
fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt
/usr/lib/python3.10/tkinter/init.py:1458: RuntimeWarning: coroutine 'TikTokRecorderGUI.quit_program' was never awaited
self.tk.mainloop(n)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
kurtmidas@vserver-21219:~/Desktop/ttlive$

mellow salmon
#

Or use trio guest mode and trio-asyncio to integrate your tkinter with asyncio

mellow salmon
#

Ah I assumed this was the official API

twilit yarrow
mellow salmon
twilit yarrow
#

Okay, thanks for the answer.

dull sequoiaBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.