ytfetch 2.0.0__tar.gz → 2.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ytfetch
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: A wrapper for yt-dlp with custom simple fetching flags
5
5
  Project-URL: Homepage, https://github.com/voidsnax/ytFetch
6
6
  Author: voidsnax
@@ -12,7 +12,7 @@ Requires-Dist: colorama
12
12
  Requires-Dist: yt-dlp[curl-cffi,default]
13
13
  Description-Content-Type: text/markdown
14
14
 
15
- # ytfetch
15
+ # ytFetch
16
16
 
17
17
  **ytfetch** simplifies media downloading and playlist management by adding playlist searching, and streamlined format handling on top of the powerful [yt-dlp](https://github.com/yt-dlp/yt-dlp) engine.
18
18
 
@@ -98,6 +98,11 @@ options:
98
98
  -mp3 Extract audio only as MP3
99
99
  -audio Extract audio only
100
100
  -list [NAME] List playlist contents. Accepts values for searching across playlist
101
+
102
+ output template aliases:
103
+ -o autonumber/num -> playlist-numbered naming
104
+ -o music/song -> title + artist naming
105
+ -o default -> default naming
101
106
  ```
102
107
 
103
108
  ### Examples
@@ -1,4 +1,4 @@
1
- # ytfetch
1
+ # ytFetch
2
2
 
3
3
  **ytfetch** simplifies media downloading and playlist management by adding playlist searching, and streamlined format handling on top of the powerful [yt-dlp](https://github.com/yt-dlp/yt-dlp) engine.
4
4
 
@@ -51,6 +51,11 @@ options:
51
51
  -mp3 Extract audio only as MP3
52
52
  -audio Extract best audio
53
53
  -list [NAME] List playlist contents. Accepts values for searching across playlist
54
+
55
+ output template aliases:
56
+ -o autonumber/num -> playlist-numbered naming
57
+ -o music/song -> title + artist naming
58
+ -o default -> default naming
54
59
  ```
55
60
 
56
61
  ### Examples
@@ -1,4 +1,4 @@
1
- # ytfetch
1
+ # ytFetch
2
2
 
3
3
  **ytfetch** simplifies media downloading and playlist management by adding playlist searching, and streamlined format handling on top of the powerful [yt-dlp](https://github.com/yt-dlp/yt-dlp) engine.
4
4
 
@@ -84,6 +84,11 @@ options:
84
84
  -mp3 Extract audio only as MP3
85
85
  -audio Extract audio only
86
86
  -list [NAME] List playlist contents. Accepts values for searching across playlist
87
+
88
+ output template aliases:
89
+ -o autonumber/num -> playlist-numbered naming
90
+ -o music/song -> title + artist naming
91
+ -o default -> default naming
87
92
  ```
88
93
 
89
94
  ### Examples
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ytfetch"
7
- version = "2.0.0"
7
+ version = "2.1.0"
8
8
  description = "A wrapper for yt-dlp with custom simple fetching flags"
9
9
  authors = [
10
10
  { name = "voidsnax" }
@@ -4,7 +4,12 @@ def parse_arguments():
4
4
  parser = argparse.ArgumentParser(
5
5
  usage = "ytfetch URL ... [OPTIONS] [yt-dlp OPTIONS]",
6
6
  description="ytfetch: yt-dlp wrapper with some flexible args.",
7
- epilog = "Doc & issues: https://github.com/voidsnax/ytFetch",
7
+ epilog = ("output template aliases:\n"
8
+ "-o autonumber/num -> playlist-numbered naming\n"
9
+ "-o music/song -> title + artist naming\n"
10
+ "-o default -> default naming\n\n"
11
+ "Docs & issues: https://github.com/voidsnax/ytFetch"
12
+ ),
8
13
  formatter_class=AlignedHelpFormatter,
9
14
  allow_abbrev=False,
10
15
  add_help=False
@@ -13,17 +18,17 @@ def parse_arguments():
13
18
  parser.add_argument("-h", action="help", help="Show this help message and exit")
14
19
  parser.add_argument("--help", action="store_true", help="Show yt-dlp help message and exit")
15
20
  parser.add_argument("-q", metavar="QUALITY", nargs="?", default="default",
16
- help="Video quality (e.g., 1080, 720). Default will pick best video"
17
- )
21
+ help="Video quality (e.g., 1080, 720). Default will pick best video"
22
+ )
18
23
  parser.add_argument("-avcmp3", action="store_true",
19
- help="Download video in AVC (h.264) & audio in mp3 format"
20
- )
24
+ help="Download video in AVC (h.264) & audio in mp3 format"
25
+ )
21
26
  parser.add_argument("-mp3", action="store_true", help="Extract audio only as MP3")
22
27
  parser.add_argument("-audio", action="store_true", help="Extract audio only (bestaudio)")
23
28
 
24
29
  parser.add_argument("-list", metavar="NAME", nargs="?", const="default",
25
- help="List playlist contents. Accepts values for searching across playlist"
26
- )
30
+ help="List playlist contents. Accepts values for searching across playlist"
31
+ )
27
32
 
28
33
  args, unknown_args = parser.parse_known_args()
29
34
  return args, unknown_args
@@ -75,6 +75,10 @@ def process_urls(cli_args, extra_ydl_args):
75
75
  # --- output template aliases ---
76
76
  if ydl_opts.get('outtmpl', {}).get('default') in ['autonumber', 'num']: # type: ignore
77
77
  ydl_opts["outtmpl"] = {'default': '%(playlist_autonumber)s - %(title)s.%(ext)s'}
78
+ elif ydl_opts.get('outtmpl', {}).get('default') in ['music', 'song']: # type: ignore
79
+ ydl_opts["outtmpl"] = {'default': '%(title)s - %(artist,uploader)s.%(ext)s'}
80
+ elif ydl_opts.get('outtmpl', {}).get('default') == 'default': # type: ignore
81
+ ydl_opts["outtmpl"] = {}
78
82
 
79
83
  # --- logger ---
80
84
  if not cli_args.list: ydl_opts['progress_hooks'] = [progress_hook]
@@ -83,8 +87,7 @@ def process_urls(cli_args, extra_ydl_args):
83
87
 
84
88
  # --- download ---
85
89
  with yt_dlp.YoutubeDL(ydl_opts) as ydl:
86
- for url in urls:
87
- ydl.download([url])
90
+ ydl.download(urls)
88
91
 
89
92
  def main():
90
93
  try:
File without changes
File without changes
File without changes
File without changes
File without changes