Created
May 2, 2019 10:55
-
-
Save christianmondabon/224741f16e78099c5db456cf8629c2f1 to your computer and use it in GitHub Desktop.
Delete previously synced files which are not on a YouTube playlist anymore (see youtube-playlist-sync project)
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
#!/bin/bash | |
/usr/local/bin/youtube-dl -j --flat-playlist --restrict-filenames "YOUTUBE-PLAYLIST-URL" | cut -d'"' -f4 | xargs -I "{}" -n 1 find FILELOCATION -type f -name '*{}*' | sort | comm -23 <(find $FILELOCATION -type f | sort) - | grep -v yps.json | xargs -I "{}" rm '{}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment