Compare commits
41 Commits
v2.1.0
...
bump-golan
Author | SHA1 | Date | |
---|---|---|---|
40fcd69601 | |||
5d0a261ec7 | |||
e76467b99a | |||
ccf6ee70f7 | |||
1397992b2e | |||
d5bf934f84 | |||
f62b41e2a6 | |||
4a4a53c745 | |||
242d6af088 | |||
5d7e2d8fc4 | |||
131c95e1dd | |||
0986214517 | |||
a52c8dca32 | |||
f4ee4aff9a | |||
b5b253140e | |||
4b7a642b1f | |||
15628e7770 | |||
4b359ddd61 | |||
7993835dad | |||
0846732ece | |||
3eb676f2fd | |||
dfbb1770e4 | |||
3004939371 | |||
79030f02cf | |||
b861e6f3a2 | |||
cb86a6c681 | |||
0ca6990373 | |||
8cef76d0c0 | |||
cad168222b | |||
8598c9e6bb | |||
5cb220b4d7 | |||
74fbd541cd | |||
4dfa55bcfd | |||
fdbd42f666 | |||
2ac97f392a | |||
aba4746463 | |||
1fdc3448b1 | |||
598fce21e7 | |||
ff8aaa0333 | |||
7b1a15b73a | |||
24fd49fe06 |
6
.github/workflows/push.yml
vendored
6
.github/workflows/push.yml
vendored
@ -1,6 +1,10 @@
|
|||||||
name: Build on push and PRs
|
name: Build on push and PRs
|
||||||
|
|
||||||
on: [push,pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# bump: golang /GOLANG_VERSION=([\d.]+)/ docker:golang|^1
|
# bump: golang /GOLANG_VERSION=([\d.]+)/ docker:golang|^1
|
||||||
# bump: golang link "Release notes" https://golang.org/doc/devel/release.html
|
# bump: golang link "Release notes" https://golang.org/doc/devel/release.html
|
||||||
ARG GOLANG_VERSION=1.22.1
|
ARG GOLANG_VERSION=1.23.0
|
||||||
# bump: yt-dlp /YT_DLP=([\d.-]+)/ https://github.com/yt-dlp/yt-dlp.git|/^\d/|sort
|
# bump: yt-dlp /YT_DLP=([\d.-]+)/ https://github.com/yt-dlp/yt-dlp.git|/^\d/|sort
|
||||||
# bump: yt-dlp link "Release notes" https://github.com/yt-dlp/yt-dlp/releases/tag/$LATEST
|
# bump: yt-dlp link "Release notes" https://github.com/yt-dlp/yt-dlp/releases/tag/$LATEST
|
||||||
ARG YT_DLP=2024.03.10
|
ARG YT_DLP=2024.08.06
|
||||||
|
|
||||||
FROM golang:$GOLANG_VERSION AS base
|
FROM golang:$GOLANG_VERSION AS base
|
||||||
ARG YT_DLP
|
ARG YT_DLP
|
||||||
|
10
README.md
10
README.md
@ -53,6 +53,16 @@ func main() {
|
|||||||
See [goutubedl cmd tool](cmd/goutubedl/main.go) or [ydls](https://github.com/wader/ydls)
|
See [goutubedl cmd tool](cmd/goutubedl/main.go) or [ydls](https://github.com/wader/ydls)
|
||||||
for usage examples.
|
for usage examples.
|
||||||
|
|
||||||
|
### Default options and cache
|
||||||
|
|
||||||
|
#### .netrc
|
||||||
|
|
||||||
|
goutubedl by default uses `--netrc` to use `~/.netrc` authentication data.
|
||||||
|
|
||||||
|
#### Cache directory
|
||||||
|
|
||||||
|
yt-dlp stores various extractor session data to speed up things in `${XDG_CACHE_HOME}/yt-dlp` (usually `~/.cache/yt-dlp`). You might want to preverse this directory if your running things in ephemeral conatiners etc.
|
||||||
|
|
||||||
### Development
|
### Development
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
35
goutubedl.go
35
goutubedl.go
@ -225,6 +225,7 @@ type Options struct {
|
|||||||
DownloadSubtitles bool
|
DownloadSubtitles bool
|
||||||
DownloadSections string // --download-sections
|
DownloadSections string // --download-sections
|
||||||
ProxyUrl string // --proxy URL http://host:port or socks5://host:port
|
ProxyUrl string // --proxy URL http://host:port or socks5://host:port
|
||||||
|
UseIPV4 bool // -4 Make all connections via IPv4
|
||||||
CookiesFromBrowser string // --cookies-from-browser BROWSER[:FOLDER]
|
CookiesFromBrowser string // --cookies-from-browser BROWSER[:FOLDER]
|
||||||
DebugLog Printer
|
DebugLog Printer
|
||||||
StderrFn func(cmd *exec.Cmd) io.Writer // if not nil, function to get Writer for stderr
|
StderrFn func(cmd *exec.Cmd) io.Writer // if not nil, function to get Writer for stderr
|
||||||
@ -304,19 +305,27 @@ func infoFromURL(
|
|||||||
ProbePath(),
|
ProbePath(),
|
||||||
// see comment below about ignoring errors for playlists
|
// see comment below about ignoring errors for playlists
|
||||||
"--ignore-errors",
|
"--ignore-errors",
|
||||||
|
// TODO: deprecated in yt-dlp?
|
||||||
"--no-call-home",
|
"--no-call-home",
|
||||||
"--no-cache-dir",
|
// use safer output filenmaes
|
||||||
"--skip-download",
|
// TODO: needed?
|
||||||
"--restrict-filenames",
|
"--restrict-filenames",
|
||||||
// provide URL via stdin for security, youtube-dl has some run command args
|
// use .netrc authentication data
|
||||||
|
"--netrc",
|
||||||
|
// provide url via stdin for security, youtube-dl has some run command args
|
||||||
"--batch-file", "-",
|
"--batch-file", "-",
|
||||||
"-J",
|
// dump info json
|
||||||
|
"--dump-single-json",
|
||||||
)
|
)
|
||||||
|
|
||||||
if options.ProxyUrl != "" {
|
if options.ProxyUrl != "" {
|
||||||
cmd.Args = append(cmd.Args, "--proxy", options.ProxyUrl)
|
cmd.Args = append(cmd.Args, "--proxy", options.ProxyUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if options.UseIPV4 {
|
||||||
|
cmd.Args = append(cmd.Args, "-4")
|
||||||
|
}
|
||||||
|
|
||||||
if options.Downloader != "" {
|
if options.Downloader != "" {
|
||||||
cmd.Args = append(cmd.Args, "--downloader", options.Downloader)
|
cmd.Args = append(cmd.Args, "--downloader", options.Downloader)
|
||||||
}
|
}
|
||||||
@ -559,12 +568,19 @@ func (result Result) DownloadWithOptions(
|
|||||||
cmd := exec.CommandContext(
|
cmd := exec.CommandContext(
|
||||||
ctx,
|
ctx,
|
||||||
ProbePath(),
|
ProbePath(),
|
||||||
"--no-call-home",
|
// see comment below about ignoring errors for playlists
|
||||||
"--no-cache-dir",
|
|
||||||
"--ignore-errors",
|
"--ignore-errors",
|
||||||
|
// TODO: deprecated in yt-dlp?
|
||||||
|
"--no-call-home",
|
||||||
|
// use non-fancy progress bar
|
||||||
"--newline",
|
"--newline",
|
||||||
|
// use safer output filenmaes
|
||||||
|
// TODO: needed?
|
||||||
"--restrict-filenames",
|
"--restrict-filenames",
|
||||||
"-o", "-",
|
// use .netrc authentication data
|
||||||
|
"--netrc",
|
||||||
|
// write to stdout
|
||||||
|
"--output", "-",
|
||||||
)
|
)
|
||||||
|
|
||||||
if result.Options.noInfoDownload {
|
if result.Options.noInfoDownload {
|
||||||
@ -593,7 +609,10 @@ func (result Result) DownloadWithOptions(
|
|||||||
} else {
|
} else {
|
||||||
cmd.Args = append(cmd.Args, "--load-info", jsonTempPath)
|
cmd.Args = append(cmd.Args, "--load-info", jsonTempPath)
|
||||||
}
|
}
|
||||||
|
// force IPV4 Usage
|
||||||
|
if result.Options.UseIPV4 {
|
||||||
|
cmd.Args = append(cmd.Args, "-4")
|
||||||
|
}
|
||||||
// don't need to specify if direct as there is only one
|
// don't need to specify if direct as there is only one
|
||||||
// also seems to be issues when using filter with generic extractor
|
// also seems to be issues when using filter with generic extractor
|
||||||
if !result.Info.Direct && options.Filter != "" {
|
if !result.Info.Direct && options.Filter != "" {
|
||||||
|
Reference in New Issue
Block a user