diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e025c76 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ + +*.mp4 +*.log +login.json \ No newline at end of file diff --git a/main.py b/main.py index c018cf1..b5f98fc 100644 --- a/main.py +++ b/main.py @@ -48,6 +48,7 @@ from selenium.webdriver.remote.webelement import WebElement from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait +from random import randint currentpath = os.getcwd() @@ -194,7 +195,7 @@ def _set_time(driver: WebDriver): def main(): api = TikTokApi.get_instance() - trending = api.trending(count=1, custom_verifyFp="") + trending = api.by_trending(count=1, custom_verifyFp="") for tiktok in trending: tvideo = tiktok['video'] link = tvideo['downloadAddr'] @@ -207,7 +208,7 @@ def main(): if len(desc) > 75: desc = desc[:75] title = f"{desc} - @{username} - For You" - description = f"Credit to the original creator, @{username}. Check out their other content here: https://tiktok.com/@{username}" + description = f"Credit to the original creator, @{username}. Check out their other content here: https://tiktok.com/@{username} #shorts" print("Downloaded video!") print(title) print("Starting upload...") @@ -240,6 +241,7 @@ def main(): title=title, description=description, ) + os.remove(f'{username}-{id}.mp4') except: driver.close() raise