if you are not a developer, then skip this and go to the next section.
Devs, I wrote this for some non-technical people that really wanted to empty that list quickly w/o having to click on the X
icon 400 times. Keep that in mind when you read this. Please feel free to turn this into a little node api wrapper that does some nice stuff, I would if I had the time :)
There is an attached Javascript file for this gist. You can scroll down and view it, look through it, and the comments should answer your questions.
To run the script all you need to do is copy and paste the code into a console debugger in the browser. For example, in the chrome browser simply right click and select "inspect element". This will open a debug tool on the bottom or the right side of the browser. There will be a few tabs, e.g. Elements
, Console
, Network
, Resources
etc.. Choose the console tab. Then ensure you've edited the code below so that the userId
and authUrl
variables actually contain the correct data (There are instructions on how to do this below). Then copy and paste the entire script into your console and hit enter to run it. Important You will need to make one request first to get your user id
and auth url
, as mentioned above. I've laid out steps on how to do that if you're not familiar with web development, http request/response cycle, or javascript.
Go to Netflix and change your list to be manually sortable first. You can hold cmd and click on this link Netflix.com or you can just right click on the link and select open in new tab. Once here, change the option to manual sorting so that Netflix no longer auto-sorts your list into oblivion - making it impossible to find something you added to your list the day before. After saving your change, you will need to navigate to the "My List" page in your browser.
Next you will need 2 things to proceed. -[x] Your user id - which will be in the api URL -[x] your auth URL code - an extra security measure
To get these 2 items, refer back to the inspector window in your browser and select the tab Network In the network tab, the next row down has a red record button and a clear all button. Click the clear all button to wipe out all the existing requests that will make it harder to find your information.
Now to get the 2 items, use the site to remove an item from the list by:
- clicking on the X by any title you want to remove from your list on the website. Afterwards, look at the network list in the inspector network tab and you will see your request popup at the bottom of the list. It should be named someything like playlistop.
- Click on that request and the details will pop up in the network tab.
- Your
userId
will be listed beside the Request URL (It should be the first thing you see at the top of the request). Your user id will be in the url after api and before the end:/api/shakta/<123-user-id>/playlistop
Copy your user id and paste it somewhere temporarily. - The
authUrl
will be at the very bottom of the network details in the section titled Request Payload. Click on the request payload and you will see 3 or 4 keys with values e.g.operation: remove
.. find the key that saysauthUrl
, select the value and copy it. Now paste it somewhere temporarily.
First, edit the javascript code below and paste your user id in place of the variable userId
. Replace the text my-user-id-goes-here
with the actual value e.g. If you're user if was 123456 then it would look like
const userId = '123456';
Do the exact same for the auth url.
Finally, copy the entire contents of the script below, after you've updated it, and paste it into your console. Then hit enter. It should delete everything in your list and allow you to easily start over.
Twitter @andruwhart gmail [email protected]
Thanks for writing this script.
Tried to run this script (as of 10th Jan 2023) , and had to do some changes to the script to get it running successfully.
Change 1:
const nodes = document.querySelectorAll('.gallery .title-card-container a');
Change 2:
let movies = Array.prototype.map.call(nodes, title => title.getAttribute('href').split('/', 3)[2].split('?')[0]);