Merge pull request #188 from wader/use-cache-and-netrc
Remove --no-cahce-dir and add --netrc
This commit is contained in:
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
|
||||||
|
25
goutubedl.go
25
goutubedl.go
@ -304,13 +304,17 @@ 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 != "" {
|
||||||
@ -559,12 +563,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 {
|
||||||
|
Reference in New Issue
Block a user