Open hosmanadam opened 4 years ago
There's a discrepancy between YouTube's handling of the clicks on the front-end and back-end, and we don't know where the issue occurs. Some part of the system can't keep up with the speed of the clicks and encounters a race condition, db lock, or similar. The details for why this happens aren't of much interest, let's just say that YouTube wasn't designed to be clicked so fast.
The following solutions come to mind:
The way this could work is if click timing wasn't based on a fixed interval, but on an event triggered by the successful completion of the previous removal. Successful removals are signaled, for example, by:
https://www.youtube.com/playlist_edit_service_ajax/?action_remove_video=1
(?)This would fully achieve the expected behavior outlined in the ticket.
YouTube does have a video delete API which could possibly be accessed by a userscript
This would probably exceed the expected behavior outlined in the ticket, plus provide additional benefits. However, it would make the application way more complicated and take considerably more time to implement. Or, it may not even work since many API requests may be even worse than many clicks (API only allows individual removals).
localStorage
, and go.init()
, load settings and start working without requiring user interaction.This would partially achieve the expected behavior outlined in the ticket, with the end result being the same as in the "Proper fix".
Describe the bug
During batch removal, some videos, when their remove button is clicked, seem to get removed from the playlist but reappear later when the page is reloaded. Additionally, this leaves the batch removal script in an infinite loop and prevents the success confirmation from being displayed — it knows that not all videos have been removed, but can't find any of the videos it wanted to remove. An early indicator that this is going to happen is that the video count doesn't get decremented each time a video disappears.
To reproduce
Expected behavior
Setup
Additional context
This is more likely to happen with higher
clicksPerSecond
values and larger (100+) playlists. It doesn't happen, for example, on a single-page playlist withclicksPerSecond = 1
.