Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Updated api call, added #shorts
Browse files Browse the repository at this point in the history
Updated new trending call, added #shorts to description. Added removal of file after upload.
  • Loading branch information
voletro committed Aug 20, 2021
1 parent c2716bf commit c147d37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

*.mp4
*.log
login.json
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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']
Expand All @@ -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...")
Expand Down Expand Up @@ -240,6 +241,7 @@ def main():
title=title,
description=description,
)
os.remove(f'{username}-{id}.mp4')
except:
driver.close()
raise
Expand Down

0 comments on commit c147d37

Please sign in to comment.