mirror of
https://github.com/rwinkhart/flac2pod.git
synced 2026-09-05 16:47:15 -04:00
Remove MP3 support
This commit is contained in:
@@ -48,11 +48,6 @@ def scan_destination_convert():
|
|||||||
Path(f"{_file.replace(path.expanduser(source), path.expanduser(destination))}.m4a").is_file():
|
Path(f"{_file.replace(path.expanduser(source), path.expanduser(destination))}.m4a").is_file():
|
||||||
_file_s = _file.replace(' ', '\\ ').replace("'", "\\'").replace(')', '\\)').replace('(', '\\(')\
|
_file_s = _file.replace(' ', '\\ ').replace("'", "\\'").replace(')', '\\)').replace('(', '\\(')\
|
||||||
.replace('&', '\\&').replace('`', '\\`').replace('$', '\\$') + '.flac'
|
.replace('&', '\\&').replace('`', '\\`').replace('$', '\\$') + '.flac'
|
||||||
if args.mp3:
|
|
||||||
_file_d = _file.replace(path.expanduser(source), path.expanduser(destination)).replace(' ', '\\ ') \
|
|
||||||
.replace("'", "\\'").replace(')', '\\)').replace('(', '\\(').replace('&', '\\&') \
|
|
||||||
.replace('`', '\\`').replace('$', '\\$') + '.mp3'
|
|
||||||
else:
|
|
||||||
_file_d = _file.replace(path.expanduser(source), path.expanduser(destination)).replace(' ', '\\ ')\
|
_file_d = _file.replace(path.expanduser(source), path.expanduser(destination)).replace(' ', '\\ ')\
|
||||||
.replace("'", "\\'").replace(')', '\\)').replace('(', '\\(').replace('&', '\\&')\
|
.replace("'", "\\'").replace(')', '\\)').replace('(', '\\(').replace('&', '\\&')\
|
||||||
.replace('`', '\\`').replace('$', '\\$') + '.m4a'
|
.replace('`', '\\`').replace('$', '\\$') + '.m4a'
|
||||||
@@ -64,14 +59,6 @@ def scan_destination_convert():
|
|||||||
_active_processes = int(check_output('ps -C ffmpeg | wc -l', shell=True)) - 1
|
_active_processes = int(check_output('ps -C ffmpeg | wc -l', shell=True)) - 1
|
||||||
_i += 1
|
_i += 1
|
||||||
print(f"\n{_progress}% | \u001b[38;5;0;48;5;15mConverting {_file_s} to {_file_d}...\u001b[0m\n")
|
print(f"\n{_progress}% | \u001b[38;5;0;48;5;15mConverting {_file_s} to {_file_d}...\u001b[0m\n")
|
||||||
if args.mp3:
|
|
||||||
if args.strip:
|
|
||||||
_cmd = f"screen -DmS flac2pod{_i} ffmpeg -i {_file_s} -map 0:a -ab 320k -map_metadata 0" \
|
|
||||||
f" -id3v2_version 3 {_file_d} </dev/null; rg2sc -f -s {_file_d}"
|
|
||||||
else:
|
|
||||||
_cmd = f"screen -DmS flac2pod{_i} ffmpeg -i {_file_s} -c:v copy -ab 320k -map_metadata 0" \
|
|
||||||
f" -id3v2_version 3 {_file_d} </dev/null; rg2sc -f {_file_d}"
|
|
||||||
else:
|
|
||||||
# get relevant ReplayGain info
|
# get relevant ReplayGain info
|
||||||
_audio = FLAC(f"{_file}.flac")
|
_audio = FLAC(f"{_file}.flac")
|
||||||
if _audio.get('replaygain_track_gain'):
|
if _audio.get('replaygain_track_gain'):
|
||||||
@@ -130,9 +117,6 @@ if __name__ == "__main__":
|
|||||||
help='strip all TXXX, APIC, and covr tags from the output files')
|
help='strip all TXXX, APIC, and covr tags from the output files')
|
||||||
parser.add_argument('-b', '--bake', action='store_true',
|
parser.add_argument('-b', '--bake', action='store_true',
|
||||||
help='bake (encode) ReplayGain values into the file instead of using SoundCheck tags')
|
help='bake (encode) ReplayGain values into the file instead of using SoundCheck tags')
|
||||||
parser.add_argument('--mp3', action='store_true',
|
|
||||||
help='convert to MP3, as opposed to the default of AAC .M4A')
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.source_dir[0].endswith('/'):
|
if args.source_dir[0].endswith('/'):
|
||||||
|
|||||||
Reference in New Issue
Block a user