(1/16/2025) Currently 3 days before the ban. I know this is last minute, I'm sorry I literally just got the script to work as intended. Anyways, this Python script will automatically download ALL your liked, favorited, DM'd videos as well as recent history videos with no watermarks and no audio delays. Still testing as we speak so I'll share more info as time passes. Forewarning, you may want to use VLC Media Player on Windows to open a majority of your downloaded TikToks. There is also a codec for the regular media player that you can purchase from Microsoft for $0.99: https://apps.microsoft.com/detail/9NMZLZ57R3T7?hl=en-us&gl=US&ocid=pdpshare
If for any reason you need to stop the script from running in Visual Studio Code, use this shortcut: (Ctrl + C)
- Installation This has the commands you will need to copy/paste later
- Usage
- License
(Note) Wherever you make the 'New Folder' is where all the videos will be downloaded to. I have the file on my desktop for example
Then you want to save the code as 'download_tiktok_videos_yt_dlp.py'. To do that, just replace the ".txt" with "download_tiktok_videos_yt_dlp.py"
Make sure you save it in the New Folder that you created with the 'user_data-tiktok.JSON' file
Your file is all set! Next you want to open Miscrosoft Visual Studio Code. You can install the app here: https://code.visualstudio.com
You then want to click this side icon for extensions. You want to search and install these Python extensions first before doing anything. For this tutorial, I installed this specific version of Python https://apps.microsoft.com/detail/9NRWMJP3717K?hl=en-us&gl=US&ocid=pdpshare
After you install Python, you want to restart Visual Studio Code by closing it and opening it again.
After you installed the Python extensions, click 'File' on the top and then click 'Add Folder to Workspace...'
A file browser will open. You want to go to the New Folder that you created earlier that has the 'user_data_tiktok' file and the 'download_tiktok_videos_yt_dlp' file. Once you find it in the file browser, it will appear as if it is empty. Do not panic, the files are still there. You then want to click the 'Add' button on the bottom-right of the window.
After you add the folder to the workspace. Go to this side icon and click it. You will now see both your JSON file and your Python file are in the workspace.
A new menu will appear at the bottom of the window. The path to your New Folder will already be in the terminal. (Note: Your path may look different than how it appears here. As long as you see (\New Folder) at the end of the path, then you're good to go)
On the lower right corner, you may see a different version of Python there. You must click on that tab to change the 'Interpreter'.
A small window will appear on the top of the screen. Make sure you select the Python interpreter that has the 'Global' lable at the end.
Now you want to install these Python extensions within the terminal. Just type this line in then press 'Enter' on your keyboard.
you will see the terminal install these extensions.
And finally, you want to put this command in the line just like how you did with the extensions, then hit 'Enter'
Then that's it! The script is now running and your videos will start downloading one by one in that terminal. It will take a long time so I suggest you leave you computer alone until it is complete. Do not try to move the videos to another folder while the script is downloading your videos or try to update any programs or games in the background. This could cause your computer to slow down and\or freeze. (UPDATE as of 1/18/25) You can move the videos to another spot where you have more space while the script is still downloading your videos. HOWEVER, you should only do it in very small groups at a time. Say 20 or 50 videos at a time. You can try to do more if you want, just be cautious. Make sure you're actually moving the videos to your new spot and not just copying them. Use (Cut/Paste instead of Copy/Paste)
Speaking of folders. You remember that 'New Folder' you created? The script will create another folder in that same place. That will contain all of your Tiktoks as they're being downloaded.
If for any reason you need to stop the script from running in Visual Studio Code, use this shortcut: (Ctrl + C)
P.S. The script skips over videos that have been taken down, so you don't have to worry about those appearing in your downloads file. And no, there is no way to make those videos work again unfortunately :(
- Clone the repository:
git clone https://gist.github.com/43327d54f5bd6b854916d095a1a42b8d.git
- Install dependencies:
pip install requests pytube yt-dlp
To run the project, use the following command:
python download_tiktok_videos_yt_dlp.py user_data_tiktok.json output/