项目作者: dobizz

项目描述 :
Download public videos on TikTok using Python with Selenium
高级语言: Python
项目地址: git://github.com/dobizz/TikTok.git
创建时间: 2020-04-07T20:05:52Z
项目社区:https://github.com/dobizz/TikTok

开源协议:MIT License

下载


TikTok API Reverse Engineering

Initial commit as old code is deprecated because urls now require anti-spam parameters and signatures.

Instructions

How to install

  1. git clone https://github.com/dobizz/TikTok.git
  2. cd TikTok
  3. pip3 install -r requirements.txt

How to run

Execute run.py, chromedriver will be automatically downloaded.
Downloaded video files will be placed in ./videos/[username]

  1. python3 run.py

Requirements

Selenium

Learn more about Selenium here https://pypi.org/project/selenium/

  1. pip3 install selenium

Chrome Driver

Download ChromeDriver here https://chromedriver.chromium.org/downloads

You will need to redownload ChromeDriver if your installed version of chrome is newer than the provided version.

Code Structure

api.py

  1. class TikTok:
  2. def __init__(self, path: str):
  3. pass
  4. def _signURL(self, url) -> str:
  5. pass
  6. def getUserDetails(self, username) -> dict():
  7. pass
  8. def getTrending(self, count: int) -> list():
  9. pass
  10. def getUserTikToks(self, userid, count: int) -> list():
  11. pass

robots.py

  1. def getAllowedAgents() -> list():
  2. pass

Work In Progress

Features

  • Integrate Selenium/Chrome Webdriver
  • Partial concurrency
  • Function: _signURL(url:str) -> str
  • Function: getUserDetails(username:str) -> dict()
  • Function: getTrending(count: int) -> list(dict())
  • Function: getUserTiktoks(id:int, count:int) -> list(dict())
  • Complete all API functions
  • Add rotating proxies
  • Profile crawler
  • Trend crawler
  • Full concurrency

Files

  • api.py - TikTok API
  • robots.py - Reads User-Agents from https://www.tiktok.com/robots.txt
  • run.py
  • utils.py - Utilities for downloading and updating ChromeDriver
  • proxies.py - Module for proxies and IP addresses

Donate BTC

Find my code helpful? Some Satoshis would be nice. Thanks :)




1zdraxHPQfZ8wvpMXt2VYhnGwmkLCf7UL