Skip to content

Commit

Permalink
fix: Fixed audio formatting when downloading in Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
imf4ll committed Jul 26, 2023
1 parent 70fc1b9 commit fbdba6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions desktop/backend/services/downloadServiceLinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (

func DownloadService(url string, path string) (bool, error) {
command := strings.Split (
fmt.Sprintf(`yt-dlp -x --audio-format mp3 -f 140 -o %%(title)s[.]%%(uploader)s.%%(ext)s --write-thumbnail -o thumbnail:%%(title)s[.]%%(uploader)s.%%(ext)s %s`, url),
fmt.Sprintf(`yt-dlp -x --audio-format mp3 --audio-quality 128K -o %%(title)s[.]%%(uploader)s.%%(ext)s --write-thumbnail -o thumbnail:%%(title)s[.]%%(uploader)s.%%(ext)s %s`, url),
" ",
);

if strings.Contains(url, "watch?v=") {
command = strings.Split (
fmt.Sprintf(`yt-dlp -x --audio-format mp3 -f 140 -o %%(title)s[.]%%(uploader)s[.]%%(id)s.%%(ext)s --write-thumbnail -o thumbnail:%%(title)s[.]%%(uploader)s[.]%%(id)s.%%(ext)s %s`, url),
fmt.Sprintf(`yt-dlp -x --audio-format mp3 --audio-quality 128K -o %%(title)s[.]%%(uploader)s[.]%%(id)s.%%(ext)s --write-thumbnail -o thumbnail:%%(title)s[.]%%(uploader)s[.]%%(id)s.%%(ext)s %s`, url),
" ",
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ export const Settings = ({ setSettingsModalOpened }: {
if (window.localStorage.getItem('searchhistory') !== null) {
window.localStorage.setItem('searchhistory', '[]');

window.location.reload();

notificate('success', 'Search history cleared.');
}
}
Expand Down

0 comments on commit fbdba6b

Please sign in to comment.