Format selection argument

This commit is contained in:
2021-04-12 22:45:10 +03:00
parent 546861cb74
commit a1df43f83a
2 changed files with 9 additions and 1 deletions

View File

@@ -52,6 +52,11 @@ python main.py
python main.py python main.py
``` ```
* Specify format [like in youtube-dl](https://github.com/ytdl-org/youtube-dl#user-content-format-selection-examples):
```bash
python main.py -f 'bestaudio/best'
```
* Download all the videos from all channels you're subscribed to: * Download all the videos from all channels you're subscribed to:
```bash ```bash
python main.py -a python main.py -a

View File

@@ -41,12 +41,15 @@ parser.add_argument('-o', '--output', action='store', type=str,
help='Output folder.') help='Output folder.')
parser.add_argument('-a', '--all', action='store_true', parser.add_argument('-a', '--all', action='store_true',
help='Download all subscriptions.') help='Download all subscriptions.')
parser.add_argument('-f', '--format', action='store', type=str, default='best',
help='Format to pass to youtube-dl. (default: best)')
args = parser.parse_args() args = parser.parse_args()
json_input = args.input json_input = args.input
output_dir = args.output or 'output' output_dir = args.output or 'output'
download_all = args.all download_all = args.all
dl_format = args.format
c = Console() c = Console()
@@ -65,7 +68,7 @@ def prg_hook(d):
ydl_opts = { ydl_opts = {
'format': 'best', 'format': dl_format,
'ignoreerrors': True, 'ignoreerrors': True,
'continuedl': True, 'continuedl': True,
'quiet': True, 'quiet': True,