Skip to content

Commit c5c7f1f

Browse files
committed
Support music.163.com
website: https://music.163.com/st/webplayer
1 parent ab0b849 commit c5c7f1f

13 files changed

Lines changed: 122 additions & 17 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spotify-lyrics",
3-
"version": "1.6.12",
3+
"version": "1.6.13",
44
"description": "Desktop Spotify Web Player Instant Synchronized Lyrics",
55
"scripts": {
66
"lint": "tsc --noEmit && eslint --ext .ts --fix src/",

public/_locales/en/messages.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2+
"sponsorsText": {
3+
"message": "If this extension is helpful to you, please support the author:"
4+
},
5+
26
"extensionName": {
37
"message": "SLyrics",
48
"description": "Name of the extension"
@@ -29,12 +33,12 @@
2933
"description": "Request confirmation from the user"
3034
},
3135

32-
"popupConfirmSave" : {
36+
"popupConfirmSave": {
3337
"message": "Save",
3438
"description": "Save user selection"
3539
},
3640

37-
"popupConfirmCancel" : {
41+
"popupConfirmCancel": {
3842
"message": "Cancel",
3943
"description": "Cancel manually set lyrics"
4044
},
@@ -74,7 +78,6 @@
7478
"description": "Specify font size detail"
7579
},
7680

77-
7881
"optionsFontFamily": {
7982
"message": "Lyrics font family",
8083
"description": "Specify lyrics font family"
@@ -210,23 +213,22 @@
210213
"message": "Playback rate",
211214
"description": "Audio playback rate"
212215
},
213-
216+
214217
"pageEditorOffset": {
215218
"message": "Global offset",
216219
"description": "Lyrics offset lable"
217220
},
218-
221+
219222
"pageEditorOffsetDetail": {
220223
"message": "Offset 0.1s",
221224
"description": "Lyrics offset button title"
222225
},
223-
226+
224227
"pageEditorClearAll": {
225228
"message": "Clear all",
226229
"description": "Cleaer all lyrics"
227230
},
228231

229-
230232
"pageEditorSeek": {
231233
"message": "Jump",
232234
"description": "Track seek tip"
@@ -276,4 +278,4 @@
276278
"message": "Please add a timestamp to each line of text",
277279
"description": "Save lyrics valid tip"
278280
}
279-
}
281+
}

public/_locales/zh/messages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2+
"sponsorsText": {
3+
"message": "如果这个扩展对你有帮助,欢迎支持作者:"
4+
},
5+
26
"extensionName": {
37
"message": "SLyrics"
48
},

public/manifest.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/extend-chrome/manifest-json-schema/main/schema/manifest.schema.json",
33
"name": "__MSG_extensionName__",
4-
"version": "1.6.12",
4+
"version": "1.6.13",
55
"manifest_version": 3,
66
"description": "__MSG_extensionDescription__",
77
"default_locale": "en",
@@ -13,6 +13,7 @@
1313
],
1414
"host_permissions": [
1515
"*://open.spotify.com/*",
16+
"*://music.163.com/*",
1617
"*://www.deezer.com/*",
1718
"*://music.youtube.com/*",
1819
"*://music.apple.com/*",
@@ -32,6 +33,7 @@
3233
{
3334
"matches": [
3435
"*://open.spotify.com/*",
36+
"*://music.163.com/*",
3537
"*://www.deezer.com/*",
3638
"*://music.youtube.com/*",
3739
"*://music.apple.com/*",
@@ -43,6 +45,7 @@
4345
{
4446
"matches": [
4547
"*://open.spotify.com/*",
48+
"*://music.163.com/*",
4649
"*://www.deezer.com/*",
4750
"*://music.youtube.com/*",
4851
"*://music.apple.com/*",

src/common/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ export interface Options {
5959
'strict-mode'?: SwitchValue;
6060
}
6161

62-
export type Platform = 'SPOTIFY' | 'YOUTUBE' | 'DEEZER' | 'TIDAL' | 'APPLE';
62+
export type Platform = 'SPOTIFY' | 'YOUTUBE' | 'DEEZER' | 'TIDAL' | 'APPLE' | 'NETEASE';

src/options.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
<title>Spotify Lyrics Options</title>
2-
<script type="module" src="./options/index.ts"></script>
2+
<script type="module" src="./options/index.ts"></script>
3+
<style>
4+
body {
5+
min-width: 620px;
6+
}
7+
</style>

src/options/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import './elements/form';
2020
import './elements/form-item';
2121
import './elements/select';
2222
import './elements/switch';
23+
import './elements/sponsor';
2324

2425
import { getOptions, updateOptions } from './store';
2526

@@ -75,6 +76,7 @@ export class OptionsApp extends GemElement<State> {
7576
if (!options) return null;
7677

7778
return html`
79+
<ele-sponsor></ele-sponsor>
7880
<style>
7981
:host {
8082
display: block;

src/options/elements/form-item.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { customElement, attribute, boolattribute } from '@mantou/gem/lib/decorators';
22
import { GemElement, html } from '@mantou/gem/lib/element';
33

4+
import { theme } from '../../common/theme';
5+
46
@customElement('ele-form-item')
57
export class FormItem extends GemElement {
68
@attribute label: string;
@@ -22,6 +24,9 @@ export class FormItem extends GemElement {
2224
pointer-events: none;
2325
opacity: 0.3;
2426
}
27+
:host(:not(:disabled):hover) {
28+
background: rgba(${theme.backgroundRGB}, 0.02);
29+
}
2530
.text {
2631
display: flex;
2732
flex-direction: column;

src/options/elements/sponsor.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { GemElement, html } from '@mantou/gem/lib/element';
2+
import { customElement } from '@mantou/gem/lib/decorators';
3+
4+
import { theme } from '../../common/theme';
5+
import { i18n } from '../../i18n';
6+
7+
@customElement('ele-sponsor')
8+
export class Sponsor extends GemElement {
9+
render() {
10+
return html`
11+
<style>
12+
:host {
13+
display: flex;
14+
gap: 1em;
15+
color: rgb(${theme.blackRGB});
16+
font-size: 1.2em;
17+
margin-block: 0.5em;
18+
}
19+
a {
20+
color: rgb(${theme.primaryRGB});
21+
}
22+
</style>
23+
${i18n.sponsorsText()}
24+
<a href="https://github.com/sponsors/mantou132" target="_blank" rel="noopener noreferrer">
25+
GitHub Sponsors
26+
</a>
27+
<a href="https://www.buymeacoffee.com/mantou132" target="_blank" rel="noopener noreferrer">
28+
Buy Me a Coffee
29+
</a>
30+
`;
31+
}
32+
}

src/page/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@
1515
"OTHER_DEVICE": "[data-testid=now-playing-bar] > div + div",
1616
"OTHER_DEVICE_TOTAL": "[data-testid=playback-duration]",
1717
"OTHER_DEVICE_CURRENT": "[data-testid=playback-position]",
18+
"NETEASE": {
19+
"LOGGED_MARK_SELECTOR": "#page_pc_main_nav [class^=Name_]",
20+
"LYRICS_CONTAINER_SELECTOR": "#contentContainer",
21+
"PAGE_PIP_STYLE": "position: sticky; width: 100%; height: auto; bottom: 80px; object-fit: cover;",
22+
"ALBUM_COVER_SELECTOR": ".miniVinylWrapper img",
23+
"ALBUM_COVER_LARGE_REGEXP_REPLACE": ["(?<=thumbnail=)44y44", "640y640"],
24+
"TRACK_INFO_SELECTOR": "footer [class*=songPlayInfo_] .info-wrapper",
25+
"TRACK_NAME_SELECTOR": "footer [class*=songPlayInfo_] .info-wrapper .title > span:first-child",
26+
"TRACK_ARTIST_SELECTOR": "footer [class*=songPlayInfo_] .info-wrapper .title > span:last-child",
27+
"BTN_WRAPPER_SELECTOR": "footer [class*=songPlayInfo_] .info-wrapper + div",
28+
"BTN_LIKE_SELECTOR": "footer [class*=songPlayInfo_] .info-wrapper + div > button",
29+
"PIP_BTN_SELECTOR": "NONE",
30+
"AUDIO_SELECTOR": "NONE"
31+
},
1832
"YOUTUBE": {
1933
"LOGGED_MARK_SELECTOR": "ytmusic-settings-button",
2034
"LYRICS_CONTAINER_SELECTOR": "ytmusic-player",

0 commit comments

Comments
 (0)