Skip to content

Instantly share code, notes, and snippets.

@MichaelCurrin
Last active February 12, 2024 08:04
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save MichaelCurrin/fb303f276fd778f0bf328f2263aca8ba to your computer and use it in GitHub Desktop.
Save MichaelCurrin/fb303f276fd778f0bf328f2263aca8ba to your computer and use it in GitHub Desktop.
Export your list of favorite Netflix shows

Export Netflix List

Purpose

This gist helps your export names of shows on your Netflix profile list, so you can share those names with other people. You could put the output in a gist, blog post or email to your friends. I added mine as a gist here.

It will get the names of all the items on Netflix which are on My List. Shows that are your favorites or that you plan to watch. Note that this is separate from shows where you clicked the thumbs-up I like this button, which is more permanent, while you may want to trim your My List section down to remove shows you already watched. Unfortunately, I can't see any easy way to export all liked shows.

Requirements

  • You need a Netflix account that you are signed into.
  • You need to have clicked the tick on a show to add it to your "My list" section of shows. These could be shows that are your favorite or you want to watch.

Steps

  1. Login to Netflix.
  2. Go to My List.
  3. Open the JS console.
  4. Copy and paste the content of the JS file below.
  5. Copy your output. Save it somewhere.

Sample output

JSON array.

["About Time","Another Life","Aunty Donna's Big Ol' House of Fun"]

Plain text list.

About Time
Another Life
Aunty Donna's Big Ol' House of Fun

How it works

The script will find all items on the My List page. Their titles are not available as text unless you click on an item.

However, we can make use of the aria-label which is used for accessibility (like if you had poor vision and wanted to navigate the page with a tool). Or use .innerText which also seems to use that.

Privacy

The purpose of this tool it to automate getting out data that you already have access to within your own account and not change anything.

More details:

  • This info covered here is already available in your Netflix account in the form of text and images. You can't copy and paste or export that. You could write up that up my hand, but that is tedious. So we use some JS in your browser console to automate this.
  • The script only gives you access to your own user's data. It does not interact with the Netflix API or anything like that.
  • The script does not attempt to interact with Netfix to modify data - it only selects data.
// HTML Collection
const showsHtml = document.getElementsByClassName('slider-refocus')
// Array of elements, for use with array methods.
const showsArr = [...showsHtml]
// Array of strings.
const names = showsArr.map(i => i.getAttribute('aria-label'))
names.sort()
// Plain text list.
console.log(names.join('\n'))
const elements = document.querySelectorAll('.boxart-container')
const items = Array.from(elements)
const names = items.map(x => x.innerText)
names.sort()
// As JSON array.
console.log(JSON.stringify(names))
// Plain text list.
console.log(names.join("\n"))
@Shimilbi
Copy link

Shimilbi commented Jan 17, 2024

Thank you. I have been using your code for a while. Unfortunately, now it looks like Chrome doesn't let us paste javascript anymore.

@MichaelCurrin
Copy link
Author

Hmm I paste in the JS console fine for recent Chrome. Is it in the settings? Or try Chrome Canary.

Otherwise save your HTML page and then load that another way.

@Shimilbi
Copy link

Shimilbi commented Jan 20, 2024

I can only inject code in the adress bar, or use an extension in my chrome, now. (It seems to be a default feature. I don't know if I can change that, or even if I should, in case it leads to opening exploits that can be accessed from outside. But I found ways.)

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