Created
June 6, 2020 22:55
-
-
Save ahikmatf/96d7abe6993113e9f00d0c687e827bb7 to your computer and use it in GitHub Desktop.
original link by @joyblanks https://gist.github.com/jordan314/6bdc9af962fd8620a4fb#gistcomment-3128172
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Login & Select your old Account -> Profile | |
2. Go to My List (old profile) | |
3. Run this code in your Browser Developer console to Export and save My List | |
var tmpList = (function() { | |
var list = [] | |
document.querySelectorAll('.title-card a[aria-label]').forEach( | |
function(item) { | |
try { | |
list.push({ | |
name: item.getAttribute('aria-label'), | |
link: ("https://www.netflix.com" + item.getAttribute("href").split("?")[0]).replace('watch', 'title') | |
}) | |
} catch (err) { | |
console.error("ERROR: Ignored err", err, item) | |
} | |
}) | |
return (JSON.stringify(list)); | |
}()); | |
localStorage.setItem('tmpList',tmpList); | |
4. Logout old account | |
5. Login & Select your new Account -> Profile | |
6. Run this Code in your Browser Developer console to Import My List saved in step 3 | |
(function(){ | |
var list = JSON.parse(localStorage.getItem('tmpList')) | |
var counter = 0; | |
function openWin(e){ | |
var popup; | |
popup = window.open(list[e].link); | |
popup.onload = function(){ | |
setTimeout(function(){ | |
if(popup.document.querySelector('.nf-flat-button-icon-mylist-add + span')){ | |
popup.document.querySelector('.nf-flat-button-icon-mylist-add + span').click(); | |
setTimeout(function(){popup.close()}, 500); | |
console.log('Added', list[e].name); | |
} else { | |
popup.close(); | |
console.log('Already added', list[e].name); | |
} | |
}, 500) | |
} | |
var timer = setInterval(function() { | |
if(popup && popup.closed) { | |
clearInterval(timer); | |
if(list.length-1 > counter){ | |
openWin(++counter); | |
} else { | |
console.log('Added'); | |
localStorage.removeItem('tmpList'); | |
} | |
} | |
}, 1000); | |
} | |
openWin(counter) | |
}()) | |
7. Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment