-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathconsts.ts
More file actions
118 lines (94 loc) · 2.78 KB
/
consts.ts
File metadata and controls
118 lines (94 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/* eslint-disable no-useless-escape,max-len */
export const MUSICDEX_URL =
typeof window !== "undefined" && window.location.origin === "https://holodex.net"
? "https://music.holodex.net"
: "https://music-staging.holodex.net";
export const CHANNEL_TYPES = {
VTUBER: "vtuber",
SUBBER: "subber",
} as const;
export const VIDEO_TYPES = {
CLIP: "clip",
STREAM: "stream",
PLACEHOLDER: "placeholder",
} as const;
export const PLACEHOLDER_TYPES = {
YT_STREAM: "scheduled-yt-stream",
EXTERNAL_STREAM: "external-stream",
EVENT: "event",
} as const;
export const CHANNEL_URL_REGEX =
/(?:(?:https?:|)\/\/|)(?:www\.|)(?:youtube\.com\/|\/?)channel\/(?<id>[\w-]+)/i;
export const VIDEO_URL_REGEX =
/(?:(?:https?:|)\/\/|)((?:www|m)\.|)(?<domain>youtube\.com|youtu\.be|holodex\.net)\/(?:[\w-]+\?v=|embed|v|watch|live|)\/?(?<id>[\w-]{11})/i;
export const TWITCH_VIDEO_URL_REGEX =
/(?:(?:https?:|)\/\/|)twitch\.tv\/(?<id>[\w-]+)/i;
export const TWITCH_UNLIVE_VIDEO_URL_REGEX =
/(?:https:\/\/)?twitch\.tv\/videos\/([\w\-_]*)/i;
export const TWITCAST_VIDEO_URL_REGEX = /(?:https:\/\/)?twitcasting\.tv\/(.*)/i;
export const TWITCAST_UNLIVE_VIDEO_URL_REGEX =
/(?:https:\/\/)?twitcasting\.tv\/(.*)\/movie\/([\w\-_]*)/i;
export const NICONICO_VIDEO_URL_REGEX =
/(?:https:\/\/)?live\.nicovideo\.jp\/watch\/([\w\-_]*)/i;
export const NICONICO_UNLIVE_VIDEO_URL_REGEX =
/(?:https:\/\/)?nicovideo\.jp\/watch\/([\w\-_]*)/i;
export const BILIBILI_VIDEO_URL_REGEX =
/(?:https:\/\/)?live\.bilibili\.com\/([\w\-_]*)/i;
export const BILIBILI_UNLIVE_VIDEO_URL_REGEX =
/(?:https:\/\/)?bilibili\.com\/video\/([\w\-_]*)/i;
// Clip channel TL Langs;
export const TL_LANGS = [
{
text: "English",
value: "en",
},
{
text: "日本語",
value: "ja",
},
{
text: "Español",
value: "es",
},
{
text: "中文",
value: "zh",
},
{
text: "Bahasa Indonesia / Melayu",
value: "id",
},
{
text: "Русский язык",
value: "ru",
},
{
text: "한국어",
value: "ko",
},
] as const;
export type TLLanguageCode = (typeof TL_LANGS)[number]["value"];
export const CLIPPER_LANGS = TL_LANGS;
// exports.CHANNEL_TYPE_TO_VIDEO_TYPE = {
// [this.CHANNEL_TYPES.VTUBER]: this.VIDEO_TYPES.STREAM,
// [this.CHANNEL_TYPES.SUBBER]: this.VIDEO_TYPES.CLIP,
// };
export const RELATIONSHIP_TYPES = {
REFER: "refer",
SIMULCAST: "simulcast",
CLIP: "clip",
} as const;
export const STATUSES = {
NEW: "new",
LIVE: "live",
UPCOMING: "upcoming",
PAST: "past",
MISSING: "missing",
} as const;
export const COMPANION_EXTENSION_ID = "jkdnofimdhpbhdjbcdlgnccfjjkidlgp";
export const MESSAGE_TYPES = Object.freeze({
TOKEN: "token",
FAVORITES: "favorites",
});
export const MAX_PLAYLIST_LENGTH = 500;
export const GET_ON_INIT = { getOnInit: true };