Skip to content

Instantly share code, notes, and snippets.

@dmitriy1980
Created December 22, 2021 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitriy1980/43e6a94be4c5a8b0b045acf72b016039 to your computer and use it in GitHub Desktop.
Save dmitriy1980/43e6a94be4c5a8b0b045acf72b016039 to your computer and use it in GitHub Desktop.
Export "My List" from Netflix to CSV
(function() {
var lineArray = [];
document.querySelectorAll('.title-card a[aria-label]').forEach(
function(item, index) {
try {
var line = item.getAttribute('aria-label').replace(/,/g, '') + "," + "https://www.netflix.com" + item.getAttribute("href").split("?")[0]
lineArray.push(index == 0 ? "data:text/csv;charset=utf-8," + line : line);
} catch (err) {
console.err("ERROR: Ignored err", err, item)
}
})
var csvContent = lineArray.join("\n");
data = encodeURI(csvContent);
link = document.createElement('a');
link.setAttribute('href', data);
link.setAttribute('download', 'export.csv');
link.click();
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment