Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse or change order input #4

Open
thibaud57 opened this issue Feb 25, 2021 · 20 comments
Open

Parse or change order input #4

thibaud57 opened this issue Feb 25, 2021 · 20 comments

Comments

@thibaud57
Copy link

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
Copy link
Owner

cromize commented Feb 25, 2021

Regex for beatport id is defined here

beatport_id_pattern = re.compile('^[0-9]+')

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
Copy link
Owner

cromize commented Feb 25, 2021

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

cromize commented Feb 25, 2021

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
Copy link
Author

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
Copy link
Owner

cromize commented Feb 25, 2021

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
Copy link
Owner

cromize commented Feb 25, 2021

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

@thibaud57
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

cromize commented Feb 25, 2021

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
Copy link
Author

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

@thibaud57
Copy link
Author

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
Copy link
Owner

cromize commented Feb 25, 2021

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
Copy link
Author

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
Copy link
Author

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

@thibaud57
Copy link
Author

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
Copy link
Owner

cromize commented Feb 27, 2021

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
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants