@banou/ftube 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +44 -2
- package/__yt_engine__/engine.html +9 -0
- package/app.webmanifest +31 -0
- package/assets/account-BL8Hv7lS.js +157 -0
- package/assets/account-By94iboj.js +1 -0
- package/assets/account-DfiXzypA-YE6OyKjK.js +1 -0
- package/assets/account-generation-BP_-Qyck-BOth6YQ_.js +1 -0
- package/assets/agent-source-E4g0cDzU.js +1 -0
- package/assets/api-1NDCtwel-CAaxX8P1.js +3 -0
- package/assets/binary-encoding-By5K7InN.js +1 -0
- package/assets/build-CNn3bm6X.js +1 -0
- package/assets/busy-C1JPjoZ_-CJ0641jK.js +1 -0
- package/assets/cards-Csel8naI.js +2334 -0
- package/assets/channel-B5f9YTIf.js +1160 -0
- package/assets/client-version-D9kIz6Gz.js +1 -0
- package/assets/comments-CJp9O808.js +612 -0
- package/assets/dislikes-DH5jCVEY.js +1 -0
- package/assets/dist-7VpLCl1k.js +1 -0
- package/assets/dist-BOrL1gYg.js +2 -0
- package/assets/downloads-CMXDjA_E.js +191 -0
- package/assets/egress.worker-DopXr5uP.js +104 -0
- package/assets/engine-B_kFyW7L.js +2 -0
- package/assets/feed-channels-Dg2mvF5x.js +251 -0
- package/assets/feed-groups-CnyR4sOO.js +160 -0
- package/assets/feed-history-BDAGG9N5.js +368 -0
- package/assets/feed-playlists-DcGR2AL6.js +167 -0
- package/assets/feed-subscriptions-Sm3tKz4P.js +165 -0
- package/assets/feed-you-lxbqknXX.js +110 -0
- package/assets/formats-CDwXfKnr.js +1 -0
- package/assets/frame-BrGNSf3s.js +2 -0
- package/assets/fs-CjRTQ7Nu.js +1 -0
- package/assets/fs-CwRtKje1-CBsYhX2-.js +1 -0
- package/assets/fullscreen-view-BLgosU84.js +269 -0
- package/assets/group-C00s0aT7.js +183 -0
- package/assets/groups-button-CvVnqwlu.js +25 -0
- package/assets/hashtag-CCIhITaL.js +115 -0
- package/assets/icons-DKsqNLSs.js +1 -0
- package/assets/index-A5dHbptn.css +1 -0
- package/assets/index-DwsYJ-bu.js +1328 -0
- package/assets/lib-h0P14ZFl.js +70 -0
- package/assets/linkify-B6hdFhsL.js +1 -0
- package/assets/packages-C3w3tSjj-BCtDk0vj.js +1 -0
- package/assets/party-CUcxsJDF.js +180 -0
- package/assets/playlist-DF7wsidw.js +521 -0
- package/assets/playlist-card-Btoc7D8f.js +91 -0
- package/assets/playlist-panel-D97BwT1f.js +199 -0
- package/assets/post-CQ9mfVos.js +39 -0
- package/assets/post-card-ZUQixO1G.js +76 -0
- package/assets/privacy-hkbqXFeB.js +46 -0
- package/assets/protobuf-BXZ2dCCc.js +1 -0
- package/assets/read-more-BhddUSlS.js +20 -0
- package/assets/rich-text-07paR5O3.js +25 -0
- package/assets/roboto-cyrillic-ext-BCp_3N7R.woff2 +0 -0
- package/assets/roboto-cyrillic-fOt7epNf.woff2 +0 -0
- package/assets/roboto-greek-DlT9XTxE.woff2 +0 -0
- package/assets/roboto-greek-ext-Bgw4czJT.woff2 +0 -0
- package/assets/roboto-latin-ccAYIvAh.woff2 +0 -0
- package/assets/roboto-latin-ext-DYIxWhlt.woff2 +0 -0
- package/assets/roboto-math-4a3xuzGk.woff2 +0 -0
- package/assets/roboto-symbols-B7iHSfaG.woff2 +0 -0
- package/assets/roboto-vietnamese-_f1XEJpo.woff2 +0 -0
- package/assets/rooms-B-AvBY-c-FNDqRDHE.js +1 -0
- package/assets/rooms-B91zuirR.js +1 -0
- package/assets/save-menu-DF1WKqSE.js +462 -0
- package/assets/search-Cx5IpDtZ.js +1026 -0
- package/assets/settings-kESE_uBm.js +99 -0
- package/assets/shaka-BwT9pJcV.js +36 -0
- package/assets/share-dialog-Cp0BJ6bg.js +156 -0
- package/assets/shorts-BxDB7m0c.js +686 -0
- package/assets/shorts-grid-Bgbkl5dP.js +11 -0
- package/assets/sign-in-Bx3zmj-m.js +97 -0
- package/assets/signed-out-prompt-CEAx65kq.js +79 -0
- package/assets/signin-DkI8Ogzz.js +18 -0
- package/assets/social-bXt3vmd4.js +1 -0
- package/assets/video-card-compact-r-K4XyDb.js +190 -0
- package/assets/watch-CkxSP1IA.js +1802 -0
- package/assets/web-BNanCsH5.js +43 -0
- package/favicon.ico +0 -0
- package/favicon.svg +5 -0
- package/icons/icon-192.png +0 -0
- package/icons/icon-512.png +0 -0
- package/index-Bj-Q3X8Q.js +4120 -0
- package/index.html +32 -0
- package/package.json +45 -4
- package/store/background.webp +0 -0
- package/store/channel.webp +0 -0
- package/store/cover.webp +0 -0
- package/store/phone.webp +0 -0
- package/store/search.webp +0 -0
- package/store/watch.webp +0 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import{$ as e,on as t,sn as n}from"./icons-DKsqNLSs.js";import{c as r,d as i,g as a,k as o,ot as s,s as c,y as l}from"./sign-in-Bx3zmj-m.js";import{A as u,Y as d,j as f,ln as p}from"./cards-Csel8naI.js";import{L as m,P as h,R as g,i as _,n as v}from"../index-Bj-Q3X8Q.js";import{t as y}from"./signed-out-prompt-CEAx65kq.js";n();var b=90,x=(e,{channelIds:t,hideLive:n,hideWatched:r,hideShorts:i})=>(!t||e.channel!=null&&t.has(e.channel.id))&&!(n&&e.isLive===!0)&&!(r&&(e.progressPercent??0)>=b)&&!(i&&e.isShort===!0),S=(e,t)=>{let n=0;for(let r=e.length-1;r>=0&&!e[r].items.some(e=>x(e,t));r--)n++;return n},C=a(`
|
|
2
|
+
query SubscriptionsFeed($cursor: String) {
|
|
3
|
+
subscriptions(cursor: $cursor) {
|
|
4
|
+
items {
|
|
5
|
+
id
|
|
6
|
+
title
|
|
7
|
+
inlinePlayerParams
|
|
8
|
+
thumbnail
|
|
9
|
+
thumbnailSrcset
|
|
10
|
+
animatedThumbnail
|
|
11
|
+
durationSeconds
|
|
12
|
+
viewCount
|
|
13
|
+
publishedText
|
|
14
|
+
isLive
|
|
15
|
+
isShort
|
|
16
|
+
progressPercent
|
|
17
|
+
channel { id name avatar isVerified isVerifiedArtist }
|
|
18
|
+
byline { text isVerified isVerifiedArtist }
|
|
19
|
+
collaborators { id name avatar handle subscriberCountText isVerified isVerifiedArtist }
|
|
20
|
+
}
|
|
21
|
+
cursor
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`),w=s`
|
|
25
|
+
padding: 2.4rem 1.6rem;
|
|
26
|
+
|
|
27
|
+
.head {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
gap: 1.6rem;
|
|
32
|
+
margin-bottom: 2.4rem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.heading {
|
|
36
|
+
margin: 0;
|
|
37
|
+
font-size: 2rem;
|
|
38
|
+
font-weight: 700;
|
|
39
|
+
line-height: 2.8rem;
|
|
40
|
+
color: var(--text-primary);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.all-subscriptions {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
height: 3.6rem;
|
|
47
|
+
padding: 0 1.6rem;
|
|
48
|
+
border-radius: 1.8rem;
|
|
49
|
+
font-size: 1.4rem;
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
color: var(--accent);
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
transition: background 0.15s ease;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.all-subscriptions:hover {
|
|
57
|
+
background: var(--accent-hover);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.filters {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 1.2rem 2.4rem;
|
|
65
|
+
margin-bottom: 2.4rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.chips {
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-wrap: wrap;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 1.2rem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.chip {
|
|
76
|
+
height: 3.2rem;
|
|
77
|
+
padding: 0 1.2rem;
|
|
78
|
+
border: none;
|
|
79
|
+
border-radius: 0.8rem;
|
|
80
|
+
background: var(--bg-chip);
|
|
81
|
+
color: var(--text-primary);
|
|
82
|
+
font-size: 1.4rem;
|
|
83
|
+
font-weight: 500;
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
transition: background 0.15s ease;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.chip:hover {
|
|
90
|
+
background: var(--bg-chip-hover);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.chip[aria-pressed='true'] {
|
|
94
|
+
background: var(--bg-inverse);
|
|
95
|
+
color: var(--text-inverse);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.chip .emoji {
|
|
99
|
+
margin-right: 0.6rem;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.manage {
|
|
103
|
+
font-size: 1.4rem;
|
|
104
|
+
font-weight: 500;
|
|
105
|
+
color: var(--accent);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.toggle {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
gap: 0.8rem;
|
|
112
|
+
font-size: 1.4rem;
|
|
113
|
+
color: var(--text-primary);
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.toggle input {
|
|
118
|
+
width: 1.8rem;
|
|
119
|
+
height: 1.8rem;
|
|
120
|
+
margin: 0;
|
|
121
|
+
accent-color: var(--accent);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.more {
|
|
125
|
+
display: block;
|
|
126
|
+
height: 3.6rem;
|
|
127
|
+
margin: 2.4rem auto 0;
|
|
128
|
+
padding: 0 1.6rem;
|
|
129
|
+
border: 1px solid var(--border-strong);
|
|
130
|
+
border-radius: 1.8rem;
|
|
131
|
+
background: transparent;
|
|
132
|
+
color: var(--accent);
|
|
133
|
+
font-size: 1.4rem;
|
|
134
|
+
font-weight: 500;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.more:hover {
|
|
139
|
+
background: var(--accent-hover);
|
|
140
|
+
border-color: transparent;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.notice {
|
|
144
|
+
padding: 2.4rem 0;
|
|
145
|
+
font-size: 1.4rem;
|
|
146
|
+
color: var(--text-secondary);
|
|
147
|
+
text-align: center;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.card {
|
|
151
|
+
max-width: 56rem;
|
|
152
|
+
margin: 4.8rem auto 0;
|
|
153
|
+
padding: 2.4rem;
|
|
154
|
+
border-radius: 1.2rem;
|
|
155
|
+
background: var(--bg-subtle);
|
|
156
|
+
text-align: center;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.card h2 {
|
|
160
|
+
margin: 0;
|
|
161
|
+
font-size: 2rem;
|
|
162
|
+
font-weight: 700;
|
|
163
|
+
color: var(--text-primary);
|
|
164
|
+
}
|
|
165
|
+
`,T=()=>{v(`Subscriptions`);let{ready:n,signedIn:a}=i(),s=g(),[b,T]=t(void 0),[E,D]=t(!1),[O,k]=t(!1),[A,j]=t([]),[{data:M,error:N,fetching:P},F]=o({query:C,variables:{cursor:A[A.length-1]?.cursor},pause:!n||!a}),I=M?.subscriptions,L=I&&A[A.length-1]!==I?[...A,I]:A,{items:R,cursor:z}=f({pages:L,key:e=>e.id}),B=m(s),V=s.find(e=>e.id===b),H=p(`hideShorts`),U={channelIds:V?new Set(h(s,V.id).map(e=>e.id)):void 0,hideLive:E,hideWatched:O,hideShorts:H},W=R.filter(e=>x(e,U)),G=S(L,U)>=5,K=()=>{!I?.cursor||P||N||j(e=>e[e.length-1]===I?e:[...e,I])};return n?a?r(`main`,{css:w,children:[r(`div`,{className:`head`,children:[c(`h1`,{className:`heading`,children:`Subscriptions`}),c(l,{href:`/feed/channels`,className:`all-subscriptions`,children:`All subscriptions`})]}),r(`div`,{className:`filters`,children:[r(`div`,{className:`chips`,role:`group`,"aria-label":`Groups`,children:[c(`button`,{type:`button`,className:`chip`,"aria-pressed":!V,onClick:()=>T(void 0),children:`All`}),B.map(({group:e})=>r(`button`,{type:`button`,className:`chip`,"aria-pressed":e.id===V?.id,onClick:()=>T(e.id),children:[c(`span`,{className:`emoji`,"aria-hidden":`true`,children:e.emoji}),e.name]},e.id)),c(l,{href:`/feed/groups`,className:`manage`,children:`Manage`})]}),r(`label`,{className:`toggle`,children:[c(`input`,{type:`checkbox`,checked:E,onChange:()=>D(e=>!e)}),`Hide live`]}),r(`label`,{className:`toggle`,children:[c(`input`,{type:`checkbox`,checked:O,onChange:()=>k(e=>!e)}),`Hide watched`]})]}),M&&!P&&!N&&W.length===0&&(G||!z)?c(`div`,{className:`card`,children:c(`h2`,{children:`No new videos`})}):c(_,{videos:W,fetching:P&&W.length===0}),P&&W.length>0?c(`p`,{className:`notice`,children:`Loading more…`}):void 0,N&&!P?c(d,{error:N,reexecute:F}):void 0,G&&z&&!P&&!N?c(`button`,{type:`button`,className:`more`,onClick:K,children:`Load more`}):void 0,c(u,{onVisible:K,disabled:P||!!N||!z||G})]}):c(`main`,{css:w,children:c(y,{icon:e,title:`Don't miss new videos`,subtitle:`Sign in to see updates from your favorite YouTube channels`})}):r(`main`,{css:w,children:[c(`div`,{className:`head`,children:c(`h1`,{className:`heading`,children:`Subscriptions`})}),c(_,{videos:[],fetching:!0})]})};export{T as default};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import{it as e}from"./icons-DKsqNLSs.js";import{c as t,d as n,g as r,k as i,o as a,ot as o,s,y as c}from"./sign-in-Bx3zmj-m.js";import{I as l,T as u,ln as d}from"./cards-Csel8naI.js";import{n as f}from"../index-Bj-Q3X8Q.js";import{t as p}from"./playlist-card-Btoc7D8f.js";import{t as m}from"./signed-out-prompt-CEAx65kq.js";var h=r(`
|
|
2
|
+
query YouHistory {
|
|
3
|
+
history {
|
|
4
|
+
sections {
|
|
5
|
+
items {
|
|
6
|
+
id
|
|
7
|
+
title
|
|
8
|
+
inlinePlayerParams
|
|
9
|
+
thumbnail
|
|
10
|
+
thumbnailSrcset
|
|
11
|
+
animatedThumbnail
|
|
12
|
+
durationSeconds
|
|
13
|
+
viewCount
|
|
14
|
+
publishedText
|
|
15
|
+
isLive
|
|
16
|
+
isShort
|
|
17
|
+
progressPercent
|
|
18
|
+
channel { id name avatar isVerified isVerifiedArtist }
|
|
19
|
+
byline { text isVerified isVerifiedArtist }
|
|
20
|
+
collaborators { id name avatar handle subscriberCountText isVerified isVerifiedArtist }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`),g=r(`
|
|
26
|
+
query YouPlaylists {
|
|
27
|
+
playlists {
|
|
28
|
+
items {
|
|
29
|
+
id
|
|
30
|
+
title
|
|
31
|
+
thumbnail
|
|
32
|
+
videoCountText
|
|
33
|
+
channel { id name }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`),_=r(`
|
|
38
|
+
query YouPlaylist($id: ID!) {
|
|
39
|
+
playlist(id: $id) {
|
|
40
|
+
playlist { id }
|
|
41
|
+
items {
|
|
42
|
+
video {
|
|
43
|
+
id
|
|
44
|
+
title
|
|
45
|
+
thumbnail
|
|
46
|
+
thumbnailSrcset
|
|
47
|
+
durationSeconds
|
|
48
|
+
viewCount
|
|
49
|
+
publishedText
|
|
50
|
+
isLive
|
|
51
|
+
channel { id name isVerified isVerifiedArtist }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`),v=12,y=o`
|
|
57
|
+
padding: 2.4rem 1.6rem;
|
|
58
|
+
|
|
59
|
+
.shelf + .shelf {
|
|
60
|
+
margin-top: 3.2rem;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.shelf-head {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
gap: 1.6rem;
|
|
68
|
+
margin-bottom: 1.6rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.shelf-title {
|
|
72
|
+
margin: 0;
|
|
73
|
+
font-size: 2rem;
|
|
74
|
+
font-weight: 700;
|
|
75
|
+
color: var(--text-primary);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.view-all {
|
|
79
|
+
display: inline-flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
height: 3.6rem;
|
|
82
|
+
padding: 0 1.6rem;
|
|
83
|
+
border: 1px solid var(--border-strong);
|
|
84
|
+
border-radius: 1.8rem;
|
|
85
|
+
color: var(--text-primary);
|
|
86
|
+
font-size: 1.4rem;
|
|
87
|
+
font-weight: 500;
|
|
88
|
+
transition: background 0.15s ease;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.view-all:hover {
|
|
92
|
+
background: var(--bg-hover);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.row {
|
|
96
|
+
display: grid;
|
|
97
|
+
grid-auto-flow: column;
|
|
98
|
+
grid-auto-columns: minmax(21rem, 1fr);
|
|
99
|
+
grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
|
|
100
|
+
gap: 1.6rem;
|
|
101
|
+
overflow-x: auto;
|
|
102
|
+
padding-bottom: 0.8rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.empty {
|
|
106
|
+
margin: 0;
|
|
107
|
+
font-size: 1.4rem;
|
|
108
|
+
color: var(--text-secondary);
|
|
109
|
+
}
|
|
110
|
+
`,b=({title:e,href:n,empty:r,emptyText:i=`No videos`,children:a})=>t(`section`,{className:`shelf`,"aria-label":e,children:[t(`div`,{className:`shelf-head`,children:[s(`h2`,{className:`shelf-title`,children:e}),s(c,{href:n,className:`view-all`,children:`View all`})]}),r?s(`p`,{className:`empty`,children:i}):s(`div`,{className:`row`,children:a})]}),x=({title:e,href:t,videos:n,fetching:r})=>s(b,{title:e,href:t,empty:!r&&n.length===0,children:n.slice(0,v).map(e=>s(u,{video:e},e.id))}),S=({id:e,title:t})=>{let[{data:n,fetching:r}]=i({query:_,variables:{id:e}}),a=(n?.playlist.items??[]).map(e=>e.video);return!r&&a.length===0?null:s(x,{title:t,href:l(e),videos:a,fetching:r})},C=()=>{let e=d(`hideShorts`),[{data:n,fetching:r}]=i({query:h}),[{data:o,fetching:c}]=i({query:g}),l=(n?.history.sections??[]).flatMap(e=>e.items).filter(t=>!e||t.isShort!==!0),u=(o?.playlists.items??[]).filter(e=>e.id!==`WL`&&e.id!==`LL`).slice(0,v);return t(a,{children:[s(x,{title:`History`,href:`/feed/history`,videos:l,fetching:r}),s(b,{title:`Playlists`,href:`/feed/playlists`,empty:!c&&u.length===0,emptyText:`No playlists`,children:u.map(e=>s(p,{id:e.id,title:e.title,thumbnail:e.thumbnail,videoCountText:e.videoCountText,channelName:e.channel?.name},e.id))}),s(S,{id:`WL`,title:`Watch later`}),s(S,{id:`LL`,title:`Liked videos`})]})},w=()=>{f(`You`);let{ready:r,signedIn:i}=n();return t(`main`,{css:y,children:[r&&!i?s(m,{icon:e,title:`Enjoy your favorite videos`,subtitle:`Sign in to access videos that you've liked or saved`}):void 0,r&&i?s(C,{}):void 0]})};export{w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./binary-encoding-By5K7InN.js";var n=()=>{let e=globalThis;return e.MediaSource??e.ManagedMediaSource},r=class{static{Object.defineProperty(this,"name",{value:`MediaSource`})}static isTypeSupported(e){let t=n();return typeof t?.isTypeSupported==`function`&&t.isTypeSupported(e)}static get canConstructInDedicatedWorker(){return!!n()?.canConstructInDedicatedWorker}static[Symbol.hasInstance](e){let t=globalThis;return typeof t.MediaSource==`function`&&e instanceof t.MediaSource||typeof t.ManagedMediaSource==`function`&&e instanceof t.ManagedMediaSource}constructor(){let e=n();if(typeof e!=`function`)throw new DOMException(`this browser has no MediaSource or ManagedMediaSource`,`NotSupportedError`);return new e}},i=(e,{maxHeight:t=1080,cover:n,pinnedHeight:i}={},a=e=>r.isTypeSupported(e))=>{let o=e.filter(e=>e.width&&e.height&&a(e.mimeType));if(o.length===0)return;let s=e=>Math.min(e.width,e.height);if(i!==void 0){let e=o.filter(e=>e.height===i).sort((e,t)=>t.bitrate-e.bitrate)[0];if(e)return e}return n&&n.width>0&&n.height>0?o.filter(e=>e.width>=n.width||e.height>=n.height).sort((e,t)=>s(e)-s(t)||e.bitrate-t.bitrate)[0]??[...o].sort((e,t)=>s(t)-s(e)||e.bitrate-t.bitrate)[0]:o.filter(e=>s(e)<=t).sort((e,t)=>s(t)-s(e)||e.bitrate-t.bitrate)[0]??o[0]},a=new Set([`acont`,`lang`,`drc`]),o=e=>{let t=decodeURIComponent(e).replace(/-/g,`+`).replace(/_/g,`/`),n=t.padEnd(t.length+(4-t.length%4)%4,`=`),r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e+=1)i[e]=r.charCodeAt(e);return i},s=n=>{try{let r=new t(o(n)),i=[];for(;r.pos<r.len;){let[n,a]=r.tag();if(n!==1||a!==e.LengthDelimited)return;let o=new t(r.bytes()),s=``,c=``;for(;o.pos<o.len;){let[t,n]=o.tag();if(t===1&&n===e.LengthDelimited)s=o.string();else if(t===2&&n===e.LengthDelimited)c=o.string();else return}if(!s)return;i.push({key:s,value:c})}return i.length>0?i:void 0}catch{return}},c=e=>!!e.has_audio&&!e.has_video,l=e=>e.key===`vb`||e.key===`acont`&&(e.value===`descriptive`||e.value===`secondary`),u=e=>e.is_vb||e.is_descriptive||e.is_secondary?!0:e.xtags?!!s(e.xtags)?.some(l):!1,d=e=>{if(!e.xtags)return!1;let t=s(e.xtags);return t?t.some(e=>!a.has(e.key)):!(e.is_drc||e.is_dubbed||e.is_auto_dubbed||e.is_original||e.audio_track?.id)},f=(e,{singleTrack:t=!1}={})=>{let n=e.filter(c),r=n.filter(e=>!u(e)),i=r.filter(e=>!d(e)),a=i.length>0?i:r.length>0?r:n;if(a.some(e=>!!e.audio_track?.id)&&(a=a.filter(e=>!!e.audio_track?.id)),t){let e=a.filter(e=>!e.is_drc&&!e.is_dubbed&&!e.is_auto_dubbed),t=e.filter(e=>e.is_original);a=t.length>0?t:e.length>0?e:a}let o=new Set(a);return e.filter(e=>!c(e)||o.has(e))},p=e=>{let t=new Map;for(let n of e){if(!n.audioTrackId)continue;let e=t.get(n.audioTrackId);e?e.push(n):t.set(n.audioTrackId,[n])}return[...t.entries()].map(([e,t])=>{let n=t.some(e=>e.isOriginal),r=t.some(e=>e.isDrc)&&t.some(e=>!e.isDrc);return{id:e,label:t.find(e=>e.audioTrackName)?.audioTrackName??t.find(e=>e.language)?.language??e,language:t.find(e=>e.language)?.language,original:n,autoDubbed:!n&&t.some(e=>e.isAutoDubbed),hasDrc:r}}).sort((e,t)=>Number(t.original)-Number(e.original)||e.label.localeCompare(t.label))},m=(e,t)=>{let n=t===void 0?e:e.filter(e=>e.audioTrackId===t);return n.some(e=>e.isDrc)&&n.some(e=>!e.isDrc)},h=(e,{trackId:t,drc:n=!1}={})=>{if(e.length===0)return;let r;if(r=t===void 0?[]:e.filter(e=>e.audioTrackId===t),r.length===0){if(e.some(e=>e.audioTrackId)){let t=e.find(e=>e.audioTrackId&&e.isOriginal&&!e.isAutoDubbed)??e.find(e=>e.audioTrackId&&!e.isAutoDubbed)??e.find(e=>e.audioTrackId);r=t?e.filter(e=>e.audioTrackId===t.audioTrackId):[...e]}else r=[...e]}let i=r.filter(e=>!!e.isDrc===n);return[...i.length>0?i:r].sort((e,t)=>Number(t.mimeType.includes(`opus`))-Number(e.mimeType.includes(`opus`))||t.bitrate-e.bitrate)[0]},g=e=>{let t=[String(e.itag)];return e.audioTrackId&&t.push(e.audioTrackId),e.isDrc&&t.push(`drc`),t.join(`-`)},_=(e,t)=>e.audioTrackName?t&&e.isDrc?`${e.audioTrackName} (Stable Volume)`:e.audioTrackName:t?e.isDrc?`Stable Volume`:`Original`:``,v=(e,t)=>!e.audioTrackId&&!t?``:e.isOriginal?`main`:`alternate`,y=e=>{let t=e.match(/codecs="([^"]+)"/i)?.[1]??e,n=t.toLowerCase();return n.includes(`avc1`)?`H.264`:n.includes(`av01`)?`AV1`:n.includes(`vp09`)||n.includes(`vp9`)?`VP9`:n.includes(`mp4a`)?`AAC`:n.includes(`opus`)?`Opus`:t.split(`,`)[0]?.trim()||e};export{y as a,f as c,p as i,m as l,v as n,h as o,g as r,i as s,_ as t,r as u};
|