48 Commits

Author SHA1 Message Date
d3f32f5956 Update golang to 1.23.1 from 1.22.6
Release notes https://golang.org/doc/devel/release.html
2024-09-06 16:02:07 +00:00
a623bde37b Merge pull request #195 from gamersindo1223/master
Added Download Audio Only
2024-08-18 12:19:19 +02:00
90467bcf8a Merge pull request #202 from ar2rworld/AddCookiesOption
Adding Cookies to Options
2024-08-17 19:07:30 +02:00
d47fecba92 Adding Cookies to Options 2024-08-16 22:55:25 -07:00
65804d5c0f Moved to DownloadOptions 2024-08-12 12:02:26 +00:00
95037e2caf Merge branch 'wader:master' into master 2024-08-12 18:36:45 +07:00
346cfb47a0 Update goutubedl.go 2024-08-12 18:15:44 +07:00
5d0a261ec7 Merge pull request #200 from wader/bump-golang-1.22.6
Update golang to 1.22.6 from 1.22.5
2024-08-07 18:20:54 +02:00
e76467b99a Update golang to 1.22.6 from 1.22.5
Release notes https://golang.org/doc/devel/release.html
2024-08-07 16:02:25 +00:00
ccf6ee70f7 Merge pull request #199 from wader/bump-yt-dlp-2024.08.06
Update yt-dlp to 2024.08.06 from 2024.08.01
2024-08-06 18:05:00 +02:00
1397992b2e Update yt-dlp to 2024.08.06 from 2024.08.01
Release notes https://github.com/yt-dlp/yt-dlp/releases/tag/2024.08.06
2024-08-06 16:02:17 +00:00
d5bf934f84 Merge pull request #198 from wader/bump-yt-dlp-2024.08.01
Update yt-dlp to 2024.08.01 from 2024.07.25
2024-08-01 18:22:26 +02:00
f62b41e2a6 Update yt-dlp to 2024.08.01 from 2024.07.25
Release notes https://github.com/yt-dlp/yt-dlp/releases/tag/2024.08.01
2024-08-01 16:12:53 +00:00
4a4a53c745 Merge pull request #197 from wader/bump-yt-dlp-2024.07.25
Update yt-dlp to 2024.07.25 from 2024.07.16
2024-07-25 19:24:41 +02:00
242d6af088 Update yt-dlp to 2024.07.25 from 2024.07.16
Release notes https://github.com/yt-dlp/yt-dlp/releases/tag/2024.07.25
2024-07-25 16:12:54 +00:00
5d7e2d8fc4 Merge pull request #196 from wader/bump-yt-dlp-2024.07.16
Update yt-dlp to 2024.07.16 from 2024.07.09
2024-07-17 20:20:40 +02:00
131c95e1dd Update yt-dlp to 2024.07.16 from 2024.07.09
Release notes https://github.com/yt-dlp/yt-dlp/releases/tag/2024.07.16
2024-07-17 16:02:25 +00:00
3abe5ae66a Added Download Audio Only 2024-07-11 16:13:41 +00:00
0986214517 Merge pull request #194 from wader/bump-yt-dlp-2024.07.09
Update yt-dlp to 2024.07.09 from 2024.07.07
2024-07-09 18:13:10 +02:00
a52c8dca32 Update yt-dlp to 2024.07.09 from 2024.07.07
Release notes https://github.com/yt-dlp/yt-dlp/releases/tag/2024.07.09
2024-07-09 16:02:11 +00:00
f4ee4aff9a Merge pull request #193 from wader/bump-yt-dlp-2024.07.07
Update yt-dlp to 2024.07.07 from 2024.07.02
2024-07-08 18:41:14 +02:00
b5b253140e Update yt-dlp to 2024.07.07 from 2024.07.02
Release notes https://github.com/yt-dlp/yt-dlp/releases/tag/2024.07.07
2024-07-08 16:02:19 +00:00
4b7a642b1f go fmt and some style fixes 2024-07-08 12:17:00 +02:00
15628e7770 Merge pull request #192 from gamersindo1223/master
Add force IPV4 support
2024-07-08 12:15:41 +02:00
4b359ddd61 Use existing Force IPV4 Config 2024-07-08 10:06:40 +00:00
7993835dad Add some changes (DownloadOptions, Add comments) 2024-07-07 22:45:24 +00:00
0846732ece Add force IPV4 support 2024-07-07 12:20:23 +00:00
3eb676f2fd Merge pull request #190 from wader/bump-golang-1.22.5
Update golang to 1.22.5 from 1.22.4
2024-07-03 18:12:54 +02:00
dfbb1770e4 Merge pull request #191 from wader/bump-yt-dlp-2024.07.02
Update yt-dlp to 2024.07.02 from 2024.07.01
2024-07-03 18:06:42 +02:00
3004939371 Update yt-dlp to 2024.07.02 from 2024.07.01
Release notes https://github.com/yt-dlp/yt-dlp/releases/tag/2024.07.02
2024-07-03 16:02:16 +00:00
79030f02cf Update golang to 1.22.5 from 1.22.4
Release notes https://golang.org/doc/devel/release.html
2024-07-03 16:02:14 +00:00
b861e6f3a2 Merge pull request #189 from wader/bump-yt-dlp-2024.07.01
Update yt-dlp to 2024.07.01 from 2024.05.27
2024-07-02 18:13:31 +02:00
cb86a6c681 Update yt-dlp to 2024.07.01 from 2024.05.27
Release notes https://github.com/yt-dlp/yt-dlp/releases/tag/2024.07.01
2024-07-02 16:02:03 +00:00
0ca6990373 Run CI on PR or master push
Previously two CI jobs were done for each PR
2024-06-26 09:11:25 +02:00
8cef76d0c0 Merge pull request #188 from wader/use-cache-and-netrc
Remove --no-cahce-dir and add --netrc
2024-06-26 09:06:46 +02:00
cad168222b Remove --no-cahce-dir and add --netrc
--no-cache-dir was probably added in the belif to prevent storing big cache files
but it seems to be extractor session data to speed up auth etc.
--netrc is now default so that yt-dlp plugins works better

Fixes #187
2024-06-26 09:00:49 +02:00
8598c9e6bb Merge pull request #186 from wader/bump-golang-1.22.4
Update golang to 1.22.4 from 1.22.3
2024-06-05 18:51:52 +02:00
5cb220b4d7 Update golang to 1.22.4 from 1.22.3
Release notes https://golang.org/doc/devel/release.html
2024-06-05 16:02:02 +00:00
74fbd541cd Merge pull request #185 from wader/bump-yt-dlp-2024.05.27
Update yt-dlp to 2024.05.27 from 2024.05.26
2024-05-28 18:12:42 +02:00
4dfa55bcfd Update yt-dlp to 2024.05.27 from 2024.05.26
Release notes https://github.com/yt-dlp/yt-dlp/releases/tag/2024.05.27
2024-05-28 16:02:04 +00:00
fdbd42f666 Merge pull request #184 from wader/bump-yt-dlp-2024.05.26
Update yt-dlp to 2024.05.26 from 2024.04.09
2024-05-27 18:32:10 +02:00
2ac97f392a Update yt-dlp to 2024.05.26 from 2024.04.09
Release notes https://github.com/yt-dlp/yt-dlp/releases/tag/2024.05.26
2024-05-27 16:02:07 +00:00
aba4746463 Merge pull request #183 from wader/bump-golang-1.22.3
Update golang to 1.22.3 from 1.22.2
2024-05-09 00:00:59 +02:00
1fdc3448b1 Update golang to 1.22.3 from 1.22.2
Release notes https://golang.org/doc/devel/release.html
2024-05-08 16:02:12 +00:00
598fce21e7 Merge pull request #182 from wader/bump-yt-dlp-2024.04.09
Update yt-dlp to 2024.04.09 from 2024.03.10
2024-04-10 18:32:30 +02:00
ff8aaa0333 Update yt-dlp to 2024.04.09 from 2024.03.10
Release notes https://github.com/yt-dlp/yt-dlp/releases/tag/2024.04.09
2024-04-10 16:02:06 +00:00
7b1a15b73a Merge pull request #181 from wader/bump-golang-1.22.2
Update golang to 1.22.2 from 1.22.1
2024-04-04 18:15:12 +02:00
24fd49fe06 Update golang to 1.22.2 from 1.22.1
Release notes https://golang.org/doc/devel/release.html
2024-04-04 16:02:18 +00:00
4 changed files with 67 additions and 18 deletions

View File

@ -1,6 +1,10 @@
name: Build on push and PRs
on: [push,pull_request]
on:
push:
branches:
- "master"
pull_request:
jobs:
build:

View File

@ -1,9 +1,9 @@
# bump: golang /GOLANG_VERSION=([\d.]+)/ docker:golang|^1
# bump: golang link "Release notes" https://golang.org/doc/devel/release.html
ARG GOLANG_VERSION=1.22.1
ARG GOLANG_VERSION=1.23.1
# 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
ARG YT_DLP=2024.03.10
ARG YT_DLP=2024.08.06
FROM golang:$GOLANG_VERSION AS base
ARG YT_DLP

View File

@ -53,6 +53,16 @@ func main() {
See [goutubedl cmd tool](cmd/goutubedl/main.go) or [ydls](https://github.com/wader/ydls)
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
```sh

View File

@ -217,14 +217,17 @@ var TypeFromString = map[string]Type{
// Options for New()
type Options struct {
Type Type
PlaylistStart uint // --playlist-start
PlaylistEnd uint // --playlist-end
Downloader string // --downloader
DownloadThumbnail bool
DownloadSubtitles bool
DownloadSections string // --download-sections
Type Type
PlaylistStart uint // --playlist-start
PlaylistEnd uint // --playlist-end
Downloader string // --downloader
DownloadThumbnail bool
DownloadSubtitles bool
DownloadSections string // --download-sections
ProxyUrl string // --proxy URL http://host:port or socks5://host:port
UseIPV4 bool // -4 Make all connections via IPv4
Cookies string // --cookies FILE
CookiesFromBrowser string // --cookies-from-browser BROWSER[:FOLDER]
DebugLog Printer
StderrFn func(cmd *exec.Cmd) io.Writer // if not nil, function to get Writer for stderr
@ -304,23 +307,35 @@ func infoFromURL(
ProbePath(),
// see comment below about ignoring errors for playlists
"--ignore-errors",
// TODO: deprecated in yt-dlp?
"--no-call-home",
"--no-cache-dir",
"--skip-download",
// use safer output filenmaes
// TODO: needed?
"--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", "-",
"-J",
// dump info json
"--dump-single-json",
)
if options.ProxyUrl != "" {
cmd.Args = append(cmd.Args, "--proxy", options.ProxyUrl)
}
if options.UseIPV4 {
cmd.Args = append(cmd.Args, "-4")
}
if options.Downloader != "" {
cmd.Args = append(cmd.Args, "--downloader", options.Downloader)
}
if options.Cookies != "" {
cmd.Args = append(cmd.Args, "--cookies", options.Cookies)
}
if options.CookiesFromBrowser != "" {
cmd.Args = append(cmd.Args, "--cookies-from-browser", options.CookiesFromBrowser)
}
@ -513,6 +528,8 @@ func (result Result) Download(ctx context.Context, filter string) (*DownloadResu
}
type DownloadOptions struct {
AudioFormats string // --audio-formats Download audio using formats (best, aac, alac, flac, m4a, mp3, opus, vorbis, wav)
DownloadAudioOnly bool // -x Download audio only from video
// Download format matched by filter (usually a format id or quality designator).
// If filter is empty, then youtube-dl will use its default format selector.
Filter string
@ -559,12 +576,19 @@ func (result Result) DownloadWithOptions(
cmd := exec.CommandContext(
ctx,
ProbePath(),
"--no-call-home",
"--no-cache-dir",
// see comment below about ignoring errors for playlists
"--ignore-errors",
// TODO: deprecated in yt-dlp?
"--no-call-home",
// use non-fancy progress bar
"--newline",
// use safer output filenmaes
// TODO: needed?
"--restrict-filenames",
"-o", "-",
// use .netrc authentication data
"--netrc",
// write to stdout
"--output", "-",
)
if result.Options.noInfoDownload {
@ -593,7 +617,10 @@ func (result Result) DownloadWithOptions(
} else {
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
// also seems to be issues when using filter with generic extractor
if !result.Info.Direct && options.Filter != "" {
@ -604,6 +631,14 @@ func (result Result) DownloadWithOptions(
cmd.Args = append(cmd.Args, "--playlist-items", fmt.Sprint(options.PlaylistIndex))
}
if options.DownloadAudioOnly {
cmd.Args = append(cmd.Args, "-x")
}
if options.AudioFormats != "" {
cmd.Args = append(cmd.Args, "--audio-format", options.AudioFormats)
}
if result.Options.ProxyUrl != "" {
cmd.Args = append(cmd.Args, "--proxy", result.Options.ProxyUrl)
}