mirror of
https://github.com/anatolykopyl/youtube-cdl.git
synced 2026-03-26 12:55:11 +00:00
✨ Format selection argument
This commit is contained in:
@@ -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
|
||||||
|
|||||||
5
main.py
5
main.py
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user