-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
builder.gen.go
6611 lines (6065 loc) · 192 KB
/
builder.gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) Liam Stanley <[email protected]>. All rights reserved. Use of
// this source code is governed by the MIT license that can be found in
// the LICENSE file.
//
// Code generated by cmd/codegen. DO NOT EDIT.
package ytdlp
import (
"context"
"strconv"
)
// Print program version and exit
//
// Additional information:
// - Version maps to cli flags: --version.
// - From option group: "General"
func (c *Command) Version(ctx context.Context) (*Result, error) {
c.addFlag(&Flag{
ID: "",
Flag: "--version",
Args: nil,
})
return c.runWithResult(c.buildCommand(ctx))
}
// Check if updates are available. You cannot update when running from source code;
// Use git to pull the latest changes
//
// References:
// - Update Notes: https://github.com/yt-dlp/yt-dlp/blob/2024.11.18/README.md#update
//
// Additional information:
// - Update maps to cli flags: -U/--update.
// - From option group: "General"
func (c *Command) Update(ctx context.Context) (*Result, error) {
c.addFlag(&Flag{
ID: "update_self",
Flag: "--update",
Args: nil,
})
return c.runWithResult(c.buildCommand(ctx))
}
// Do not check for updates (default)
//
// Additional information:
// - See [Command.UnsetUpdate], for unsetting the flag.
// - NoUpdate maps to cli flags: --no-update.
// - From option group: "General"
func (c *Command) NoUpdate() *Command {
c.addFlag(&Flag{
ID: "update_self",
Flag: "--no-update",
Args: nil,
})
return c
}
// UnsetUpdate unsets any flags that were previously set by one of:
// - [Command.NoUpdate]
func (c *Command) UnsetUpdate() *Command {
c.removeFlagByID("update_self")
return c
}
// Upgrade/downgrade to a specific version. CHANNEL can be a repository as well.
// CHANNEL and TAG default to "stable" and "latest" respectively if omitted; See
// "UPDATE" for details. Supported channels: stable, nightly, master
//
// References:
// - Update Notes: https://github.com/yt-dlp/yt-dlp/blob/2024.11.18/README.md#update
//
// Additional information:
// - UpdateTo maps to cli flags: --update-to=[CHANNEL]@[TAG].
// - From option group: "General"
func (c *Command) UpdateTo(ctx context.Context, value string) (*Result, error) {
c.addFlag(&Flag{
ID: "update_self",
Flag: "--update-to",
Args: []string{value},
})
return c.runWithResult(c.buildCommand(ctx))
}
// Ignore download and postprocessing errors. The download will be considered
// successful even if the postprocessing fails
//
// Additional information:
// - See [Command.UnsetIgnoreErrors], for unsetting the flag.
// - IgnoreErrors maps to cli flags: -i/--ignore-errors.
// - From option group: "General"
func (c *Command) IgnoreErrors() *Command {
c.addFlag(&Flag{
ID: "ignoreerrors",
Flag: "--ignore-errors",
Args: nil,
})
return c
}
// UnsetIgnoreErrors unsets any flags that were previously set by one of:
// - [Command.IgnoreErrors]
func (c *Command) UnsetIgnoreErrors() *Command {
c.removeFlagByID("ignoreerrors")
return c
}
// Continue with next video on download errors; e.g. to skip unavailable videos in
// a playlist (default)
//
// Additional information:
// - See [Command.UnsetAbortOnError], for unsetting the flag.
// - NoAbortOnError maps to cli flags: --no-abort-on-error.
// - From option group: "General"
func (c *Command) NoAbortOnError() *Command {
c.addFlag(&Flag{
ID: "ignoreerrors",
Flag: "--no-abort-on-error",
Args: nil,
})
return c
}
// UnsetAbortOnError unsets any flags that were previously set by one of:
// - [Command.NoAbortOnError]
// - [Command.AbortOnError]
func (c *Command) UnsetAbortOnError() *Command {
c.removeFlagByID("ignoreerrors")
return c
}
// Abort downloading of further videos if an error occurs
//
// Additional information:
// - See [Command.UnsetAbortOnError], for unsetting the flag.
// - AbortOnError maps to cli flags: --abort-on-error/--no-ignore-errors.
// - From option group: "General"
func (c *Command) AbortOnError() *Command {
c.addFlag(&Flag{
ID: "ignoreerrors",
Flag: "--abort-on-error",
Args: nil,
})
return c
}
// Display the current user-agent and exit
//
// Additional information:
// - DumpUserAgent maps to cli flags: --dump-user-agent.
// - From option group: "General"
func (c *Command) DumpUserAgent(ctx context.Context) (*Result, error) {
c.addFlag(&Flag{
ID: "dump_user_agent",
Flag: "--dump-user-agent",
Args: nil,
})
return c.runWithResult(c.buildCommand(ctx))
}
// List all supported extractors and exit
//
// Additional information:
// - ListExtractors maps to cli flags: --list-extractors.
// - From option group: "General"
func (c *Command) ListExtractors(ctx context.Context) (*Result, error) {
c.addFlag(&Flag{
ID: "list_extractors",
Flag: "--list-extractors",
Args: nil,
})
return c.runWithResult(c.buildCommand(ctx))
}
// Output descriptions of all supported extractors and exit
//
// Additional information:
// - ExtractorDescriptions maps to cli flags: --extractor-descriptions.
// - From option group: "General"
func (c *Command) ExtractorDescriptions(ctx context.Context) (*Result, error) {
c.addFlag(&Flag{
ID: "list_extractor_descriptions",
Flag: "--extractor-descriptions",
Args: nil,
})
return c.runWithResult(c.buildCommand(ctx))
}
// Extractor names to use separated by commas. You can also use regexes, "all",
// "default" and "end" (end URL matching); e.g. --ies "holodex.*,end,youtube".
// Prefix the name with a "-" to exclude it, e.g. --ies default,-generic. Use
// --list-extractors for a list of extractor names.
//
// Additional information:
// - See [Command.UnsetUseExtractors], for unsetting the flag.
// - UseExtractors maps to cli flags: --use-extractors/--ies=NAMES.
// - From option group: "General"
func (c *Command) UseExtractors(names string) *Command {
c.addFlag(&Flag{
ID: "allowed_extractors",
Flag: "--use-extractors",
Args: []string{names},
})
return c
}
// UnsetUseExtractors unsets any flags that were previously set by one of:
// - [Command.UseExtractors]
func (c *Command) UnsetUseExtractors() *Command {
c.removeFlagByID("allowed_extractors")
return c
}
// ForceGenericExtractor sets the "force-generic-extractor" flag (no description specified).
//
// Additional information:
// - See [Command.UnsetForceGenericExtractor], for unsetting the flag.
// - ForceGenericExtractor maps to cli flags: --force-generic-extractor (hidden).
// - From option group: "General"
func (c *Command) ForceGenericExtractor() *Command {
c.addFlag(&Flag{
ID: "force_generic_extractor",
Flag: "--force-generic-extractor",
Args: nil,
})
return c
}
// UnsetForceGenericExtractor unsets any flags that were previously set by one of:
// - [Command.ForceGenericExtractor]
func (c *Command) UnsetForceGenericExtractor() *Command {
c.removeFlagByID("force_generic_extractor")
return c
}
// Use this prefix for unqualified URLs. E.g. "gvsearch2:python" downloads two
// videos from google videos for the search term "python". Use the value "auto" to
// let yt-dlp guess ("auto_warning" to emit a warning when guessing). "error" just
// throws an error. The default value "fixup_error" repairs broken URLs, but emits
// an error if this is not possible instead of searching
//
// Additional information:
// - See [Command.UnsetDefaultSearch], for unsetting the flag.
// - DefaultSearch maps to cli flags: --default-search=PREFIX.
// - From option group: "General"
func (c *Command) DefaultSearch(prefix string) *Command {
c.addFlag(&Flag{
ID: "default_search",
Flag: "--default-search",
Args: []string{prefix},
})
return c
}
// UnsetDefaultSearch unsets any flags that were previously set by one of:
// - [Command.DefaultSearch]
func (c *Command) UnsetDefaultSearch() *Command {
c.removeFlagByID("default_search")
return c
}
// Don't load any more configuration files except those given to
// --config-locations. For backward compatibility, if this option is found inside
// the system configuration file, the user configuration is not loaded.
//
// Additional information:
// - See [Command.UnsetIgnoreConfig], for unsetting the flag.
// - IgnoreConfig maps to cli flags: --ignore-config/--no-config.
// - From option group: "General"
func (c *Command) IgnoreConfig() *Command {
c.addFlag(&Flag{
ID: "ignoreconfig",
Flag: "--ignore-config",
Args: nil,
})
return c
}
// UnsetIgnoreConfig unsets any flags that were previously set by one of:
// - [Command.IgnoreConfig]
func (c *Command) UnsetIgnoreConfig() *Command {
c.removeFlagByID("ignoreconfig")
return c
}
// Do not load any custom configuration files (default). When given inside a
// configuration file, ignore all previous --config-locations defined in the
// current file
//
// Additional information:
// - See [Command.UnsetConfigLocations], for unsetting the flag.
// - NoConfigLocations maps to cli flags: --no-config-locations.
// - From option group: "General"
func (c *Command) NoConfigLocations() *Command {
c.addFlag(&Flag{
ID: "config_locations",
Flag: "--no-config-locations",
Args: nil,
})
return c
}
// UnsetConfigLocations unsets any flags that were previously set by one of:
// - [Command.NoConfigLocations]
// - [Command.ConfigLocations]
func (c *Command) UnsetConfigLocations() *Command {
c.removeFlagByID("config_locations")
return c
}
// Location of the main configuration file; either the path to the config or its
// containing directory ("-" for stdin). Can be used multiple times and inside
// other configuration files
//
// Additional information:
// - See [Command.UnsetConfigLocations], for unsetting the flag.
// - ConfigLocations maps to cli flags: --config-locations=PATH.
// - From option group: "General"
func (c *Command) ConfigLocations(path string) *Command {
c.addFlag(&Flag{
ID: "config_locations",
Flag: "--config-locations",
Args: []string{path},
})
return c
}
// Path to an additional directory to search for plugins. This option can be used
// multiple times to add multiple directories. Note that this currently only works
// for extractor plugins; postprocessor plugins can only be loaded from the default
// plugin directories
//
// Additional information:
// - See [Command.UnsetPluginDirs], for unsetting the flag.
// - PluginDirs maps to cli flags: --plugin-dirs=PATH.
// - From option group: "General"
func (c *Command) PluginDirs(path string) *Command {
c.addFlag(&Flag{
ID: "plugin_dirs",
Flag: "--plugin-dirs",
Args: []string{path},
})
return c
}
// UnsetPluginDirs unsets any flags that were previously set by one of:
// - [Command.PluginDirs]
func (c *Command) UnsetPluginDirs() *Command {
c.removeFlagByID("plugin_dirs")
return c
}
// Do not extract a playlist's URL result entries; some entry metadata may be
// missing and downloading may be bypassed
//
// Additional information:
// - See [Command.UnsetFlatPlaylist], for unsetting the flag.
// - FlatPlaylist maps to cli flags: --flat-playlist.
// - From option group: "General"
func (c *Command) FlatPlaylist() *Command {
c.addFlag(&Flag{
ID: "extract_flat",
Flag: "--flat-playlist",
Args: nil,
})
return c
}
// UnsetFlatPlaylist unsets any flags that were previously set by one of:
// - [Command.FlatPlaylist]
// - [Command.NoFlatPlaylist]
func (c *Command) UnsetFlatPlaylist() *Command {
c.removeFlagByID("extract_flat")
return c
}
// Fully extract the videos of a playlist (default)
//
// Additional information:
// - See [Command.UnsetFlatPlaylist], for unsetting the flag.
// - NoFlatPlaylist maps to cli flags: --no-flat-playlist.
// - From option group: "General"
func (c *Command) NoFlatPlaylist() *Command {
c.addFlag(&Flag{
ID: "extract_flat",
Flag: "--no-flat-playlist",
Args: nil,
})
return c
}
// Download livestreams from the start. Currently only supported for YouTube
// (Experimental)
//
// Additional information:
// - See [Command.UnsetLiveFromStart], for unsetting the flag.
// - LiveFromStart maps to cli flags: --live-from-start.
// - From option group: "General"
func (c *Command) LiveFromStart() *Command {
c.addFlag(&Flag{
ID: "live_from_start",
Flag: "--live-from-start",
Args: nil,
})
return c
}
// UnsetLiveFromStart unsets any flags that were previously set by one of:
// - [Command.LiveFromStart]
// - [Command.NoLiveFromStart]
func (c *Command) UnsetLiveFromStart() *Command {
c.removeFlagByID("live_from_start")
return c
}
// Download livestreams from the current time (default)
//
// Additional information:
// - See [Command.UnsetLiveFromStart], for unsetting the flag.
// - NoLiveFromStart maps to cli flags: --no-live-from-start.
// - From option group: "General"
func (c *Command) NoLiveFromStart() *Command {
c.addFlag(&Flag{
ID: "live_from_start",
Flag: "--no-live-from-start",
Args: nil,
})
return c
}
// Wait for scheduled streams to become available. Pass the minimum number of
// seconds (or range) to wait between retries
//
// Additional information:
// - See [Command.UnsetWaitForVideo], for unsetting the flag.
// - WaitForVideo maps to cli flags: --wait-for-video=MIN[-MAX].
// - From option group: "General"
func (c *Command) WaitForVideo(min string) *Command {
c.addFlag(&Flag{
ID: "wait_for_video",
Flag: "--wait-for-video",
Args: []string{min},
})
return c
}
// UnsetWaitForVideo unsets any flags that were previously set by one of:
// - [Command.WaitForVideo]
// - [Command.NoWaitForVideo]
func (c *Command) UnsetWaitForVideo() *Command {
c.removeFlagByID("wait_for_video")
return c
}
// Do not wait for scheduled streams (default)
//
// Additional information:
// - See [Command.UnsetWaitForVideo], for unsetting the flag.
// - NoWaitForVideo maps to cli flags: --no-wait-for-video.
// - From option group: "General"
func (c *Command) NoWaitForVideo() *Command {
c.addFlag(&Flag{
ID: "wait_for_video",
Flag: "--no-wait-for-video",
Args: nil,
})
return c
}
// Mark videos watched (even with --simulate)
//
// Additional information:
// - See [Command.UnsetMarkWatched], for unsetting the flag.
// - MarkWatched maps to cli flags: --mark-watched.
// - From option group: "General"
func (c *Command) MarkWatched() *Command {
c.addFlag(&Flag{
ID: "mark_watched",
Flag: "--mark-watched",
Args: nil,
})
return c
}
// UnsetMarkWatched unsets any flags that were previously set by one of:
// - [Command.MarkWatched]
// - [Command.NoMarkWatched]
func (c *Command) UnsetMarkWatched() *Command {
c.removeFlagByID("mark_watched")
return c
}
// Do not mark videos watched (default)
//
// Additional information:
// - See [Command.UnsetMarkWatched], for unsetting the flag.
// - NoMarkWatched maps to cli flags: --no-mark-watched.
// - From option group: "General"
func (c *Command) NoMarkWatched() *Command {
c.addFlag(&Flag{
ID: "mark_watched",
Flag: "--no-mark-watched",
Args: nil,
})
return c
}
// NoColors sets the "no-colors" flag (no description specified).
//
// Additional information:
// - See [Command.UnsetColors], for unsetting the flag.
// - NoColors maps to cli flags: --no-colors/--no-colours (hidden).
// - From option group: "General"
func (c *Command) NoColors() *Command {
c.addFlag(&Flag{
ID: "color",
Flag: "--no-colors",
Args: nil,
})
return c
}
// UnsetColors unsets any flags that were previously set by one of:
// - [Command.NoColors]
func (c *Command) UnsetColors() *Command {
c.removeFlagByID("color")
return c
}
// Whether to emit color codes in output, optionally prefixed by the STREAM (stdout
// or stderr) to apply the setting to. Can be one of "always", "auto" (default),
// "never", or "no_color" (use non color terminal sequences). Use "auto-tty" or
// "no_color-tty" to decide based on terminal support only. Can be used multiple
// times
//
// Additional information:
// - See [Command.UnsetColor], for unsetting the flag.
// - Color maps to cli flags: --color=[STREAM:]POLICY.
// - From option group: "General"
func (c *Command) Color(policy string) *Command {
c.addFlag(&Flag{
ID: "color",
Flag: "--color",
Args: []string{policy},
})
return c
}
// UnsetColor unsets any flags that were previously set by one of:
// - [Command.Color]
func (c *Command) UnsetColor() *Command {
c.removeFlagByID("color")
return c
}
// Options that can help keep compatibility with youtube-dl or youtube-dlc
// configurations by reverting some of the changes made in yt-dlp. See "Differences
// in default behavior" for details
//
// References:
// - Compatibility Options: https://github.com/yt-dlp/yt-dlp/blob/2024.11.18/README.md#differences-in-default-behavior
//
// Additional information:
// - See [Command.UnsetCompatOptions], for unsetting the flag.
// - CompatOptions maps to cli flags: --compat-options=OPTS.
// - From option group: "General"
func (c *Command) CompatOptions(opts string) *Command {
c.addFlag(&Flag{
ID: "compat_opts",
Flag: "--compat-options",
Args: []string{opts},
})
return c
}
// UnsetCompatOptions unsets any flags that were previously set by one of:
// - [Command.CompatOptions]
func (c *Command) UnsetCompatOptions() *Command {
c.removeFlagByID("compat_opts")
return c
}
// Use the specified HTTP/HTTPS/SOCKS proxy. To enable SOCKS proxy, specify a
// proper scheme, e.g. socks5://user:[email protected]:1080/. Pass in an empty string
// (--proxy "") for direct connection
//
// Additional information:
// - See [Command.UnsetProxy], for unsetting the flag.
// - Proxy maps to cli flags: --proxy=URL.
// - From option group: "Network"
func (c *Command) Proxy(url string) *Command {
c.addFlag(&Flag{
ID: "proxy",
Flag: "--proxy",
Args: []string{url},
})
return c
}
// UnsetProxy unsets any flags that were previously set by one of:
// - [Command.Proxy]
func (c *Command) UnsetProxy() *Command {
c.removeFlagByID("proxy")
return c
}
// Time to wait before giving up, in seconds
//
// Additional information:
// - See [Command.UnsetSocketTimeout], for unsetting the flag.
// - SocketTimeout maps to cli flags: --socket-timeout=SECONDS.
// - From option group: "Network"
func (c *Command) SocketTimeout(seconds float64) *Command {
c.addFlag(&Flag{
ID: "socket_timeout",
Flag: "--socket-timeout",
Args: []string{
strconv.FormatFloat(seconds, 'g', -1, 64),
},
})
return c
}
// UnsetSocketTimeout unsets any flags that were previously set by one of:
// - [Command.SocketTimeout]
func (c *Command) UnsetSocketTimeout() *Command {
c.removeFlagByID("socket_timeout")
return c
}
// Client-side IP address to bind to
//
// Additional information:
// - See [Command.UnsetSourceAddress], for unsetting the flag.
// - SourceAddress maps to cli flags: --source-address=IP.
// - From option group: "Network"
func (c *Command) SourceAddress(ip string) *Command {
c.addFlag(&Flag{
ID: "source_address",
Flag: "--source-address",
Args: []string{ip},
})
return c
}
// UnsetSourceAddress unsets any flags that were previously set by one of:
// - [Command.SourceAddress]
func (c *Command) UnsetSourceAddress() *Command {
c.removeFlagByID("source_address")
return c
}
// Client to impersonate for requests. E.g. chrome, chrome-110, chrome:windows-10.
// Pass --impersonate="" to impersonate any client. Note that forcing impersonation
// for all requests may have a detrimental impact on download speed and stability
//
// Additional information:
// - See [Command.UnsetImpersonate], for unsetting the flag.
// - Impersonate maps to cli flags: --impersonate=CLIENT[:OS].
// - From option group: "Network"
func (c *Command) Impersonate(client string) *Command {
c.addFlag(&Flag{
ID: "impersonate",
Flag: "--impersonate",
Args: []string{client},
})
return c
}
// UnsetImpersonate unsets any flags that were previously set by one of:
// - [Command.Impersonate]
func (c *Command) UnsetImpersonate() *Command {
c.removeFlagByID("impersonate")
return c
}
// List available clients to impersonate.
//
// Additional information:
// - See [Command.UnsetListImpersonateTargets], for unsetting the flag.
// - ListImpersonateTargets maps to cli flags: --list-impersonate-targets.
// - From option group: "Network"
func (c *Command) ListImpersonateTargets() *Command {
c.addFlag(&Flag{
ID: "list_impersonate_targets",
Flag: "--list-impersonate-targets",
Args: nil,
})
return c
}
// UnsetListImpersonateTargets unsets any flags that were previously set by one of:
// - [Command.ListImpersonateTargets]
func (c *Command) UnsetListImpersonateTargets() *Command {
c.removeFlagByID("list_impersonate_targets")
return c
}
// Make all connections via IPv4
//
// Additional information:
// - See [Command.UnsetForceIPv4], for unsetting the flag.
// - ForceIPv4 maps to cli flags: -4/--force-ipv4.
// - From option group: "Network"
func (c *Command) ForceIPv4() *Command {
c.addFlag(&Flag{
ID: "source_address",
Flag: "--force-ipv4",
Args: nil,
})
return c
}
// UnsetForceIPv4 unsets any flags that were previously set by one of:
// - [Command.ForceIPv4]
func (c *Command) UnsetForceIPv4() *Command {
c.removeFlagByID("source_address")
return c
}
// Make all connections via IPv6
//
// Additional information:
// - See [Command.UnsetForceIPv6], for unsetting the flag.
// - ForceIPv6 maps to cli flags: -6/--force-ipv6.
// - From option group: "Network"
func (c *Command) ForceIPv6() *Command {
c.addFlag(&Flag{
ID: "source_address",
Flag: "--force-ipv6",
Args: nil,
})
return c
}
// UnsetForceIPv6 unsets any flags that were previously set by one of:
// - [Command.ForceIPv6]
func (c *Command) UnsetForceIPv6() *Command {
c.removeFlagByID("source_address")
return c
}
// Enable file:// URLs. This is disabled by default for security reasons.
//
// Additional information:
// - See [Command.UnsetEnableFileURLs], for unsetting the flag.
// - EnableFileURLs maps to cli flags: --enable-file-urls.
// - From option group: "Network"
func (c *Command) EnableFileURLs() *Command {
c.addFlag(&Flag{
ID: "enable_file_urls",
Flag: "--enable-file-urls",
Args: nil,
})
return c
}
// UnsetEnableFileURLs unsets any flags that were previously set by one of:
// - [Command.EnableFileURLs]
func (c *Command) UnsetEnableFileURLs() *Command {
c.removeFlagByID("enable_file_urls")
return c
}
// Use this proxy to verify the IP address for some geo-restricted sites. The
// default proxy specified by --proxy (or none, if the option is not present) is
// used for the actual downloading
//
// Additional information:
// - See [Command.UnsetGeoVerificationProxy], for unsetting the flag.
// - GeoVerificationProxy maps to cli flags: --geo-verification-proxy=URL.
// - From option group: "Geo-restriction"
func (c *Command) GeoVerificationProxy(url string) *Command {
c.addFlag(&Flag{
ID: "geo_verification_proxy",
Flag: "--geo-verification-proxy",
Args: []string{url},
})
return c
}
// UnsetGeoVerificationProxy unsets any flags that were previously set by one of:
// - [Command.GeoVerificationProxy]
func (c *Command) UnsetGeoVerificationProxy() *Command {
c.removeFlagByID("geo_verification_proxy")
return c
}
// CNVerificationProxy sets the "cn-verification-proxy" flag (no description specified).
//
// Additional information:
// - See [Command.UnsetCNVerificationProxy], for unsetting the flag.
// - CNVerificationProxy maps to cli flags: --cn-verification-proxy=URL (hidden).
// - From option group: "Geo-restriction"
//
// Deprecated: Use [Command.GeoVerificationProxy] instead.
func (c *Command) CNVerificationProxy(url string) *Command {
c.addFlag(&Flag{
ID: "cn_verification_proxy",
Flag: "--cn-verification-proxy",
Args: []string{url},
})
return c
}
// UnsetCNVerificationProxy unsets any flags that were previously set by one of:
// - [Command.CNVerificationProxy]
//
// Deprecated: Use [Command.GeoVerificationProxy] instead.
func (c *Command) UnsetCNVerificationProxy() *Command {
c.removeFlagByID("cn_verification_proxy")
return c
}
// How to fake X-Forwarded-For HTTP header to try bypassing geographic restriction.
// One of "default" (only when known to be useful), "never", an IP block in CIDR
// notation, or a two-letter ISO 3166-2 country code
//
// Additional information:
// - See [Command.UnsetXFF], for unsetting the flag.
// - XFF maps to cli flags: --xff=VALUE.
// - From option group: "Geo-restriction"
func (c *Command) XFF(value string) *Command {
c.addFlag(&Flag{
ID: "geo_bypass",
Flag: "--xff",
Args: []string{value},
})
return c
}
// UnsetXFF unsets any flags that were previously set by one of:
// - [Command.XFF]
func (c *Command) UnsetXFF() *Command {
c.removeFlagByID("geo_bypass")
return c
}
// GeoBypass sets the "geo-bypass" flag (no description specified).
//
// Additional information:
// - See [Command.UnsetGeoBypass], for unsetting the flag.
// - GeoBypass maps to cli flags: --geo-bypass (hidden).
// - From option group: "Geo-restriction"
func (c *Command) GeoBypass() *Command {
c.addFlag(&Flag{
ID: "geo_bypass",
Flag: "--geo-bypass",
Args: nil,
})
return c
}
// UnsetGeoBypass unsets any flags that were previously set by one of:
// - [Command.GeoBypass]
// - [Command.NoGeoBypass]
func (c *Command) UnsetGeoBypass() *Command {
c.removeFlagByID("geo_bypass")
return c
}
// NoGeoBypass sets the "no-geo-bypass" flag (no description specified).
//
// Additional information:
// - See [Command.UnsetGeoBypass], for unsetting the flag.
// - NoGeoBypass maps to cli flags: --no-geo-bypass (hidden).
// - From option group: "Geo-restriction"
func (c *Command) NoGeoBypass() *Command {
c.addFlag(&Flag{
ID: "geo_bypass",
Flag: "--no-geo-bypass",
Args: nil,
})
return c
}
// GeoBypassCountry sets the "geo-bypass-country" flag (no description specified).
//
// Additional information:
// - See [Command.UnsetGeoBypassCountry], for unsetting the flag.
// - GeoBypassCountry maps to cli flags: --geo-bypass-country=CODE (hidden).
// - From option group: "Geo-restriction"
func (c *Command) GeoBypassCountry(code string) *Command {
c.addFlag(&Flag{
ID: "geo_bypass",
Flag: "--geo-bypass-country",
Args: []string{code},
})
return c
}
// UnsetGeoBypassCountry unsets any flags that were previously set by one of:
// - [Command.GeoBypassCountry]
func (c *Command) UnsetGeoBypassCountry() *Command {
c.removeFlagByID("geo_bypass")
return c
}
// GeoBypassIPBlock sets the "geo-bypass-ip-block" flag (no description specified).
//
// Additional information:
// - See [Command.UnsetGeoBypassIPBlock], for unsetting the flag.
// - GeoBypassIPBlock maps to cli flags: --geo-bypass-ip-block=IP_BLOCK (hidden).
// - From option group: "Geo-restriction"
func (c *Command) GeoBypassIPBlock(ipBlock string) *Command {
c.addFlag(&Flag{
ID: "geo_bypass",
Flag: "--geo-bypass-ip-block",
Args: []string{ipBlock},
})
return c
}
// UnsetGeoBypassIPBlock unsets any flags that were previously set by one of:
// - [Command.GeoBypassIPBlock]
func (c *Command) UnsetGeoBypassIPBlock() *Command {
c.removeFlagByID("geo_bypass")
return c
}
// PlaylistStart sets the "playlist-start" flag (no description specified).
//
// Additional information:
// - See [Command.UnsetPlaylistStart], for unsetting the flag.
// - PlaylistStart maps to cli flags: --playlist-start=NUMBER (hidden).
// - From option group: "Video Selection"
func (c *Command) PlaylistStart(number int) *Command {
c.addFlag(&Flag{
ID: "playliststart",
Flag: "--playlist-start",
Args: []string{
strconv.Itoa(number),
},
})
return c
}
// UnsetPlaylistStart unsets any flags that were previously set by one of:
// - [Command.PlaylistStart]
func (c *Command) UnsetPlaylistStart() *Command {
c.removeFlagByID("playliststart")
return c
}
// PlaylistEnd sets the "playlist-end" flag (no description specified).
//
// Additional information:
// - See [Command.UnsetPlaylistEnd], for unsetting the flag.
// - PlaylistEnd maps to cli flags: --playlist-end=NUMBER (hidden).
// - From option group: "Video Selection"
func (c *Command) PlaylistEnd(number int) *Command {
c.addFlag(&Flag{
ID: "playlistend",
Flag: "--playlist-end",
Args: []string{
strconv.Itoa(number),
},
})
return c
}
// UnsetPlaylistEnd unsets any flags that were previously set by one of:
// - [Command.PlaylistEnd]
func (c *Command) UnsetPlaylistEnd() *Command {
c.removeFlagByID("playlistend")
return c
}
// Comma separated playlist_index of the items to download. You can specify a range
// using "[START]:[STOP][:STEP]". For backward compatibility, START-STOP is also
// supported. Use negative indices to count from the right and negative STEP to
// download in reverse order. E.g. "-I 1:3,7,-5::2" used on a playlist of size 15
// will download the items at index 1,2,3,7,11,13,15
//
// Additional information:
// - See [Command.UnsetPlaylistItems], for unsetting the flag.
// - PlaylistItems maps to cli flags: -I/--playlist-items=ITEM_SPEC.
// - From option group: "Video Selection"
func (c *Command) PlaylistItems(itemSpec string) *Command {
c.addFlag(&Flag{
ID: "playlist_items",
Flag: "--playlist-items",
Args: []string{itemSpec},
})
return c
}
// UnsetPlaylistItems unsets any flags that were previously set by one of:
// - [Command.PlaylistItems]
func (c *Command) UnsetPlaylistItems() *Command {
c.removeFlagByID("playlist_items")
return c