albumcutter

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 67bc285da5e987d723ab0eb9cac7589f21c54bcc
parent 92ece2d65d95880986d481d296360a6ba6a0e602
Author: Paul Longtine <paullongtine@gmail.com>
Date:   Thu Nov  5 08:22:22 2015

small edits, added setup script

Diffstat:
 setup.sh           |  6 ++++++
 src/albumcutter.py | 12 ++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/setup.sh b/setup.sh @@ -0,0 +1,6 @@ +#!/bin/sh +#Can we say yay to hacky setup scripts?! + +cp -r bin/ /usr/local/ + +cp -r src/albumcutter.py /usr/lib/python2.7/dist-packages/ diff --git a/src/albumcutter.py b/src/albumcutter.py @@ -38,7 +38,7 @@ class AlbumCutter: print("ERROR: Could not make directory ({})".format(output)) return - assert self.get_audio(self.url) + assert(self.get_audio(self.url)) self.process_tracklist(self.tracklist) self.export(self.output) @@ -48,7 +48,7 @@ class AlbumCutter: # youtube-dl -q -x -o$(output)/$(VIDEO ID).$(EXTENSION) if not call(['youtube-dl', '-q', '-x', '-o{}/%(id)s.%(ext)s'.format(self.output), url]): - return False + return(False) # This second call here finds the filename for the audio just downloaded # It's not elegant at all, and it was the best solution I could find. @@ -62,7 +62,7 @@ class AlbumCutter: if err != '': print(err) - return False + return(False) # Loads file into the fancy manipulator thingmajig I found on the web print("Trying to load file ({})".format(output)) @@ -113,13 +113,13 @@ class AlbumCutter: try: second = int(second) except: - return None + return(None) # ms in hour ms in minute ms in second - return (hour * 3600000) + (minute * 60000) + (second * 1000) + return((hour * 3600000) + (minute * 60000) + (second * 1000)) # Exports tracks into specified directory def export( self, directory ): - assert self.tracks != None + assert(self.tracks != None) # Loop through tracks and process them for track in self.tracks: print("Processing track: '{}'".format(track['title']))