This tool parses the JSON version of the TikTok user data (typically named user_data.json) and downloads all the video files to a local folder.
First, request a copy of your data from TikTok, make sure you select the JSON format.
Next, wait until you receive an email from TikTok telling you that your data is ready.
Now download the ZIP file to your computer and unzip, you should end up with a file called user_data.json, this file could be quite large and I recommend not trying to open it in your text editor. Follow the instructions below to run this tool against the JSON file.
.\Get-TikTokVideo.ps1 -JsonFile "C:\TikTok\user_data.json" -OutputFolder "C:\TikTok\Videos"
The PowerShell version of this tool accepts several command line paramaters to control the tool's behavior.
- -JsonFile, Path to the TikTok user data JSON file
- -OutputFolder, Video download destination path
- -Force, If set to true files will be re-downloaded
- -Verbose, If set to true, the script will output more data to the console
In certain cases, it may be necessary to set the script execution policy for your current user. For example, users still running PowerShell 5.x.
To set the execution policy for your user, use the following command:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
tiktok.py filename.json -d /path/to/folder -v
- filename.json: Path to the TikTok user data JSON file
- -d, --dest: Video download destination path
- -v, --verbose: Enables verbose logging
Just in case you're curious, this is what the data structure looks like.
Activity:
Video:
Videos:
VideoList:
- Date:
Likes:
Link:
- Python 3
- PowerShell 5.x
Thanks to @thebeardeditguy for showing the community this method!
Thanks to @crisisofconscience for beta testing!