krypton-byte / tiktok-downloader

Tiktok Downloader/Scraper using requests & bs4
https://tiktok-dl.id
GNU General Public License v3.0
296 stars 82 forks source link

Able to render slideshow videos. #44

Closed andrew121410 closed 9 months ago

andrew121410 commented 9 months ago

On the website https://snaptik.app if you put a slideshow type "video" in there you are able to hit the "render video" button for it to produce a regular mp4 video.

Is it possible to implement this?

krypton-byte commented 9 months ago

check my latest commit

videos=snaptik(tiktok_url)
videos[index].get_render().download("regular.mp4")
andrew121410 commented 9 months ago

Will test tomorrow! thank you 🙏

andrew121410 commented 9 months ago

I get

(Please note I'm not a Python developer, I'm a Java developer literally know nothing about python lol)

root@machine1:~# python3.11 -m tiktok_downloader --url THE_TIKTOK_LINK --snaptik --save test.mp4
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/usr/local/lib/python3.11/dist-packages/tiktok_downloader/__init__.py", line 1, in <module>
    from .snaptik import snaptik, Snaptik
  File "/usr/local/lib/python3.11/dist-packages/tiktok_downloader/snaptik.py", line 7, in <module>
    from .utils import Download, DownloadAsync, Type, extension_to_type
  File "/usr/local/lib/python3.11/dist-packages/tiktok_downloader/utils.py", line 4, in <module>
    from PIL import Image
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 89, in <module>
    from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/usr/lib/python3/dist-packages/PIL/__init__.py)
root@machine1:~#
andrew121410 commented 9 months ago

I guess this is happening because it's trying to use something from "/usr/lib/python3" Instead of "/usr/lib/python3.11" I don't think you can actually change the default python version in Ubuntu, because wouldn't that break a lot of things?

Have no idea lol

https://askubuntu.com/questions/1416772/ubuntu-and-its-dependancy-on-python https://unix.stackexchange.com/questions/687984/change-the-python-default-version-in-ubuntu

image

krypton-byte commented 9 months ago

Did you encounter any errors during the installation of dependencies (Pillow)?

pip uninstall Pillow
pip install Pillow
andrew121410 commented 9 months ago

Seems like Python or Ubuntu comes with Pillow already installed. Here I tried on one of my other machines fresh install of tiktok_downloader here's the log and same error.

https://pastebin.com/1B4fVZGM

andrew121410 commented 9 months ago

I fixed I had to run python3.11 -m pip install --upgrade pip then It let me uninstall Pillow then I uninstalled tiktok_downloader, reinstalled it and now everything is working. It wouldn't let uninstall Pillow without upgrading pip though.

andrew121410 commented 9 months ago

Now I get

root@machine1:~# python3.11 -m tiktok_downloader --url https://www.tiktok.com/t/ZPRvXnTHK/ --snaptik --save test.mp4
Invalid URL '': No scheme supplied. Perhaps you meant https://?
Post Not Found
root@machine1:~#

removing the "www." from the URL I get

root@machine1:~# python3.11 -m tiktok_downloader --url https://tiktok.com/t/ZPRvXnTHK/ --snaptik --save test.mp4
list index out of range
Post Not Found
root@machine1:~#
krypton-byte commented 9 months ago

Check my latest commit.

andrew121410 commented 9 months ago

Yep that works, thank you!!! 🎉