doakey3 / pylrc Goto Github PK
View Code? Open in Web Editor NEWA python library for parsing and converting .lrc files
License: MIT License
A python library for parsing and converting .lrc files
License: MIT License
import re
synced_line_regex = re.compile(r'^(\[[0-5]\d:[0-5]\d(\.\d\d)?\])+.*', flags=re.MULTILINE)
synced_line_regex.findall('[00:06.466]') // []
My last PR #8 fixed an annoying bug for me. It would be kind if you release this lib with this PR.
Thanks
So I have a feature idea where we can give 2 timestamps and it would return the lyrics between the given two timestamps.
I have this requirement and would be willing to implement it.
Currently when passing in a negative offset (for example -1100), the timestamps will have negative values. When going from .lrc
to .srt
like this, the timestamps in the .srt
start overlapping.
I got this lrc and wanna parse it with pylrc.parse()
. I get this error: ValueError: time data '2000' does not match format '[%M:%S.%f]'
[id: cy_ooazhasi]
[offset:2000]
[ar:Martin Solveig]
[ti:Hello (single version)]
[00:03.35][00:18.26][00:20.01][00:23.63][00:28.03][01:17.40][01:22.52][01:25.52][01:31.15][02:02.75][02:05.80][02:09.42][03:24.78][03:30.71][03:34.07][03:37.69][04:18.63][04:32.36]
[00:15.39][00:19.14][00:22.63][00:26.03][02:43.23][02:46.78][02:50.40][02:54.27][02:58.08][03:01.76][03:05.50][03:09.31][03:13.12][03:16.80][03:20.54]Hey
[00:46.11][02:23.72]I could stick around and get along with you,
[00:49.35][00:56.90][01:27.64][01:35.27][01:42.69][02:26.78][02:35.30][03:36.70][03:44.25][03:51.73]hello.
[00:53.59]It doesn't really mean that i'm into you,
[01:01.68][02:39.61][02:43.73][02:47.22][02:50.84][02:54.65][02:58.45][03:02.20][03:05.94][03:09.68][03:13.43][03:17.17]You're alright but I'm here, darling, to enjoy the party.
[01:04.83]Don't get too excited 'cause thats all you get from me,
[01:08.13][01:53.92][02:08.61][04:03.03][04:26.12]hey.
[01:08.88]Yeah I think you're cute,
[01:10.32]but I really think that you should know.
[01:14.53][01:59.66][03:22.28][04:08.89]I just came to say hello,
[01:20.02][01:24.02][03:28.02][03:32.95]hello,
[01:32.08][03:41.06]I'm not the kinda girl to get messed up with you,
[01:39.38][03:48.43]I'ma let you try to convince me to,
[01:47.00]It's alright I'm getting dizzy just enjoy the party.
[01:50.68][03:59.85]It's OK with me if you dont have that much to say,
[01:54.55][04:03.59]Kinda like this game but there's something you should know.
[02:04.99]hey,
[02:31.99]It doesn't really mean that I'm into you,
[03:55.98]It's alright, I'm getting dizzy, just enjoy the party.
The problem is the offset. It doesn't match the other time format.
I tried to follow your "Usage" example but when I do subs.shift(milliseconds=-1100)
I get the attribute error that Lyrics doesn't have the attribute shift.
Am I doing something wrong? Or if it got removed, could it be readded?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.