[GH-ISSUE #441] [Feature Request] A way to auto convert the flacs files to mp3 when ... #1682

Closed
opened 2026-03-13 19:09:37 +03:00 by kerem · 6 comments
Owner

Originally created by @Tedeum8 on GitHub (Feb 2, 2026).
Original GitHub issue: https://github.com/afkarxyz/SpotiFLAC/issues/441

[Feature Request]

Description

A way to auto convert the flacs files to mp3 when downloading, or simply a mp3 download option.

Use Case

The problem with the conversion files is that you can't convert a large number of an artist's discography all at once. Thus converting whole playlist woth of song takes a lot of time.

Additional Context

Originally created by @Tedeum8 on GitHub (Feb 2, 2026). Original GitHub issue: https://github.com/afkarxyz/SpotiFLAC/issues/441 ### [Feature Request] #### Description A way to auto convert the flacs files to mp3 when downloading, or simply a mp3 download option. #### Use Case The problem with the conversion files is that you can't convert a large number of an artist's discography all at once. Thus converting whole playlist woth of song takes a lot of time. #### Additional Context
kerem closed this issue 2026-03-13 19:09:43 +03:00
Author
Owner

@ogpac69 commented on GitHub (Feb 3, 2026):

Use spotidownloader or Spotubedl instead.
https://github.com/afkarxyz/SpotiDownloader
https://spotubedl.com/

<!-- gh-comment-id:3839929837 --> @ogpac69 commented on GitHub (Feb 3, 2026): Use spotidownloader or Spotubedl instead. https://github.com/afkarxyz/SpotiDownloader https://spotubedl.com/
Author
Owner

@mahoganyprogrammer commented on GitHub (Feb 4, 2026):

ffmpeg perfectly converts to mp3 with art and metadata. just find simple batch script or ask gemini ai

<!-- gh-comment-id:3847431561 --> @mahoganyprogrammer commented on GitHub (Feb 4, 2026): ffmpeg perfectly converts to mp3 with art and metadata. just find simple batch script or ask gemini ai
Author
Owner

@legaldeejay commented on GitHub (Feb 4, 2026):

I can provide you with a powershell script which I developed using AI which will watch a folder and its subdirectories and automatically convert flac files to mp3 at 320 kbps, and will delete the flac files. Let me know if you want it.

<!-- gh-comment-id:3847476982 --> @legaldeejay commented on GitHub (Feb 4, 2026): I can provide you with a powershell script which I developed using AI which will watch a folder and its subdirectories and automatically convert flac files to mp3 at 320 kbps, and will delete the flac files. Let me know if you want it.
Author
Owner

@Tedeum8 commented on GitHub (Feb 4, 2026):

I can provide you with a powershell script which I developed using AI which will watch a folder and its subdirectories and automatically convert flac files to mp3 at 320 kbps, and will delete the flac files. Let me know if you want it.

Sure, that would be greatly appreciated. Thank you!

<!-- gh-comment-id:3848163178 --> @Tedeum8 commented on GitHub (Feb 4, 2026): > I can provide you with a powershell script which I developed using AI which will watch a folder and its subdirectories and automatically convert flac files to mp3 at 320 kbps, and will delete the flac files. Let me know if you want it. Sure, that would be greatly appreciated. Thank you!
Author
Owner

@legaldeejay commented on GitHub (Feb 5, 2026):

OK, so the first thing you need to do is make sure you can use Powershell scripts on your machine. This assumes you have Windows 11.

Open Powershell (Run as Administrator) and run this command:

Get-ExecutionPolicy

If it says RemoteSigned, you are good. If it says, Restricted, then run this command:

Set-ExecutionPolicy RemoteSigned

To then create the script, open Notepad, cut and paste the below, and save to whatever name you want with a .ps1 extension. In the below script make sure to change C:\Mp3 Files\DOWNLOADS to the file path you want to watch for .flac files and where the .mp3 files should be saved. Here, I am using the same path where I want the .mp3 files to be saved. Any variations you may want from this script, just ask AI. It is pretty amazing how AI is able to create these scripts. I had to do a few edits to get this to work the way I want, including watching newly created subfolders and making sure downloads are complete before each file is converted. Hope this works for you too!

$folderToWatch = "C:\Mp3 Files\DOWNLOADS" # Change this path
$filter = "*.flac"

$watcher = New-Object IO.FileSystemWatcher
$watcher.Path = $folderToWatch
$watcher.Filter = $filter
$watcher.IncludeSubdirectories = $true
$watcher.EnableRaisingEvents = $true

Write-Host "Monitoring $folderToWatch for new FLAC files..." -ForegroundColor Cyan

$action = {
$path = $Event.SourceEventArgs.FullPath
$outputPath = [System.IO.Path]::ChangeExtension($path, ".mp3")

Write-Host "New file detected: $path" -ForegroundColor Green
$lastSize = -1
while ($true) {
    $currentSize = (Get-Item $path).Length
    if ($currentSize -eq $lastSize -and $currentSize -gt 0) { break }
    $lastSize = $currentSize
    Start-Sleep -Seconds 5  # Check every 5 seconds
}

# Run FFmpeg conversion
Start-Process C:\FFmpeg\bin\ffmpeg.exe -ArgumentList "-i `"$path`" -ab 320k -map_metadata 0 -id3v2_version 3 `"$outputPath`"" -Wait -NoNewWindow

# Delete original FLAC only if conversion succeeded
if (Test-Path $outputPath) {
    Write-Host "Conversion complete. Deleting original: $path" -ForegroundColor Yellow
    # Load VisualBasic assembly to access Recycle Bin method
    Add-Type -AssemblyName Microsoft.VisualBasic
    
    # Move original FLAC to Recycle Bin (suppresses confirm dialog, keeps error dialog)
    [Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile($path, 'OnlyErrorDialogs', 'SendToRecycleBin')
}

}

Register the event for newly created files

Register-ObjectEvent $watcher "Created" -Action $action

Keep the script running

while ($true) { Start-Sleep 5 }

<!-- gh-comment-id:3850926143 --> @legaldeejay commented on GitHub (Feb 5, 2026): OK, so the first thing you need to do is make sure you can use Powershell scripts on your machine. This assumes you have Windows 11. Open Powershell (Run as Administrator) and run this command: Get-ExecutionPolicy If it says RemoteSigned, you are good. If it says, Restricted, then run this command: Set-ExecutionPolicy RemoteSigned To then create the script, open Notepad, cut and paste the below, and save to whatever name you want with a .ps1 extension. In the below script make sure to change C:\Mp3 Files\DOWNLOADS to the file path you want to watch for .flac files and where the .mp3 files should be saved. Here, I am using the same path where I want the .mp3 files to be saved. Any variations you may want from this script, just ask AI. It is pretty amazing how AI is able to create these scripts. I had to do a few edits to get this to work the way I want, including watching newly created subfolders and making sure downloads are complete before each file is converted. Hope this works for you too! $folderToWatch = "C:\Mp3 Files\DOWNLOADS" # Change this path $filter = "*.flac" $watcher = New-Object IO.FileSystemWatcher $watcher.Path = $folderToWatch $watcher.Filter = $filter $watcher.IncludeSubdirectories = $true $watcher.EnableRaisingEvents = $true Write-Host "Monitoring $folderToWatch for new FLAC files..." -ForegroundColor Cyan $action = { $path = $Event.SourceEventArgs.FullPath $outputPath = [System.IO.Path]::ChangeExtension($path, ".mp3") Write-Host "New file detected: $path" -ForegroundColor Green $lastSize = -1 while ($true) { $currentSize = (Get-Item $path).Length if ($currentSize -eq $lastSize -and $currentSize -gt 0) { break } $lastSize = $currentSize Start-Sleep -Seconds 5 # Check every 5 seconds } # Run FFmpeg conversion Start-Process C:\FFmpeg\bin\ffmpeg.exe -ArgumentList "-i `"$path`" -ab 320k -map_metadata 0 -id3v2_version 3 `"$outputPath`"" -Wait -NoNewWindow # Delete original FLAC only if conversion succeeded if (Test-Path $outputPath) { Write-Host "Conversion complete. Deleting original: $path" -ForegroundColor Yellow # Load VisualBasic assembly to access Recycle Bin method Add-Type -AssemblyName Microsoft.VisualBasic # Move original FLAC to Recycle Bin (suppresses confirm dialog, keeps error dialog) [Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile($path, 'OnlyErrorDialogs', 'SendToRecycleBin') } } # Register the event for newly created files Register-ObjectEvent $watcher "Created" -Action $action # Keep the script running while ($true) { Start-Sleep 5 }
Author
Owner

@Tedeum8 commented on GitHub (Feb 6, 2026):

Yea it worked, thanks a lot!!

<!-- gh-comment-id:3857656889 --> @Tedeum8 commented on GitHub (Feb 6, 2026): Yea it worked, thanks a lot!!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SpotiFLAC#1682
No description provided.