Update code to take into consideration files that may not have HTTP, additionally, update gitignore.
parent
c12a8a35dc
commit
54a6524cc3
|
@ -19,6 +19,7 @@ lib
|
||||||
lib64
|
lib64
|
||||||
files/
|
files/
|
||||||
*.mp3
|
*.mp3
|
||||||
|
**/*.mp3
|
||||||
|
|
||||||
# Installer logs
|
# Installer logs
|
||||||
pip-log.txt
|
pip-log.txt
|
||||||
|
|
|
@ -23,6 +23,7 @@ class BandcampDownloader():
|
||||||
self.overwrite = overwrite
|
self.overwrite = overwrite
|
||||||
|
|
||||||
def start(self, album):
|
def start(self, album):
|
||||||
|
print "Starting download process."
|
||||||
self.download_album(album)
|
self.download_album(album)
|
||||||
|
|
||||||
def template_to_path(self, track):
|
def template_to_path(self, track):
|
||||||
|
@ -65,7 +66,11 @@ class BandcampDownloader():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tmp_file = wgetter.download(track['url'], outdir=dirname)
|
track_url = track['url']
|
||||||
|
# Check and see if HTTP is in the track_url
|
||||||
|
if 'http' not in track_url:
|
||||||
|
track_url = 'http:%s' % track_url
|
||||||
|
tmp_file = wgetter.download(track_url, outdir=dirname)
|
||||||
os.rename(tmp_file, filename)
|
os.rename(tmp_file, filename)
|
||||||
self.write_id3_tags(filename, track_meta)
|
self.write_id3_tags(filename, track_meta)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in New Issue