Compare commits

...

7 Commits

Author SHA1 Message Date
Marco
72857882e4 Merge pull request #37 from cnbeining/fix-websocket-wss
Fix WebSocket protocol detecton under HTTPS
2023-02-19 13:14:12 +01:00
David Zhuang
59abd76966 Fix WebSocket protocol detecton under HTTPS 2023-02-18 17:51:01 -05:00
Marco
8ab7c4db4d Update Dockerfile 2023-02-18 00:14:26 +01:00
Marco
17d48354cb Merge pull request #35 from Skyr/show-selectformat-button
If formats selection enabled: Show "select format" string in button
2023-02-08 17:54:25 +01:00
Marco
ac54a1dd13 Merge pull request #34 from Skyr/show-download-size
In format selection: Show resolution and download size (if available)
2023-02-08 17:54:12 +01:00
Stefan Schlott
75c6c84c5c If formats selection enabled: Show "select format" string in button
(instead of start)
2023-02-04 12:24:42 +01:00
Stefan Schlott
cdad7ca873 In format selection: Show resolution and download size (if available) 2023-02-04 12:13:20 +01:00
6 changed files with 11 additions and 4 deletions

View File

@@ -17,8 +17,8 @@ RUN npm run build
WORKDIR /usr/src/yt-dlp-webui
RUN go build -o yt-dlp-webui
FROM alpine:3.17
# but here yes :)
FROM alpine:edge
WORKDIR /downloads
VOLUME /downloads

View File

@@ -335,7 +335,7 @@ export default function Home({ socket }: Props) {
disabled={url === ''}
onClick={() => settings.formatSelection ? sendUrlFormatSelection() : sendUrl()}
>
{i18n.t('startButton')}
{settings.formatSelection ? i18n.t('selectFormatButton') : i18n.t('startButton')}
</Button>
</Grid>
<Grid item>
@@ -387,6 +387,7 @@ export default function Home({ socket }: Props) {
setPickedAudioFormat('')
}}>
{downloadFormats.best.format_note || downloadFormats.best.format_id} - {downloadFormats.best.vcodec}+{downloadFormats.best.acodec}
&nbsp;({downloadFormats.best.resolution}{(downloadFormats.best.filesize_approx>0)?", ~"+Math.round(downloadFormats.best.filesize_approx/1024/1024)+" MiB":""})
</Button>
</Grid>
{/* video only */}
@@ -411,6 +412,7 @@ export default function Home({ socket }: Props) {
disabled={pickedVideoFormat === format.format_id}
>
{format.format_note} - {format.vcodec === 'none' ? format.acodec : format.vcodec}
&nbsp;({format.resolution}{(format.filesize_approx>0)?", ~"+Math.round(format.filesize_approx/1024/1024)+" MiB":""})
</Button>
</Grid>
))
@@ -436,6 +438,7 @@ export default function Home({ socket }: Props) {
disabled={pickedAudioFormat === format.format_id}
>
{format.format_note} - {format.vcodec === 'none' ? format.acodec : format.vcodec}
{(format.filesize_approx>0)?" (~"+Math.round(format.filesize_approx/1024/1024)+" MiB)":""}
</Button>
</Grid>
))

View File

@@ -4,6 +4,7 @@ languages:
urlInput: YouTube or other supported service video URL
statusTitle: Status
statusReady: Ready
selectFormatButton: Select format
startButton: Start
abortAllButton: Abort All
updateBinButton: Update yt-dlp binary

View File

@@ -59,4 +59,5 @@ export interface IDLFormat {
resolution: string,
vcodec: string,
acodec: string,
filesize_approx: number,
}

View File

@@ -74,7 +74,8 @@ export function toFormatArgs(codes: string[]): string {
}
export function getWebSocketEndpoint() {
return `ws://${localStorage.getItem('server-addr') || window.location.hostname}:${localStorage.getItem('server-port') || window.location.port}/ws-rpc`
const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws'
return `${protocol}://${localStorage.getItem('server-addr') || window.location.hostname}:${localStorage.getItem('server-port') || window.location.port}/ws-rpc`
}
export function getHttpRPCEndpoint() {

View File

@@ -36,6 +36,7 @@ type Format struct {
Resolution string `json:"resolution"`
VCodec string `json:"vcodec"`
ACodec string `json:"acodec"`
Size float32 `json:"filesize_approx"`
}
// struct representing the response sent to the client