Automate the removal of likes in TikTok

If you have ever tried to delete your likes on TikTok you would have realized that there are too many videos, then it becomes more tedious and time consuming to scroll and delete likes manually.

Remove likes with a JavaScript code

The idea …


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Frank Alvarez

If you have ever tried to delete your likes on TikTok you would have realized that there are too many videos, then it becomes more tedious and time consuming to scroll and delete likes manually.

Remove likes with a JavaScript code

The idea is simple, place the like button and the arrow button to scroll to the next video, then make a loop to intersperse the clicks of the like button and then the scroll button.

Writing the code

For this case we will use an anonymous function that receives two parameters, one is the waiting time to go to the next video and the second is a number that will indicate how many videos the like will be removed, by default this is -1 which is equal to infinity.

The code would look like this:

((timeout, limit = -1) => {
    const likeButton = document.querySelector('span[data-e2e="browse-like-icon"]').parentElement
    const scrollButton = document.querySelector('button[data-e2e="arrow-right"]')
    if (likeButton && scrollButton) {
        let i = 1, interval = setInterval(() => {
            likeButton.click()
            setTimeout(() => scrollButton.click(), 300)
            if (i++ === limit) clearInterval(interval)
        }, timeout * 1000)
    }
})(1) // parameters are passed here, which are the timeout and the likes limit, which by default is infinite.

Executing the code

You will need to have a computer or laptop nearby, as it is necessary to use the browser console to run the script.

To remove multiple likes on TikTok quickly and automatically follow the steps below:

  1. First open tiktok.com and log in.
  2. Then open your profile page and go to the "Liked" tab. Liked preview tab
  3. Open the developer console with "Ctrl +Shift +J" or by right clicking and selecting "inspect" or by pressing "F12". (Remember to go to the "console" tab). browser console
  4. Copy and paste the code into the console and press enter.

    ((timeout, limit = -1) => {
        const likeButton = document.querySelector('span[data-e2e="browse-like-icon"]').parentElement
        const scrollButton = document.querySelector('button[data-e2e="arrow-right"]')
        if (likeButton && scrollButton) {
            let i = 1, interval = setInterval(() => {
                likeButton.click()
                setTimeout(() => scrollButton.click(), 300)
                if (i++ === limit) clearInterval(interval)
            }, timeout * 1000)
        }
    })(1) // -> (timeout in seconds, limit)
    

    Example:
    Example console text

  5. Done 🥳, now you just have to wait for the likes to be removed without doing anything.

Conclusion

This code works as of today and maybe in a next update of the TikTok web application it will break, but you can leave it in the comments if that happens, I will try to update this article.

Although if you have knowledge you can change and practice how to get the element of both buttons from the html, if you fix that then everything will work perfect.

And remember that the timeout cannot be less than one second. đź‘€


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Frank Alvarez


Print Share Comment Cite Upload Translate Updates
APA

Frank Alvarez | Sciencx (2022-10-16T16:33:46+00:00) Automate the removal of likes in TikTok. Retrieved from https://www.scien.cx/2022/10/16/automate-the-removal-of-likes-in-tiktok/

MLA
" » Automate the removal of likes in TikTok." Frank Alvarez | Sciencx - Sunday October 16, 2022, https://www.scien.cx/2022/10/16/automate-the-removal-of-likes-in-tiktok/
HARVARD
Frank Alvarez | Sciencx Sunday October 16, 2022 » Automate the removal of likes in TikTok., viewed ,<https://www.scien.cx/2022/10/16/automate-the-removal-of-likes-in-tiktok/>
VANCOUVER
Frank Alvarez | Sciencx - » Automate the removal of likes in TikTok. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/10/16/automate-the-removal-of-likes-in-tiktok/
CHICAGO
" » Automate the removal of likes in TikTok." Frank Alvarez | Sciencx - Accessed . https://www.scien.cx/2022/10/16/automate-the-removal-of-likes-in-tiktok/
IEEE
" » Automate the removal of likes in TikTok." Frank Alvarez | Sciencx [Online]. Available: https://www.scien.cx/2022/10/16/automate-the-removal-of-likes-in-tiktok/. [Accessed: ]
rf:citation
» Automate the removal of likes in TikTok | Frank Alvarez | Sciencx | https://www.scien.cx/2022/10/16/automate-the-removal-of-likes-in-tiktok/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.