Skip to content

Instantly share code, notes, and snippets.

@OndroMih
Created May 16, 2021 11:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OndroMih/17b4593912bc02d9eb98caf99b77ed1d to your computer and use it in GitHub Desktop.
Save OndroMih/17b4593912bc02d9eb98caf99b77ed1d to your computer and use it in GitHub Desktop.
Delete all videos in Tiktok
/*
* A script to delete all videos from a Tittok account
*
* Before running:
* 1. Log into your Tiktok account in a browser (tested with Firefox)
* 2. Navigate to the View Profile
* 3. Open the developer tools in the browser to inspect the URLs of the requests (Network tab in Firefox)
* 4. Click on one of the videos and delete it
* 5. In the developer tools, find the last POST request with a URL that starts with https://m.tiktok.com/api/aweme/delete
* 6. Copy the URL into the script below into the line that starts with 'const url'. Replace the value of aweme_id and target with: " + id + "
* 7. Navigate back to the VIew Profile page
* 8. Open developer tools and copy the script below into the Javascript console
* 9. Run the script several times until all the videos are deleted
* (each time you run it, it will only delete the videos showed on the page and reload the page)
*/
(() => {
let es =
document.querySelectorAll(".video-feed-item-wrapper");
console.log("es length: " + es.length);
let promises = [];
es.forEach(
e => {
const parts = e.href.split("/");
const id = parts[parts.length-1]
const options = {
method: 'POST',
credentials: 'include'
}
const url = "begining of the URL" + "6&aweme_id=" + id + "&target=" + id + "end of the URL";
// console.log(url);
promises.push(fetch(url, options));
}
);
Promise.all(promises)
.then( vs => {
console.log("All done, reloading the page!");
window.location.reload(true);
});
})()
@aixn881314
Copy link

Can you provide a query for all video data under the TikTok username? I need an API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment