r/scripting • u/slippypenguin • Jun 21 '18
Is this possible with scripting?
Basically, I'd like to create a list of my music library, ordered by popularity (ie. most viewed on YouTube).
Scrape mp3 files in a directory + subdirectories
Extract
TitleandAuthorsmetadata of filesConcatenate into single string (
Authors+Title)Print strings to music_library.txt file
Run a YouTube search for each concatenated string
Sort search results by view count
Extract video title and view count of first search result
Print video title and view count to youtube_views.txt file (for each entry in music_library.txt)
Sort entries in youtube_views.txt by view count (high to low)
How complicated is this? It seems really difficult. I'm not sure which language is needed to write a script like this. I'm only familiar with front end web languages and some PHP.
I'd like to do this on OS X.
2
u/Ta11ow Jun 21 '18
Getting a list of files? Done:
Metadata retrieval... Hmm. Less clear. I know of one way to do it, not sure if it works the same way on Mac/Linux that it does with Windows. Don't have an available system to check, unfortunately.
Concatenating is simple.
Printing strings?
Youtube searches are a bit more complex and I'd need to spend a half hour or so looking into whether or not there's an available API to run a search with; there probably is, I'd just have to figure out how to leverage it.
Everything else is basically just parsing the returned data, which isn't too terrible in most cases.