Add console entry point for pipx support
Adds support for pipx with console entry point. closes #702
This commit is contained in:
parent
ad12fc1b7a
commit
175513fbb7
57
README.md
57
README.md
|
@ -1,4 +1,5 @@
|
|||
# Bulk Downloader for Reddit
|
||||
|
||||
[![PyPI version](https://img.shields.io/pypi/v/bdfr.svg)](https://pypi.python.org/pypi/bdfr)
|
||||
[![PyPI downloads](https://img.shields.io/pypi/dm/bdfr)](https://pypi.python.org/pypi/bdfr)
|
||||
[![Python Test](https://github.com/aliparlakci/bulk-downloader-for-reddit/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/aliparlakci/bulk-downloader-for-reddit/actions/workflows/test.yml)
|
||||
|
@ -10,19 +11,30 @@ If you wish to open an issue, please read [the guide on opening issues](docs/CON
|
|||
Included in this README are a few example Bash tricks to get certain behaviour. For that, see [Common Command Tricks](#common-command-tricks).
|
||||
|
||||
## Installation
|
||||
*Bulk Downloader for Reddit* needs Python version 3.9 or above. Please update Python before installation to meet the requirement. Then, you can install it as such:
|
||||
|
||||
*Bulk Downloader for Reddit* needs Python version 3.9 or above. Please update Python before installation to meet the requirement. Then, you can install it via pip with:
|
||||
|
||||
```bash
|
||||
python3 -m pip install bdfr --upgrade
|
||||
```
|
||||
|
||||
or with [pipx](https://pypa.github.io/pipx) with:
|
||||
|
||||
```bash
|
||||
python3 -m pipx install bdfr --upgrade
|
||||
```
|
||||
|
||||
**To update BDFR**, run the above command again after the installation.
|
||||
|
||||
### AUR Package
|
||||
|
||||
If on Arch Linux or derivative operating systems such as Manjaro, the BDFR can be installed through the AUR.
|
||||
|
||||
- Latest Release: https://aur.archlinux.org/packages/python-bdfr/
|
||||
- Latest Development Build: https://aur.archlinux.org/packages/python-bdfr-git/
|
||||
- Latest Release: <https://aur.archlinux.org/packages/python-bdfr>
|
||||
- Latest Development Build: <https://aur.archlinux.org/packages/python-bdfr-git>
|
||||
|
||||
### Source code
|
||||
|
||||
If you want to use the source code or make contributions, refer to [CONTRIBUTING](docs/CONTRIBUTING.md#preparing-the-environment-for-development)
|
||||
|
||||
## Usage
|
||||
|
@ -36,42 +48,47 @@ Note that the `clone` command is not a true, failthful clone of Reddit. It simpl
|
|||
After installation, run the program from any directory as shown below:
|
||||
|
||||
```bash
|
||||
python3 -m bdfr download
|
||||
bdfr download
|
||||
```
|
||||
|
||||
```bash
|
||||
python3 -m bdfr archive
|
||||
bdfr archive
|
||||
```
|
||||
|
||||
```bash
|
||||
python3 -m bdfr clone
|
||||
bdfr clone
|
||||
```
|
||||
|
||||
However, these commands are not enough. You should chain parameters in [Options](#options) according to your use case. Don't forget that some parameters can be provided multiple times. Some quick reference commands are:
|
||||
|
||||
```bash
|
||||
python3 -m bdfr download ./path/to/output --subreddit Python -L 10
|
||||
bdfr download ./path/to/output --subreddit Python -L 10
|
||||
```
|
||||
|
||||
```bash
|
||||
python3 -m bdfr download ./path/to/output --user reddituser --submitted -L 100
|
||||
bdfr download ./path/to/output --user reddituser --submitted -L 100
|
||||
```
|
||||
|
||||
```bash
|
||||
python3 -m bdfr download ./path/to/output --user reddituser --submitted --all-comments --comment-context
|
||||
bdfr download ./path/to/output --user me --saved --authenticate -L 25 --file-scheme '{POSTID}'
|
||||
```
|
||||
|
||||
```bash
|
||||
python3 -m bdfr download ./path/to/output --user me --saved --authenticate -L 25 --file-scheme '{POSTID}'
|
||||
bdfr download ./path/to/output --subreddit 'Python, all, mindustry' -L 10 --make-hard-links
|
||||
```
|
||||
|
||||
```bash
|
||||
python3 -m bdfr download ./path/to/output --subreddit 'Python, all, mindustry' -L 10 --make-hard-links
|
||||
bdfr archive ./path/to/output --user reddituser --submitted --all-comments --comment-context
|
||||
```
|
||||
|
||||
```bash
|
||||
python3 -m bdfr archive ./path/to/output --subreddit all --format yaml -L 500 --folder-scheme ''
|
||||
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
|
||||
bdfr download ./path/to/output --opts my_opts.yaml
|
||||
```
|
||||
|
||||
For example, running it with the following file
|
||||
|
@ -87,8 +104,9 @@ subreddit:
|
|||
```
|
||||
|
||||
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
|
||||
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
|
||||
|
@ -237,7 +255,6 @@ The following options apply only to the `download` command. This command downloa
|
|||
- `--max-score-ratio`
|
||||
- This skips all submissions which have higher than specified upvote ratio
|
||||
|
||||
|
||||
### Archiver Options
|
||||
|
||||
The following options are for the `archive` command specifically.
|
||||
|
@ -266,7 +283,7 @@ Alternatively, you can use the command-line [xargs](https://en.wikipedia.org/wik
|
|||
For a list of users `users.txt` (one user per line), type:
|
||||
|
||||
```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 bdfr download <ARGS>
|
||||
```
|
||||
|
||||
The part `-L 50` is to make sure that the character limit for a single line isn't exceeded, but may not be necessary. This can also be used to load subreddits from a file, simply exchange `--user` with `--subreddit` and so on.
|
||||
|
@ -360,12 +377,16 @@ The individual modules of the BDFR, used to download submissions from websites,
|
|||
Modules can be disabled through the command line interface for the BDFR or more permanently in the configuration file via the `disabled_modules` option. The list of downloaders that can be disabled are the following. Note that they are case-insensitive.
|
||||
|
||||
- `Direct`
|
||||
- `DelayForReddit`
|
||||
- `Erome`
|
||||
- `Gallery` (Reddit Image Galleries)
|
||||
- `Gfycat`
|
||||
- `Imgur`
|
||||
- `PornHub`
|
||||
- `Redgifs`
|
||||
- `SelfPost` (Reddit Text Post)
|
||||
- `Vidble`
|
||||
- `VReddit` (Reddit Video Post)
|
||||
- `Youtube`
|
||||
- `YoutubeDlFallback`
|
||||
|
||||
|
@ -394,6 +415,7 @@ The logfiles that the BDFR outputs are consistent and quite detailed and in a fo
|
|||
## List of currently supported sources
|
||||
|
||||
- Direct links (links leading to a file)
|
||||
- Delay for Reddit
|
||||
- Erome
|
||||
- Gfycat
|
||||
- Gif Delivery Network
|
||||
|
@ -402,8 +424,9 @@ The logfiles that the BDFR outputs are consistent and quite detailed and in a fo
|
|||
- Reddit Text Posts
|
||||
- Reddit Videos
|
||||
- Redgifs
|
||||
- Vidble
|
||||
- YouTube
|
||||
- Streamable
|
||||
- Any source supported by [YT-DLP](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) should be compatable
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ $ python3 -m pip install -e .
|
|||
|
||||
Then, you can run the program from anywhere in your disk as such:
|
||||
```bash
|
||||
$ python3 -m bdfr
|
||||
bdfr
|
||||
```
|
||||
|
||||
## Style Guide
|
||||
|
|
|
@ -4,7 +4,7 @@ description_file = README.md
|
|||
description_content_type = text/markdown
|
||||
home_page = https://github.com/aliparlakci/bulk-downloader-for-reddit
|
||||
keywords = reddit, download, archive
|
||||
version = 2.6.0
|
||||
version = 2.6.2
|
||||
author = Ali Parlakci
|
||||
author_email = parlakciali@gmail.com
|
||||
maintainer = Serene Arc
|
||||
|
@ -20,3 +20,7 @@ platforms = any
|
|||
|
||||
[files]
|
||||
packages = bdfr
|
||||
|
||||
[entry_points]
|
||||
console_scripts =
|
||||
bdfr = bdfr.__main__:cli
|
||||
|
|
Loading…
Reference in a new issue