From a1df43f83a022d7198c33aa3484d634c810d9a06 Mon Sep 17 00:00:00 2001 From: Anatoly Date: Mon, 12 Apr 2021 22:45:10 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Format=20selection=20argument?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++++ main.py | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bb04e98..a950462 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,11 @@ 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: ```bash python main.py -a diff --git a/main.py b/main.py index 89912a3..ece8fb7 100644 --- a/main.py +++ b/main.py @@ -41,12 +41,15 @@ parser.add_argument('-o', '--output', action='store', type=str, help='Output folder.') parser.add_argument('-a', '--all', action='store_true', 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() json_input = args.input output_dir = args.output or 'output' download_all = args.all +dl_format = args.format c = Console() @@ -65,7 +68,7 @@ def prg_hook(d): ydl_opts = { - 'format': 'best', + 'format': dl_format, 'ignoreerrors': True, 'continuedl': True, 'quiet': True,