collab/PineapplePad
git clone https://git.julia.blue/collab/PineapplePad
9e3c12a
master
1import sys 2import os 3 4if len (sys .argv )< 2 : 5"This script takes a file with a list of audio files and youtube video ID's, as well as titles, see exampleSounds.txt" 6sys .exit () 7 8f = open (sys .argv [1 ]) 9for line in f : 10if line == '' : 11continue 12song = line .split (':' ) 13inputFile = song [0 ].strip () 14outputFile = song [1 ].strip () 15if '.' not in inputFile : 16os .system ("youtube-dl " + inputFile + 17" -q -o \"yt-temp.%(ext)s\" -x --audio-format wav" ) 18inputFile = "yt-temp.wav" 19"Converting" ,outputFile ,"to raw low quality audio... " , 20os .system ( 21"sox " + 22inputFile + 23" -r 8000 -b 8 -c 1 -e unsigned-integer " + 24outputFile + 25".wav vol $(sox " + 26inputFile + 27" -n stat -v 2>&1)" ) 28"Finished" 29 30os .system ("rm yt-temp.wav" )