Problem with filename-filename conversion

I've got a problem with renaming files I downloaded with jdownloader. When I download files from YT with jdownloader it automatically adds the bitrate of the file to end of the filename.
A filename then looks like this:
Flexxa - Pirahna (256 kbit_s).mp3

But there are lots of remixes and bootlegs that have the original song artist and title at the beginning followed by the remixing artist in brackets.
The filename then looks like that:
Freedom Fry - Shaky Ground (Feast. Remix) (256 kbit_s).mp3
Ed Sheeran - Stay With Me (RUOBIN Edit) _ Sam Smith Cover (192 kbit_s).mp3
Ivan B - Make It Ourselves (ft. Hendersin) (Prod. Tido Vegas) (256 kbit_s).mp3

If I want to rename the file, with the settings:
old filename: %1 - %2 (%3)
new filename: %1 %2

,it works perfectly for the ones that don't have another bracket in them. But for those files that have another bracket of any kind in their name, it basically just deletes everything that stands on the right side of said bracket.

I tried changing the settings to :
old filename: %1 - %2 (%3) (%4)
new filename: %1 %2 (%3)

,but then the conversion doesn't work for the files that have more or less than 2 brackets in their name.
Is their a possibility of solving this this problem or does the program simply not support this kind of "unversal" name conversion.
I would need a way to tell the program that it should only delete the last bracket in the filename or something similyar to that.

Thanks for any answers and help !

Why do you mess around with the file names and do not import the data first to the tags and then write a new filename?
Anyway: we are talking about patterns here and the patterns are different in respect to the brackets.
So you have to apply a filter to get the one set and then the other.

%_filename% MATCHES "(.)" AND NOT %_filename% MATCHES "(.) (.)"
to get the single pair.
for the double pair you use
%_filename% MATCHES "(.
) (.*)"

But as I said: putting the data in a structured format in the tags first is definitely the better way.

For sure set Filter [F3] ...

Filter: "%_filename%" HAS "kbit_s"
... or ...
Filter: "%_filename%" MATCHES "(\d+ kbit_s)$"

... then apply Convert "Filename - Filename" with a useful pattern Or apply ... Action: Format value Field: _FILENAME Formatstring: $trimRight($left(%_filename%,$strrchr(%_filename%,'(')),' (') ... or ... Formatstring: $left(%_filename%,$sub($strrchr(%_filename%,'('),2)) ... or ... Formatstring: $regexp(%_filename%,' \(\d+ kbit_s\)$',)


Thanks for the help
Sorry for replying this late but I didn't get an email update that someone answered my post so I just recognised it.
I will try your methods out tomorrow, hopefully it works.


What do you mean by that ? Do you say I should make a filename-tag conversion first and then rename the file by tag-filename?

I appreciate every input

In a nutshell: yes.
Filenames are no good place to store data. There are limitations in respect to allowed characters, restrictions in repect to maximum name length and so on.
The better way is definitely to get the data into the tags and then generate new filenames from the bits and pieces of structured data in the fields.

Thank you guys very much !
Basically I deleted all the (xxx kbit/s) brackets from the filenames and wrote my tags with the normal %artist% - %title% routine.

By the way, do you guys know a good YT downloader that saves the files in .mp3 format and also saves the album cover links in the tags ?
that way I could avoid the filename+bitrate problem and also have the covers linked.

But thanks for the help guys !

MP3tag has web sources scripts to find tag data.

if you want to import the filename without certain pieces of data use the Convert>Filename-Tag function in such a way (example):
%artist% - %title% (%dummy% kbits)

this is so confusing
I just want to rename all my filesname to what they are now to
artist - title

can anyone one help.
thank you

Does that mean your tags artist and title are filled?
Then take the converter-menue "Tag- Filename":
Format String: %artist% - %title%

You can also get this with an action (the converter menue contains predefined actions with preview):
Type: Format Value
Format String: %artist% - %title%

didn't select REPLACE!!
Many Thanks

Could you tell us what you did to "replace".
ASFAIK "replace" does not work with variables (like %artist% and %title%) but only with string constants.