cromize / beatport_tracktagger

Tag audio files with Beatport ID easily using fuzzy matching
MIT License
10 stars 4 forks source link

Parse or change order input #4

Open thibaud57 opened 3 years ago

thibaud57 commented 3 years ago

Hello following url on beatport appears nu-moon/10887306 So when I rename my file it name like this : 10887306nu-moon, so do you think there is a way to use the script with this input and not 10887306_nu-moon. I tried to find where I can change this order or parse, but I don't know exactly where, could you help me please.

cromize commented 3 years ago

Regex for beatport id is defined here https://github.com/cromize/beatport_tracktagger/blob/c51451e0339d3be8f4a89deb0567f2e45278a89c/core.py#L16

I added input argument for specifying the regex format. For now it's "--beatport-id-regex".

If you have any other suggestions, feel free to create new issues or PRs. Also star/share if this tool provides you any value.

cromize commented 3 years ago

On second thought, I changed the default beatport id regex to "^[0-9]+". It will work fine for the original beatport naming and your case too.

thibaud57 commented 3 years ago

Hello thanks for your very quick fix. But i'm sorry I did a mistake, it appaers border-country12775735 and not the oppisite as i mentioned, I'm sorry.

thibaud57 commented 3 years ago

I mean do you think it's possible to user ./tracktagger.py -tsari some/path on a folder with content like this : border-country12775735 ; human-reason1928330

cromize commented 3 years ago

Then you can set --beatport-id-regex "[0-9]+$". That regex matches for number at the end of string.

If you have different naming, you need to create regex that matches for the number part only.

thibaud57 commented 3 years ago

So you want me to use the command ./tracktagger.py --beatport-id-regex "[0-9]+$" whithout the other ones ? And I should write the id ? But where I specify the folder? Can you give me an exemple please.

cromize commented 3 years ago

Note that it currently takes beatport id from file name, not from track name. I guess you don't want to have ids in track names, but it can be done.

cromize commented 3 years ago

Run it like this ./tracktagger.py -tsar -i mymusicfolder --beatport-id-regex "[0-9]+$"

thibaud57 commented 3 years ago

What I mean it's I have a lot of track to replace but they are name like conventional Artist - Title (Original Mix). I want to replace every names with the following human-reason1928330 becasuse when you look the url it s name like this https://www.beatport.com/track/la-playita-feat-toto-la-momposina/14702118 So to be quick I can rename track with : la-playita-feat-toto-la-momposina14702118

And then I want to use your command that works very well on this.

I will try thanks

thibaud57 commented 3 years ago

I tried python.exe ./tracktagger.py -tsar -i C:\Users...\test --beatport-id-regex "[0-9]+$" but didn't find any files. Neither 12775735border-country or border-country12775735

cromize commented 3 years ago

Is the beatport id in the filename? (e.g. border-country12775735.mp3) It currently looks for beatport id in the filename.

I'm going to add more examples to readme, so it's more clear.

thibaud57 commented 3 years ago

Yes https://www.beatport.com/track/border-country/12775735 and yes border-country12775735.mp3

thibaud57 commented 3 years ago

Have you tried ?

I want to ask another thing, then this will work, do you allow me to use your script ? Because I want to build a web application with front end, and firebase function to execute your python script. And probably replace the local db you use with firebase database and put id of user to create different db, then clean them everytime the user want to use it.

cromize commented 3 years ago

Get latest commit and try this --beatport-id-regex "[0-9]*[A-Za-z_]([0-9]+)*\.(?:mp3|flac)". I forgot about the mp3 file extension in regex.

If you want, you can build that frontend. beatport_tracktagger is using the MIT license. Just please comply with the LICENSE, and include it with notion that you use this software.

I intended to write that frontend, but no one expressed the need for it yet. My plan was writing it as local one, instead of hosted as you plan. Reason for that is you can't easily edit local files from web service.

thibaud57 commented 3 years ago

Thanks king it works very fine now ! Yes I guess it must be a bit complicated, the front end interface is ok but I have to think how to adapt your script with local db.

Last year I used a scrapping script and execute it with Firebase function, then I put what I get inside the nosql database. I used Ionic for hybrid mobile application as frontend.

thibaud57 commented 3 years ago

I did connexion fire firestore db, I will check to execute the script now.

thibaud57 commented 3 years ago

I've noticed one bug, when the trakc end with a number. Look https://www.beatport.com/track/downtown-world-part-3/800296 if i use regex method it doesn't work. I have to cut 3_8

cromize commented 3 years ago

Glad it works for you. Hit that star button, if you enjoy this tool.

You can use this regex --beatport-id-regex "[0-9]*[A-Za-z_\/]([0-9]+)*\.(?:mp3|flac)", if you use slash as separator for id.

As for your frontend, if you have any suggestion for change, feel free to submit a new issue or PR.

thibaud57 commented 3 years ago

Thanks i will come back to you when i'm done with the front end. Probably next week when I will get more time.

So about ideas suggestion, maybe the same thing with Bandcamp or Discogs, because not all the music is on Beatport. Idependant with Bandcamp and classic on Discogs.

thibaud57 commented 3 years ago

Hello look this one is invalid : https://www.beatport.com/track/kao-staklo-deepbass-remix/9744498 it says invalid id