Merge pull request #31 from forsenonlhaimaisentito/fixes-1
Minor fixes, especially the odd default basedir behaviourmaster
commit
6a0ba44862
|
@ -40,7 +40,7 @@ it or use it how ever you like.
|
|||
[default: %{artist}/%{album}/%{track} - %{title}]
|
||||
--base-dir=<dir> Base location of which all files are downloaded
|
||||
|
||||
# Fiename Template
|
||||
# Filename Template
|
||||
|
||||
The `--template` option allows users to indicate a template for the output file
|
||||
names and directories. Templates can be built using special tokens with the
|
||||
|
|
|
@ -15,7 +15,7 @@ class Bandcamp:
|
|||
if r.status_code is not 200:
|
||||
return None
|
||||
|
||||
self.soup = BeautifulSoup(r.text)
|
||||
self.soup = BeautifulSoup(r.text, "lxml")
|
||||
album = {
|
||||
"tracks": [],
|
||||
"title": "",
|
||||
|
|
|
@ -29,7 +29,7 @@ class BandcampDownloader():
|
|||
path = self.template
|
||||
path = path.replace("%{artist}", slugify(track['artist']))
|
||||
path = path.replace("%{album}", slugify(track['album']))
|
||||
path = path.replace("%{track}", track['track'])
|
||||
path = path.replace("%{track}", str(track['track']).zfill(2))
|
||||
path = path.replace("%{title}", slugify(track['title']))
|
||||
path = u"{0}/{1}.{2}".format(self.directory, path, "mp3")
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ if __name__ == '__main__':
|
|||
url = arguments['<url>']
|
||||
|
||||
album = bandcamp.parse(url)
|
||||
basedir = arguments['--base-dir'] or os.path.dirname(os.path.realpath(__file__))
|
||||
basedir = arguments['--base-dir'] or os.getcwd()
|
||||
|
||||
if not album:
|
||||
print "The url {} is not a valid bandcamp page.".format(url)
|
||||
|
|
Loading…
Reference in New Issue