instructions for YAML options
This commit is contained in:
34
README.md
34
README.md
@@ -68,6 +68,31 @@ python3 -m bdfr download ./path/to/output --subreddit 'Python, all, mindustry' -
|
|||||||
python3 -m bdfr archive ./path/to/output --subreddit all --format yaml -L 500 --folder-scheme ''
|
python3 -m bdfr archive ./path/to/output --subreddit all --format yaml -L 500 --folder-scheme ''
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Alternatively, you can pass options through a YAML file.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 -m bdfr download ./path/to/output --opts my_opts.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
For example, running it with the following file
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
skip: [mp4, avi]
|
||||||
|
file_scheme: "{UPVOTES}_{REDDITOR}_{POSTID}_{DATE}"
|
||||||
|
limit: 10
|
||||||
|
sort: top
|
||||||
|
subreddit:
|
||||||
|
- EarthPorn
|
||||||
|
- CityPorn
|
||||||
|
```
|
||||||
|
|
||||||
|
would be equilavent to (take note that in YAML there is `file_scheme` instead of `file-scheme`):
|
||||||
|
```bash
|
||||||
|
python3 -m bdfr download ./path/to/output --skip mp4 --skip avi --file-scheme "{UPVOTES}_{REDDITOR}_{POSTID}_{DATE}" -L 10 -S top --subreddit EarthPorn --subreddit CityPorn
|
||||||
|
```
|
||||||
|
|
||||||
|
In case when the same option is specified both in the YAML file and in as a command line argument, the command line argument takes prs
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
The following options are common between both the `archive` and `download` commands of the BDFR.
|
The following options are common between both the `archive` and `download` commands of the BDFR.
|
||||||
@@ -80,6 +105,10 @@ The following options are common between both the `archive` and `download` comma
|
|||||||
- `--config`
|
- `--config`
|
||||||
- If the path to a configuration file is supplied with this option, the BDFR will use the specified config
|
- If the path to a configuration file is supplied with this option, the BDFR will use the specified config
|
||||||
- See [Configuration Files](#configuration) for more details
|
- See [Configuration Files](#configuration) for more details
|
||||||
|
- `--opts`
|
||||||
|
- Load options from a YAML file.
|
||||||
|
- Has higher prority than the global config file but lower than command-line arguments.
|
||||||
|
- See [opts_example.yaml](./opts_example.yaml) for an example file.
|
||||||
- `--disable-module`
|
- `--disable-module`
|
||||||
- Can be specified multiple times
|
- Can be specified multiple times
|
||||||
- Disables certain modules from being used
|
- Disables certain modules from being used
|
||||||
@@ -221,7 +250,10 @@ The `clone` command can take all the options listed above for both the `archive`
|
|||||||
|
|
||||||
## Common Command Tricks
|
## Common Command Tricks
|
||||||
|
|
||||||
A common use case is for subreddits/users to be loaded from a file. The BDFR doesn't support this directly but it is simple enough to do through the command-line. Consider a list of usernames to download; they can be passed through to the BDFR with the following command, assuming that the usernames are in a text file:
|
A common use case is for subreddits/users to be loaded from a file. The BDFR supports this via YAML file options (`--opts my_opts.yaml`).
|
||||||
|
|
||||||
|
Alternatively, you can use the command-line [xargs](https://en.wikipedia.org/wiki/Xargs) function.
|
||||||
|
For a list of users `users.txt` (one user per line), type:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cat users.txt | xargs -L 1 echo --user | xargs -L 50 python3 -m bdfr download <ARGS>
|
cat users.txt | xargs -L 1 echo --user | xargs -L 50 python3 -m bdfr download <ARGS>
|
||||||
|
|||||||
Reference in New Issue
Block a user