WinaYo 1.3
Import/Sync WinAmp/WACUP Playlists (m3u8) to Youtube Music (YTM) PlayLists (csv) using Python and ytmusicapi
Introduction
WinaYo is a command line toolkit to update/sync/delete and import WinAmp/WACUP playlists (m3u8) to Youtube Music playLists (csv) using Python and ytmusicapi. The target audience are people who have organized their music and playlist collection in WinAmp/WACUP and want to sync their collection to YTM.
Currently Youtube Music has no tool to sync WinAmp/WACUP playlists. WinaYo fills this gap. WinaYo also allows to backup your YTM playlists to csv files, which you can edit in Excel or WinAmp/WACUP and import back into YTM. Deleting all your playlists is also supported. WinaYo can easily be modified to sync playlists from other local music managers.
Important remarks/limitations
- WinaYo asumes that the filenames of your song collection are formatted as <Artist> - <Title>.mp3. If this is not the case, either you need to adjust WinaYo to fit another naming convention (see 4-WinAmp2GooglePlayList.bat) or you can easily reformat either your filenames or your tags to make them consistent using mp3tag.
- WinaYo will not delete or create songs in Youtube Music, only playlists deleted/recreated/updated. To delete or upload songs you can use the YTM webclient.
- Ytmusicapi has no reliable way of returning the YTM songids (recently) added, so everytime you upload a batch of new songs to YTM, you should export all YTM songids to update the local database.
- A maximum of 100000 songid's can be handled.
- A maximum of 1000 playlists can be handled.
- A maximum of 5000 songs per playlist can be handled (if playlists are >5000 songs, they will be automatically split into " Part 1,2,3,...")
- The current version of WinaYo does not allow to sync(append/remove) split playlists (>5000 songs): use DeleteList.py() and CreateList.py() manually for those playlists
- There is a limit on the number of Youtube apicalls Google allows (quota limit unknown)
Version History
- Version 1.0 (14/08/2020) export YTM songsids and playlists functions
- Version 1.1 (16/08/2020) import/create playlists functions
- Version 1.2 (20/08/2020) delta updating functions
- Version 1.3 (23/08/2020) user-interface implemented
Download and Installation
Download WinaYo.zip.
Unzip WinaYo.zip to a permanent directory (f.i. C:\WinaYo).
Forum
Please check the WinaYo forum for your questions and answers, your feedback and the latest information.
Workflow
Prerequisites
- Install Python >3.5
- Install python ytmusicapi (by sigma67): pip install ytmusicapi
- Install python configparser: pip install configparser
- Install other "unknown" python modules when receiving errors: pip install <module>
- Add a valid Youtube Music cookie in the file headers_auth.json to authenticate (replace cookie data between "")(see below)
- Optional: Download and install ML Exporter v1.0 for WinAmp to export all Smart Views (builtin in WACUP)
- Optional: Install rxrepl.exe (already included in this project zip)
- Optional: Install csvquery.exe (already included in this project zip)
- Optional: import and export folders contain some example playlists for demo purposes (files can be deleted)
Get a valid YTM Cookie using Chrome/Chromium/Edge to authenticate
- open music.youtube.com in Chrome/Chromium/Edge
- open dev tools (ctrl-shift-i)
- do some action in main page (f.i. open playlists)
- goto network tab
- filter on json and select latest entry
- look in header tab for string cookie and copy data
- open headers_auth.json and copy cookie data to cookie and save
- remark: this cookie will be valid as long as you don't logout from YTM
Collect/Export WinAmp/WACUP SmartView Playlists (auto generated) to m3u8
- Create a WinAmp/WACUP Smartview called All containing all your WinAmp/WACUP songs (query: artist ISNOTEMPTY AND title ISNOTEMPTY) (needed to compare against YTM later-on)
- Open WinAmp/WACUP and click in lower left corner on Library and select Export/Smart Views/All Smart Views
- Select m3u8 format and folder import
- Remark: Sometimes export fails, fix: restart WinAmp/WACUP and immediately do the export as fast as possible (also disable WinAmp/WACUP option: preferences/media library/local library/rescan folders at startup)
Collect/Export WinAmp/WACUP Static Playlists (manually created) to m3u8
- Select (static) Playlists foldertab and select all (static) playlists you want to upload to YTM and click Save
- Select m3u8 format and folder "import"
Scenario 1: Create and export WinAmp/WACUP playlists to YTM (initial upload)
- First upload your WinAmp/WACUP songs collection to YTM using the YTM webclient (initial upload)(at the moment there is no other decent upload tool).
- Collect/export your WinAmp/WACUP smartviews and static playlists into folder "import" (as described above).
- Edit file "PlaylistsToDelete.txt" containing the names of the YTM playlists to delete (valid names can be found in file "export\Playlists.csv" after step 1)
- Edit file "PlaylistsToCreate.txt" containing the names of the WinAmp/WACUP playlists to create in YTM (see folder import after step 4)
- Run 0-CorrectWAPlayListPaths.bat: locally remove unwanted WinAmp/WACUP playlists and correct songpaths (you have to review the bat file to your needs)
- Run 1-ExportYTMusicLibrary.bat: export all uploaded YTM songid's in a playlist called export\All.csv and YTM playlistid's to export\Playlists.csv (run initially and when new songs are uploaded to YTM)
- Run 2-ExportYTMusicPlayLists.bat: export all YTM playlists to a folder export (run as a backup and to check differences with WinAmp/WACUP later-on)
- Run 3-DeleteYTMusicPlayLists.bat: delete all YTM playlists specified in file PlaylistsToDelete.txt (run only when you want to (re-)upload all playlists later-on)
- Run 4-WinAmp2YTMusicPlayLists.bat: locally convert the WinAmp/WACUP playlist csv's to YTM playlist csv's with matching YTM songid's (after running 1-ExportYTMusicLibrary.bat)
- Run 5-CreateYTMusicPlayLists.bat: create and upload all WinAmp/WACUP playlists to YTM playlists specified in file PlaylistsToCreate.txt (new YTM playlists are created!)
Remark: everytime you upload a batch of new songs to YTM, you should run
1-ExportYTMusicLibrary.bat to update the local songid database.
Scenario 2: Sync WinAmp/WACUP playlists to YTM (append/remove)
- Use this scenario to sync(append/remove) your playlists after you initially performed Scenario 1 (initial upload)(use this for relatively smaller delta's).
- Collect/export your WinAmp/WACUP smartviews and static playlists into folder import (as described above).
- Edit file PlaylistsToUpdate.txt containing the names of the YTM playlists to update (valid names can be found in file export\Playlists.csv after step 1)
- Remark: current version of WinaYo does not allow to sync(append/remove) split playlists (>5000 songs, with <name> split into <name> Part 1,2,3,...)(use DeleteList.py() and CreateList.py() instead)
- Run 0-CorrectWAPlayListPaths.bat: locally remove unwanted WinAmp/WACUP playlists and correct songpaths (you have to review the bat file to your needs)
- Run 4-WinAmp2YTMusicPlayLists.bat: locally convert the WinAmp/WACUP playlist csv's to YTM playlist csv's with matching YTM songid's (after running 1-ExportYTMusicLibrary.bat)
- Run 6-WASongsNotInYT.bat: report songs in WinAmp/WACUP not present in YTM and save result in delta\WASongsNotInYT.csv (optional)
- Run 7-YTSongsNotInWA.bat: report songs in YTM not present in WinAmp/WACUP and save result in delta\YTSongsNotInWA.csv (optional)
- Run 8-CopyWASongsNotInYT2Temp.bat: copy new songsfiles(mp3) present in WinAmp/WACUP but not in YTM to temp folder (upload to YTM using YTM webclient)(files may be removed after uploading)
- Run 1-ExportYTMusicLibrary.bat: export all uploaded YTM songid's in a playlist called export\All.csv and YTM playlistid's to export\Playlists.csv (run only when new songs are uploaded to YTM)
- Run 9-UpdateYTMusicPlayLists.bat: update/sync only YTM playlists different From WinAmp/WACUP playlists specified in PlaylistsToUpdate.txt (append/remove songs from YTM playlists)
- Run 2-ExportYTMusicPlayLists.bat: export all YTM playlists to a folder export (run only to update local YTM playlists to check differences with WinAmp/WACUP later-on)
Remark: everytime you upload a batch of new songs to YTM, you should run
1-ExportYTMusicLibrary.bat to update the local songid database.
Using the Userinterface
Scenarios 1 and 2 are also available via the userinterface WinaYo.exe.
Actions are grouped in 4 groups:
- Export Youtube Music Database
- Prep/Convert WinAmp Playlists
- Report/Gather Song Differences
- Create/Update/Delete Youtube Music Playlists
The left column of actionbuttons start one the above mentionned .bat files.
The right column of actionbuttons allow to browse the folders, edit the preferences files or view the reports.
Remark: everytime you upload a batch of new songs to YTM, you should click
Export Youtube Music Songids to update the local songid database.
License
This software is distributed as freeware. If you keep using this software, send me an appreciation or feedback e-mail for my programming effort and sharing this tool for free.
Or even better, buy me a coffee .
Disclaimer
This software and the accompanying files are supplied "as is", without any express or implied warranty.
In no event shall the author be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages from the use of this software.
By using this software you agree with these conditions.
Copyright © 2020 by
Johan Van Barel. All Rights Reserved