mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2026-02-13 12:59:45 +00:00
Merge pull request #475 from ritiek/fix-m4a-when-encoder-not-found
Fix renaming files when encoder is not found
This commit is contained in:
@@ -5,10 +5,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|||||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Option `-f` (`--folder`) is used when exporting text files using `-p` (`--playlist`) for playlists or `-b` (`--album`) for albums ([@Silverfeelin](https://github.com/Silverfeelin)) (#476)
|
- Option `-f` (`--folder`) is used when exporting text files using `-p` (`--playlist`) for playlists or `-b` (`--album`) for albums ([@Silverfeelin](https://github.com/Silverfeelin)) (#476)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fix renaming files when encoder is not found ([@ritiek](https://github.com/ritiek)) (#475)
|
||||||
|
|
||||||
## [1.1.1] - 2019-01-03
|
## [1.1.1] - 2019-01-03
|
||||||
### Added
|
### Added
|
||||||
- Output informative message in case of no result found in YouTube search ([@Amit-L](https://github.com/Amit-L)) (#452)
|
- Output informative message in case of no result found in YouTube search ([@Amit-L](https://github.com/Amit-L)) (#452)
|
||||||
|
|||||||
@@ -83,7 +83,12 @@ class Converter:
|
|||||||
os.rename(self.output_file, self.input_file)
|
os.rename(self.output_file, self.input_file)
|
||||||
|
|
||||||
log.debug(command)
|
log.debug(command)
|
||||||
code = subprocess.call(command)
|
try:
|
||||||
|
code = subprocess.call(command)
|
||||||
|
except FileNotFoundError:
|
||||||
|
if self.rename_to_temp:
|
||||||
|
os.rename(self.input_file, self.output_file)
|
||||||
|
raise
|
||||||
|
|
||||||
if self.delete_original:
|
if self.delete_original:
|
||||||
log.debug('Removing original file: "{}"'.format(self.input_file))
|
log.debug('Removing original file: "{}"'.format(self.input_file))
|
||||||
@@ -134,7 +139,12 @@ class Converter:
|
|||||||
os.rename(self.output_file, self.input_file)
|
os.rename(self.output_file, self.input_file)
|
||||||
|
|
||||||
log.debug(command)
|
log.debug(command)
|
||||||
code = subprocess.call(command)
|
try:
|
||||||
|
code = subprocess.call(command)
|
||||||
|
except FileNotFoundError:
|
||||||
|
if self.rename_to_temp:
|
||||||
|
os.rename(self.input_file, self.output_file)
|
||||||
|
raise
|
||||||
|
|
||||||
if self.delete_original:
|
if self.delete_original:
|
||||||
log.debug('Removing original file: "{}"'.format(self.input_file))
|
log.debug('Removing original file: "{}"'.format(self.input_file))
|
||||||
|
|||||||
@@ -131,6 +131,8 @@ class Downloader:
|
|||||||
trim_silence=const.args.trim_silence,
|
trim_silence=const.args.trim_silence,
|
||||||
)
|
)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
encoder = "avconv" if const.args.avconv else "ffmpeg"
|
||||||
|
log.warning("Could not find {0}, skip encoding".format(encoder))
|
||||||
output_song = self.unconverted_filename(songname)
|
output_song = self.unconverted_filename(songname)
|
||||||
|
|
||||||
if not const.args.no_metadata and self.meta_tags is not None:
|
if not const.args.no_metadata and self.meta_tags is not None:
|
||||||
@@ -169,8 +171,6 @@ class Downloader:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def unconverted_filename(songname):
|
def unconverted_filename(songname):
|
||||||
encoder = "avconv" if const.args.avconv else "ffmpeg"
|
|
||||||
log.warning("Could not find {0}, skipping conversion".format(encoder))
|
|
||||||
const.args.output_ext = const.args.input_ext
|
const.args.output_ext = const.args.input_ext
|
||||||
output_song = songname + const.args.output_ext
|
output_song = songname + const.args.output_ext
|
||||||
return output_song
|
return output_song
|
||||||
|
|||||||
Reference in New Issue
Block a user