Coder Social home page Coder Social logo

fashni / mxlrc Goto Github PK

View Code? Open in Web Editor NEW
152.0 2.0 12.0 63 KB

Fetch synced lyrics from Musixmatch and save it as *.lrc file, written in Python. Go version https://github.com/fashni/MxLRC-Go

License: MIT License

Python 100.00%
lyrics-fetcher lyrics-search musixmatch synced-lyrics lrc-files lrc-maker python3

mxlrc's Introduction

MxLRC

Command line tool to fetch synced lyrics from Musixmatch and save it as *.lrc file.


Go version

I'm currently learning Go and I cannot think of a project to start with. So I decided to rewrite this script in Go.

Check it out here


Downloads

Standalone binary

Download from Release page

Python script

Required Python 3.6+

  • Clone/download this repo
  • Install dependancy with pip
pip install -r requirements.txt

Usage

usage: mxlrc.py [-h] -s SONG [SONG ...] [-o OUTDIR] [-t SLEEP] [-d DEPTH] [-u]
                [--bfs] [-q] [--token TOKEN]

Fetch synced lyrics (*.lrc file) from Musixmatch

optional arguments:
  -h, --help              show this help message and exit
  -s SONG [SONG ...], --song SONG [SONG ...]
                          song information in the format [ artist,title ], a
                          text file containing list of songs, or a directory
                          containing the song files
  -o OUTDIR, --out OUTDIR output directory to save the .lrc file(s), default:
                          lyrics
  -t SLEEP, --sleep SLEEP sleep time (seconds) in between request, default: 30
  -d DEPTH, --depth DEPTH (directory mode) maximum recursion depth, default: 100
  -u, --update            (directory mode) rewrite existing .lrc files inside the
                          output directory
  --bfs                   (directory mode) use breadth first search for scanning
                          directory
  -q, --quiet             suppress logging output
  --token TOKEN           musixmatch token

Example:

One song

mxlrc -s adele,hello

Multiple song and custom output directory

mxlrc -s adele,hello "the killers,mr. brightside" -o some_directory

With a text file and custom sleep time

mxlrc -s example_input.txt -t 20

Directory Mode (recursive)

mxlrc -s "Dream Theater"

This option overrides the -o/--outdir argument which means the lyrics will be saved in the same directory as the given input.

The -d/--depth argument limit the depth of subdirectory to scan. Use -d 0 or --depth 0 to only scan the specified directory.


How to get the Musixmatch Token

Follow steps 1 to 5 from the guide here to get a new Musixmatch token.

Credits

mxlrc's People

Contributors

thelastzombie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mxlrc's Issues

publish MxLRC on PyPI

I appreciate MxLRC a lot and the work being done here. There's just this one thing which i think would make using this more convenient, that is having it published as a package on PyPI. Much simpler than having to clone the repository itself, and also enables us to use it as a CLI as well as a python module.

I would love to contribute to MxLRC this way, just need a go from the repository owner. Cheers!

I wrote a batch file for easy use of MxLRC, so i'm asking you to implement it

I created a batch script that would ask you for the info (Song name, author, and file destination) because it is easier for newbies who don't know how to use the command line. It's in English but there's also a Portuguese version.
MusicCUI.zip
Important: It needs to have the MxLRC standalone .exe in the same folder, but that can be easily changed to another path by editing "%cd%\mxlrc.exe" to something else.

lyrics name bug when you use -s directory command

when using the command mxlrc.exe -s "C:\Users\user\Desktop\New folder (6)"
the lyrics are saved like this CUsersuserDesktopNew folder 6Adele - Hello.lrc
its happening in both version windows and python

Restricted lyrics

Can't download particular song lyrics
Error message is "restricted lyrics"
Is it restricted due to multiple languages in same song

Idea: Recursive directory search and fetch

When doing the command to fetch lrc from a directory containing music files, it only searches for music in the indicated folder and not into the folders inside.
Is it planned?

Saved lyrics name

When mxlrc downloads the lyrics for the list txt file that i gave it
It will save lyrics as their name in Musixmatch or where ever it found them which i want to save the lyrics as the names that i gave it in my list txt file (that makes music players recognize the lyrics and shall display them)

.

.

Woking?

I've been trying to download a subtitle from musixmash, but any song I put has the warning below. I know that today there is an api, I didn't get to check the source, but the system communication is through the api or through the website?
I've been trying in some ways the query, name, music, complete, link. I even got the token, but it doesn't seem to work, and the warning says it's a wrong input, could you tell me if the project still works?

image

lrc autonaming issue

love the project. I have a huge music library and organized with naming format "(track#). (Artist) - (Title)" for each song. Problem is that when the lrc file saves, it does a great job of copying the name, but not the punctuations, like for example (,.) I have to manually go back and add a period (.) after every track number or a comma (,) for a song that has one. Thanks

Don't parse mxm - just request lrc!

@fashni
This is a simple trick I discovered while writing a bash script to fetch synced lyrics. I was reverse engineering musixmatch's API and found the same URL you did (mxlrc.py / line 17). And, of course, I was not satisfied with the cryptic mxm lyrics format that it returned. But this is where our solutions diverge. You wrote a whole mxm parser, and I... Well, I just YOLO'd it and replaced subtitle_format=mxm with subtitle_format=lrc. And to my surprise it worked.

It's nice to have your parser, just in case musixmatch will decide to remove lrc support. But if your goal is to make a lyrics fetcher - just change the subtitle_format, and the code will become 10x smaller and simpler.

Crashing after a few recursive lookups

The command I'm running is:
mxlrc.exe --token 2307233d031af73b331a2206ba7e49b793c15c613a48d523e42653 -d 5 -t 60 -s "H:\AUDIO\FLAC\CD-res\ROCK\NEED_LYRICS"

And after a couple of songs finish, I get this error. If I re-run the command sometimes it will work, other times it might repeatedly spit the error out several times but then decide to start working again. It seems very random so I am unable to find a specific cause. It is sometimes able to traverse a few directories and work on several of my artist folders, other times it can barely make it past a few songs of a single album.

[+] Song found: Linkin Park - LIES GREED MISERY
[+] Searching lyrics: Linkin Park - LIES GREED MISERY
[+] Formatting lyrics
Lyrics saved: H:\AUDIO\FLAC\CD-res\ROCK\NEED_LYRICS\Linkin Park\2012. Living Things\D1T04 Lies Greed Misery.lrc
    Please wait... 0s

[+] Searching song: Linkin Park - I'll Be Gone
Traceback (most recent call last):
  File "C:\Users\AZOTHY~1\AppData\Local\Temp\ON441D~1\mxlrc.py", line 360, in <module>
  File "C:\Users\AZOTHY~1\AppData\Local\Temp\ON441D~1\mxlrc.py", line 299, in main
  File "C:\Users\AZOTHY~1\AppData\Local\Temp\ON441D~1\mxlrc.py", line 277, in get_lrc
  File "C:\Users\AZOTHY~1\AppData\Local\Temp\ON441D~1\mxlrc.py", line 52, in find_lyrics
KeyError: 'matcher.track.get'

No windows app anymore?

Hey so, firstly, thanks for making this. I can't download the musixmatch app on the windows store anymore so I'm not sure how I am supposed to get a token. Thanks in advanced.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.