Guest User

Untitled

a guest
Aug 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. def create_playlist(playlist):
  2. gplaylist = "[playlist]n"
  3. playlist1 = json.loads(playlist)
  4. x = 1;
  5. for i in enumerate(playlist1):
  6. for j in enumerate(i[1]['folder']):
  7. gplaylist += "File" + str(x) + "=" + parse_file(j[1]['file']) + "n"
  8. # Variable: j[1]['title'] must converted to "x412x437x440x44bx432x430x44f"
  9. gplaylist += "Title" + str(x) + "=" + j[1]['title'] + "n"
  10. x += 1
  11. gplaylist += "NumberOfEntries=" + str(x-1)
  12. write_playlist(gplaylist)
  13.  
  14. def write_playlist(playlist):
  15. with io.open('play_list.pls', 'w', encoding='utf-8') as outfile:
  16. outfile.write(to_unicode(playlist))
Add Comment
Please, Sign In to add comment