Title

酷狗音乐歌词格式化代码lyrics

请求到的歌词数据:

lyrics: "[id:$00000000]\r\n[ar:Bomb比尔]\r\n[ti:0222心动-比尔的歌]\r\n[by:]\r\n[hash:5ecfecaa3768c12a0d0bc2f6bd49d67b]\r\n[al:]\r\n[sign:]\r\n[qq:]\r\n[total:185000]\r\n[offset:0]\r\n[00:01.67]Bomb比尔 - 0222心动-比尔的歌\r\n[00:03.28]作词:弥生\r\n[00:03.98]作曲:Bomb比尔\r\n[00:04.18]编曲:珑喆\r\n[00:04.28]吉他 :珑喆\r\n[00:04.44]bass: 珑喆\r\n[00:04.54]录音:ID Music@王威\r\n[00:04.74]混音:张新龙@MixStory.Studio\r\n[00:04.94]母带:张新龙@MixStory.Studio\r\n[00:05.14]制作统筹:李梦思\r\n[00:05.39]制作人:Bomb比尔 时金宇 刘向\r\n[00:05.74]音乐总监:时金宇\r\n[00:05.99]艺人统筹:宝玉\r\n[00:06.19]监制:安明婵\r\n[00:06.34]营销推广:涂涂\r\n[00:13.42]晚风带着你的笑 懵懵懂懂\r\n[00:16.32]有万分之一的心动\r\n[00:18.04]在你的瞳孔\r\n[00:19.44]浪边有金色的情书\r\n[00:21.04]却不忍读透\r\n[00:22.49]我笑你怎么比\r\n[00:23.55]落叶落下还要匆匆\r\n[00:25.82]昨晚迷宫走失的星光\r\n[00:28.52]错认就成了你的眼眸\r\n[00:31.77]单车驶向落日的缺口\r\n[00:33.42]一如少年眉眼的温柔\r\n[00:34.83]我把迂回的心事\r\n[00:36.04]全部藏在散落的风中\r\n[00:40.03]忘了哪张书页\r\n[00:42.73]被泪水全部都浸透\r\n[00:45.98]从未曾开口的想念\r\n[00:48.88]比人潮还要汹涌\r\n[00:52.38]画面还在拼凑\r\n[00:55.04]总想起偷偷牵你手\r\n[00:58.34]我太多笨拙的借口\r\n[01:01.19]只一瞬间的交错\r\n[01:05.70]晚风带着你的笑 懵懵懂懂\r\n[01:08.65]有万分之一的心动\r\n[01:10.25]在你的瞳孔\r\n[01:11.70]浪边有金色的情书\r\n[01:13.35]却不忍读透\r\n[01:14.76]我笑你怎么比\r\n[01:15.82]落叶落下还要匆匆\r\n[01:17.97]昨晚迷宫走失的星光\r\n[01:20.83]错认就成了你的眼眸\r\n[01:23.98]单车驶向落日的缺口\r\n[01:25.68]一如少年眉眼的温柔\r\n[01:27.14]我把迂回的心事\r\n[01:28.29]全部藏在散落的风中\r\n[01:30.64]你是我永远例外的心动\r\n[01:33.29]冒着泡泡的情绪在相拥\r\n[01:36.44]夏日通通被融化成甜酒\r\n[01:39.20]余温敲打着我心房和耳后\r\n[01:42.66]你是我永远例外的心动\r\n[01:45.61]黄昏悄悄地从眼角滴落\r\n[01:48.71]就在你亲吻着我的时候\r\n[01:51.41]余温敲打着我心房和耳后\r\n[02:07.22]晚风带着你的笑 懵懵懂懂\r\n[02:10.17]有万分之一的心动\r\n[02:11.78]在你的瞳孔\r\n[02:13.33]浪边有金色的情书\r\n[02:14.93]却不忍读透\r\n[02:16.13]我笑你怎么比\r\n[02:17.38]落叶落下还要匆匆\r\n[02:19.53]昨晚迷宫走失的星光\r\n[02:22.44]错认就成了你的眼眸\r\n[02:25.64]单车驶向落日的缺口\r\n[02:27.34]一如少年眉眼的温柔\r\n[02:28.75]我把迂回的心事\r\n[02:29.90]全部藏在散落的风中\r\n[02:32.21]你是我永远例外的心动\r\n[02:34.96]冒着泡泡的情绪在相拥\r\n[02:38.13]夏日通通被融化成甜酒\r\n[02:40.73]余温敲打着我心房和耳后\r\n[02:44.14]你是我永远例外的心动\r\n[02:47.24]黄昏悄悄地从眼角滴落\r\n[02:50.29]就在你亲吻着我的时候\r\n[02:53.04]余温敲打着我心房和耳后\r\n[02:57.94](未经许可,不得翻唱或使用)\r\n"

格式化代码:

formatLyric(t){
            let a = t.split(`\r\n`), o = a.map( i => { 
                let T = i.match(/\[.*\]/), b = i.replace(/\[.*\]/g, ``);
                if(Array.isArray(T)){
                    T = T[0].replace(/\[|]/g, ``);
                }
                return {T, b};
            }).map( it => {
                let r = /[0-9]{0,2}:[0-9]{0,2}\.[0-9]{0,2}/g.test(it.T);
                if(r){
                    let n = it.T.split(`:`), m = parseInt(n[0])*60 + parseFloat(n[1]);
                    it.T = m;
                }
                return {...it};
            });
            return o;
        }

格式化后显示:

0: {T: "id:$00000000", b: ""}
1: {T: "ar:Bomb比尔", b: ""}
2: {T: "ti:0222心动-比尔的歌", b: ""}
3: {T: "by:", b: ""}
4: {T: "hash:5ecfecaa3768c12a0d0bc2f6bd49d67b", b: ""}
5: {T: "al:", b: ""}
6: {T: "sign:", b: ""}
7: {T: "qq:", b: ""}
8: {T: "total:185000", b: ""}
9: {T: "offset:0", b: ""}
10: {T: 1.67, b: "Bomb比尔 - 0222心动-比尔的歌"}
11: {T: 3.28, b: "作词:弥生"}
12: {T: 3.98, b: "作曲:Bomb比尔"}
13: {T: 4.18, b: "编曲:珑喆"}
14: {T: 4.28, b: "吉他 :珑喆"}
15: {T: 4.44, b: "bass: 珑喆"}
16: {T: 4.54, b: "录音:ID Music@王威"}
17: {T: 4.74, b: "混音:张新龙@MixStory.Studio"}
18: {T: 4.94, b: "母带:张新龙@MixStory.Studio"}
19: {T: 5.14, b: "制作统筹:李梦思"}
20: {T: 5.39, b: "制作人:Bomb比尔 时金宇 刘向"}
21: {T: 5.74, b: "音乐总监:时金宇"}
22: {T: 5.99, b: "艺人统筹:宝玉"}
23: {T: 6.19, b: "监制:安明婵"}
24: {T: 6.34, b: "营销推广:涂涂"}
25: {T: 13.42, b: "晚风带着你的笑 懵懵懂懂"}
26: {T: 16.32, b: "有万分之一的心动"}
27: {T: 18.04, b: "在你的瞳孔"}
28: {T: 19.44, b: "浪边有金色的情书"}
29: {T: 21.04, b: "却不忍读透"}
30: {T: 22.49, b: "我笑你怎么比"}
31: {T: 23.55, b: "落叶落下还要匆匆"}
32: {T: 25.82, b: "昨晚迷宫走失的星光"}
33: {T: 28.52, b: "错认就成了你的眼眸"}
34: {T: 31.77, b: "单车驶向落日的缺口"}
35: {T: 33.42, b: "一如少年眉眼的温柔"}
36: {T: 34.83, b: "我把迂回的心事"}
37: {T: 36.04, b: "全部藏在散落的风中"}
38: {T: 40.03, b: "忘了哪张书页"}
39: {T: 42.73, b: "被泪水全部都浸透"}
40: {T: 45.98, b: "从未曾开口的想念"}
41: {T: 48.88, b: "比人潮还要汹涌"}
42: {T: 52.38, b: "画面还在拼凑"}
43: {T: 55.04, b: "总想起偷偷牵你手"}
44: {T: 58.34, b: "我太多笨拙的借口"}
45: {T: 61.19, b: "只一瞬间的交错"}
46: {T: 65.7, b: "晚风带着你的笑 懵懵懂懂"}
47: {T: 68.65, b: "有万分之一的心动"}
48: {T: 70.25, b: "在你的瞳孔"}
49: {T: 71.7, b: "浪边有金色的情书"}
50: {T: 73.35, b: "却不忍读透"}
51: {T: 74.76, b: "我笑你怎么比"}
52: {T: 75.82, b: "落叶落下还要匆匆"}
53: {T: 77.97, b: "昨晚迷宫走失的星光"}
54: {T: 80.83, b: "错认就成了你的眼眸"}
55: {T: 83.98, b: "单车驶向落日的缺口"}
56: {T: 85.68, b: "一如少年眉眼的温柔"}
57: {T: 87.14, b: "我把迂回的心事"}
58: {T: 88.28999999999999, b: "全部藏在散落的风中"}
59: {T: 90.64, b: "你是我永远例外的心动"}
60: {T: 93.28999999999999, b: "冒着泡泡的情绪在相拥"}
61: {T: 96.44, b: "夏日通通被融化成甜酒"}
62: {T: 99.2, b: "余温敲打着我心房和耳后"}
63: {T: 102.66, b: "你是我永远例外的心动"}
64: {T: 105.61, b: "黄昏悄悄地从眼角滴落"}
65: {T: 108.71000000000001, b: "就在你亲吻着我的时候"}
66: {T: 111.41, b: "余温敲打着我心房和耳后"}
67: {T: 127.22, b: "晚风带着你的笑 懵懵懂懂"}
68: {T: 130.17, b: "有万分之一的心动"}
69: {T: 131.78, b: "在你的瞳孔"}
70: {T: 133.33, b: "浪边有金色的情书"}
71: {T: 134.93, b: "却不忍读透"}
72: {T: 136.13, b: "我笑你怎么比"}
73: {T: 137.38, b: "落叶落下还要匆匆"}
74: {T: 139.53, b: "昨晚迷宫走失的星光"}
75: {T: 142.44, b: "错认就成了你的眼眸"}
76: {T: 145.64, b: "单车驶向落日的缺口"}
77: {T: 147.34, b: "一如少年眉眼的温柔"}
78: {T: 148.75, b: "我把迂回的心事"}
79: {T: 149.9, b: "全部藏在散落的风中"}
80: {T: 152.21, b: "你是我永远例外的心动"}
81: {T: 154.96, b: "冒着泡泡的情绪在相拥"}
82: {T: 158.13, b: "夏日通通被融化成甜酒"}
83: {T: 160.73, b: "余温敲打着我心房和耳后"}
84: {T: 164.14, b: "你是我永远例外的心动"}
85: {T: 167.24, b: "黄昏悄悄地从眼角滴落"}
86: {T: 170.29, b: "就在你亲吻着我的时候"}
87: {T: 173.04, b: "余温敲打着我心房和耳后"}
88: {T: 177.94, b: "(未经许可,不得翻唱或使用)"}

 

posted @ 2021-09-17 17:11  谈亦行  阅读(370)  评论(0编辑  收藏  举报