Mad_PacMan

This will hopefully do the trick

Jun 2nd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Yea, this will only import from youtube. Run in console on plug while running plug_p0ne.
  2. //Put the playlist object you got from Brinkie's script here (Replace "{}" with the text {"time":1416,"status":"ok","dubtr ... etc.)
  3. var playlistz = {}; /*<---- there*/
  4.  
  5.  
  6. // this script requires plug_p0ne
  7. var songsz = [];
  8. for (var x in playlistz.data) {
  9.     if (playlistz.data[x].format === 1) {
  10.         mediaLookup(["https://www.youtube.com/watch?v=" + playlistz.data[x].cid]).then(function(songs) {
  11.             songsz.push(songs)
  12.         });
  13.     }
  14. }
  15.  
  16. // wait a bit before running this after the above.
  17. createPlaylist("### import " + playlistz.meta.name, songsz.filter(function(a){return a}).map(function(s){
  18.     s = s[0];
  19.     var i = s.title.indexOf(" - ");
  20.     if (i != -1) {
  21.         s.author = s.title.substr(0, i);
  22.         s.title = s.title.substr(i+3);
  23.     } else {
  24.         s.author = s.uploader.name || "?"
  25.     }
  26.     return {cid: s.cid, format: s.format, duration: s.duration, image: "https://i.ytimg.com/vi/"+s.cid+"/default.jpg",
  27.         author: s.author, title: s.title, id: 0
  28.     }
  29. }));
Add Comment
Please, Sign In to add comment