ytdl 0.3.0 → 0.5.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 439640337775a1bd6f925a57b09c51191bc39bfa5da4c923b34b47a8362f8ea7
4
- data.tar.gz: 248e1b7c2194dff4c04a3483a0655bd2c61347b3033ef1f94fe4ae0a30cc772b
3
+ metadata.gz: 345a9153d461d0a94dd4c5d2c98aa2f34357f38e99589b3048dbb5f24642d676
4
+ data.tar.gz: f6989ccc2cf24f6d993bb2d42bd000ad566d26f840977399015252fc22067b27
5
5
  SHA512:
6
- metadata.gz: 473eb094c10cfc1b4920f6b4822ffc5b7b9f02223adc7d803c2493e20381936ac003b1f0986c5d653332cb24726eafe0e432004c9205201648b6588e632e12f7
7
- data.tar.gz: b75444244c3fdfd8817d0510c68d15a04de420b4d4c8e522bccf51aa6c388f778926066b68c811b1e6894bc2000ad1c78ca754790c77207f61a82ce064dfe173
6
+ metadata.gz: fe3ee8a1c07d12f77a0e790d7beb3c7190c26b7a3a7ff48339acde66e0db97df6b521b502cd3f4fd71fe08581b65fb8f68c0677096e5082783e8bc3fa9a03629
7
+ data.tar.gz: 309159e8def93151abb46952202a4451190655ad2d0e371dd1650675806703f011a0f3fef82a4d973d3151239818c23bd7ef952484c1e9ee534d8d6403ebdbbe
@@ -33,7 +33,15 @@ module YoutubeDL
33
33
  when [] then nil
34
34
  when true then "--#{option}"
35
35
  when false then "--no-#{option}"
36
- else ["--#{option}", value]
36
+ else
37
+ # Handle array values by repeating the option.
38
+ #
39
+ # Example: { paths: ['temp:/tmp', '/complete'] }
40
+ # Becomes: ['--paths', 'temp:/tmp', '--paths', '/complete']
41
+ #
42
+ # Example: { paths: '/downloads' }
43
+ # Becomes: ['--paths', '/downloads]
44
+ [*value].flat_map { |v| ["--#{option}", v] }
37
45
  end
38
46
  end
39
47
  end
@@ -1,4 +1,5 @@
1
1
  require 'filesize'
2
+ require 'pathname'
2
3
  require 'youtube_dl/state'
3
4
 
4
5
  module YoutubeDL
@@ -20,6 +21,15 @@ module YoutubeDL
20
21
  return :destination
21
22
  end
22
23
 
24
+ if m[:merger]
25
+ state.destination = Pathname(m[:merger])
26
+ return :merger
27
+ end
28
+
29
+ if m[:deleting]
30
+ return :deleting
31
+ end
32
+
23
33
  if m[:info_json]
24
34
  state.info_json = Pathname(m[:info_json]) if m[:info_json]
25
35
  return :info_json
@@ -53,6 +63,8 @@ module YoutubeDL
53
63
  #{progress_regex} |
54
64
  #{destination_regex} |
55
65
  #{existing_destination_regex} |
66
+ #{merger_regex} |
67
+ #{deletion_regex} |
56
68
  #{info_json_regex} |
57
69
  #{error_regex}
58
70
  }x
@@ -88,6 +100,20 @@ module YoutubeDL
88
100
  }x
89
101
  end
90
102
 
103
+ def merger_regex
104
+ %r{
105
+ \[Merger\] \s+ Merging \s+ formats \s+ into \s+
106
+ "(?<merger>[^"]+)"
107
+ }x
108
+ end
109
+
110
+ def deletion_regex
111
+ %r{
112
+ Deleting \s+ original \s+ file \s+
113
+ (?<deleting>.*)
114
+ }x
115
+ end
116
+
91
117
  def info_json_regex
92
118
  %r{
93
119
  \[info\] \s Writing \s video .*? \s metadata \s as \s JSON \s to: \s
@@ -10,6 +10,8 @@ module YoutubeDL
10
10
  :error,
11
11
  :info_json,
12
12
  :info,
13
+ :merger,
14
+ :deleting,
13
15
  )
14
16
 
15
17
  def error?
@@ -1,3 +1,3 @@
1
1
  module YoutubeDL
2
- VERSION = "0.3.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ytdl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Hollmann
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-02 00:00:00.000000000 Z
11
+ date: 2025-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.2.0
41
- description:
41
+ description:
42
42
  email:
43
43
  - maxhollmann@gmail.com
44
44
  executables: []
@@ -61,7 +61,7 @@ metadata:
61
61
  bug_tracker_uri: https://github.com/maxhollmann/ruby-ytdl/issues
62
62
  changelog_uri: https://github.com/maxhollmann/ruby-ytdl/releases
63
63
  homepage_uri: https://github.com/maxhollmann/ruby-ytdl
64
- post_install_message:
64
+ post_install_message:
65
65
  rdoc_options: []
66
66
  require_paths:
67
67
  - lib
@@ -76,8 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubygems_version: 3.0.3.1
80
- signing_key:
79
+ rubygems_version: 3.4.19
80
+ signing_key:
81
81
  specification_version: 4
82
82
  summary: A wrapper for youtube-dl with progress callbacks
83
83
  test_files: []