Michele0303 / tiktok-live-recorder

🎥✨ A TikTok live streaming recorder tool written in Python. Capture and relive your favorite TikTok moments effortlessly. 🎥✨
MIT License
370 stars 102 forks source link

Noob question: What is the best way to update it to the newest version? #55

Open spinningsand opened 1 year ago

spinningsand commented 1 year ago

Is there a way to upgrade it without deleting the old files first? If I do the installation command, it tells me that the file already exists.

spinningsand commented 1 year ago

I'll just ask this here since this will probably would've been a short thread anyway:

When I look at the output, it saves the live in a bunch of small files that vary in length, but usually less than a minute long and doesn't record all of it. I was recording for over 15 minutes and maybe got around 6 or 7 minutes at the most saved. I think it may have something to do with lag but I'm not sure. If there's a tiny lag in the stream, it starts a new recording and I think it messes with the recording process as well if it happens frequently. I was was watching the live and the lag usually isn't even noticeable, though.

It doesn't do it on every live, though, so that's what also makes me think it has to do with the quality of that particular live.

Michele0303 commented 1 year ago

Is there a way to upgrade it without deleting the old files first? If I do the installation command, it tells me that the file already exists.

For now you have to manually update the version.

I'll just ask this here since this will probably would've been a short thread anyway:

When I look at the output, it saves the live in a bunch of small files that vary in length, but usually less than a minute long and doesn't record all of it. I was recording for over 15 minutes and maybe got around 6 or 7 minutes at the most saved. I think it may have something to do with lag but I'm not sure. If there's a tiny lag in the stream, it starts a new recording and I think it messes with the recording process as well if it happens frequently. I was was watching the live and the lag usually isn't even noticeable, though.

It doesn't do it on every live, though, so that's what also makes me think it has to do with the quality of that particular live.

Are you using the ffmpeg mode?

spinningsand commented 1 year ago

Yes, I use it on automatic mode with ffmpeg. It's only happened once so far (which was also the first time using it) and I've tested it out around 7+ times since then and they all worked fine. So hopefully it's something that won't happen often, but I didn't know if you had any more ideas on what it was.

spinningsand commented 1 year ago

Another issue I've found is that sometimes it doesn't recognize that the stream has ended and I have to press ctrl + c to end the program (pressing q like it says in the terminal doesn't do anything) and the file it saves is corrupted. It's happened twice now.

EDIT: I think it's similar to the other issue. If there's a lag or if the live pauses for a few seconds, then it seems to mess with the recording process.

Here's some stuff said in the terminal the first time after I manually ended it:

Traceback (most recent call last):
  File "C:\Users\CLUNKYBOXCOMPUTER\TikTok-Live-Recorder\main.py", line 108, in <module>
    main()
  File "C:\Users\CLUNKYBOXCOMPUTER\TikTok-Live-Recorder\main.py", line 102, in main
    bot.run()
  File "C:\Users\CLUNKYBOXCOMPUTER\TikTok-Live-Recorder\tiktokbot.py", line 52, in run
    self.room_id = self.get_room_id_from_user()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\TikTok-Live-Recorder\tiktokbot.py", line 185, in get_room_id_from_user
    response = req.get(f"https://www.tiktok.com/@{self.user}/live", allow_redirects=False)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 489, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
                       ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 449, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 444, in _make_request
    httplib_response = conn.getresponse()
                       ^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 1374, in getresponse
    response.begin()
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 318, in begin
    version, status, reason = self._read_status()
                              ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 279, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\socket.py", line 705, in readinto
    return self._sock.recv_into(b)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1278, in recv_into
    return self.read(nbytes, buffer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\CLUNKYBOXCOMPUTER\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1134, in read
    return self._sslobj.read(len, buffer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

And the second time in a different live:

[*] STARTED RECORDING... [PRESS 'q' TO STOP RECORDING]
[-] FFmpeg Error:
ffmpeg version 2021-05-12-git-175f675f7b-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57.  0.100 / 57.  0.100
  libavcodec     59.  1.100 / 59.  1.100
  libavformat    59.  0.101 / 59.  0.101
  libavdevice    59.  0.100 / 59.  0.100
  libavfilter     8.  0.101 /  8.  0.101
  libswscale      6.  0.100 /  6.  0.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
[https @ 000001ba58cdb740] HTTP error 404 Not Found
Michele0303 commented 1 year ago

I will try to investigate

spinningsand commented 1 year ago

I guess the quickest way to see it for yourself might be to find a live that lags or pauses and see if you can replicate it. It's done the second issue (except without any error message in the terminal) a few more times now. It'll get stuck and say the recording has started and then it'll never say it finished recording even after they end the live and the file it saves is either corrupted or I've had a couple times where it didn't save the live at all and was only ~180 bytes and also non-playable.

Liam942 commented 1 year ago

Another issue I've found is that sometimes it doesn't recognize that the stream has ended and I have to press ctrl + c to end the program (pressing q like it says in the terminal doesn't do anything) and the file it saves is corrupted. It's happened twice now.

when the file gets corrupted for me I usually use the github program untrunc, its fixes most issues I have had.

spinningsand commented 1 year ago

Another issue I've found is that sometimes it doesn't recognize that the stream has ended and I have to press ctrl + c to end the program (pressing q like it says in the terminal doesn't do anything) and the file it saves is corrupted. It's happened twice now.

when the file gets corrupted for me I usually use the github program untrunc, its fixes most issues I have had.

Nice! Thanks for this.

I will try to investigate

Are there any updates on what you think the issue might be?