krypton-byte / tiktok-downloader

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

additional parameter in VideoInfo #23

Open Inge1234567890 opened 1 year ago

Inge1234567890 commented 1 year ago

I´am trying your code to get videoinfo in pycharm. tiktok-downloader is the newest version with pip install git+https://github.com/krypton-byte/tiktok-downloader like in our tutorial.

from tiktok_downloader import VideoInfo VideoInfo.get_info('https://vt.tiktok.com/xxxxxx/')

async def tiktokfeed(self): videoinfo = VideoInfo.get_info('https://vt.tiktok.com/@frogprince1725/') print(videoinfo)

That´s my code in a task.

in pycharm i get this syntax error.

image

Traceback:

File "C:\Users\xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\tiktok_downloader__init__.py", line 1, in from .snaptik import snaptik, Snaptik File "C:\Users\xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\tiktok_downloader\snaptik.py", line 12, in class Snaptik(Session): File "C:\Users\xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\tiktok_downloader\snaptik.py", line 31, in Snaptik def get_media(self) -> list[Download]: TypeError: 'type' object is not subscriptable

krypton-byte commented 1 year ago

Python >= 3.9

Inge1234567890 commented 1 year ago

Same problem on Python 3.10

krypton-byte commented 1 year ago

show me the error

legiuner commented 1 year ago

for Python < 3.9

add : from typing import List, Dict

change : list[Download] to List[Download] list[DownloadAsync] to List[DownloadAsync] dict[str, str] to Dict[str, str] etc...