x 0.15.1 → 0.15.3
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 +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/x/media_uploader.rb +3 -3
- data/lib/x/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eda8225e3c33ea58d75a363a4ee8806397fab2835672ad426890d3ab78d43f0d
|
4
|
+
data.tar.gz: 633c05ab7dbbcb5ff3b97daa9cea32e219d47c783428b59305a9e9353972a8e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a65146220ce9312edabd2178ea1fef63cbbd3300d9d08fe694e714bbb1333b3160e0fa30cb1b7a457358c568faa7302afb5511d5f4aa88583af1e9ca3d15f652
|
7
|
+
data.tar.gz: 906acc33745a72b8c58414ebe8c6b6af7bc234afe932a90a1ac3eb8efcca7c083e5caa42bd733ee0c2aced0fe264c849267e306efc7841e78d0050a2b3cc965f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
|
+
## [0.15.3] - 2025-04-24
|
2
|
+
* Add missing base64 dependency (3ca8512)
|
3
|
+
* Set binary read for media files to be uploaded (fd066e6)
|
1
4
|
|
2
|
-
## [0.15.
|
5
|
+
## [0.15.2] - 2025-03-28
|
6
|
+
* Use media_id instead of media_key to upload media (f1dd577)
|
7
|
+
|
8
|
+
## [0.15.1] - 2025-03-24
|
3
9
|
* Fix bug in MediaUploader#await_processing (136dff8)
|
4
10
|
* Refactor RedirectHandler#build_request (fd379c3)
|
5
11
|
* Escape space in query string as %20, not + (2d2df75)
|
data/lib/x/media_uploader.rb
CHANGED
@@ -30,7 +30,7 @@ module X
|
|
30
30
|
media = init(client:, file_path:, media_type:, media_category:)
|
31
31
|
chunk_size = chunk_size_mb * BYTES_PER_MB
|
32
32
|
append(client:, file_paths: split(file_path, chunk_size), media:, media_type:, boundary:)
|
33
|
-
client.post("media/upload?command=FINALIZE&
|
33
|
+
client.post("media/upload?command=FINALIZE&media_id=#{media["id"]}")&.fetch("data")
|
34
34
|
end
|
35
35
|
|
36
36
|
def await_processing(client:, media:)
|
@@ -85,7 +85,7 @@ module X
|
|
85
85
|
threads = file_paths.map.with_index do |file_path, index|
|
86
86
|
Thread.new do
|
87
87
|
upload_body = construct_upload_body(file_path:, media_type:, boundary:)
|
88
|
-
query = "command=APPEND&
|
88
|
+
query = "command=APPEND&media_id=#{media["id"]}&segment_index=#{index}"
|
89
89
|
headers = {"Content-Type" => "multipart/form-data, boundary=#{boundary}"}
|
90
90
|
upload_chunk(client:, query:, upload_body:, file_path:, headers:)
|
91
91
|
end
|
@@ -112,7 +112,7 @@ module X
|
|
112
112
|
"--#{boundary}\r\n" \
|
113
113
|
"Content-Disposition: form-data; name=\"media\"; filename=\"#{File.basename(file_path)}\"\r\n" \
|
114
114
|
"Content-Type: #{media_type}\r\n\r\n" \
|
115
|
-
"#{File.
|
115
|
+
"#{File.binread(file_path)}\r\n" \
|
116
116
|
"--#{boundary}--\r\n"
|
117
117
|
end
|
118
118
|
end
|
data/lib/x/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,28 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: x
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Berlin
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
11
|
-
dependencies:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: base64
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '0.2'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '0.2'
|
12
26
|
email:
|
13
27
|
- sferik@gmail.com
|
14
28
|
executables: []
|
@@ -78,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
92
|
- !ruby/object:Gem::Version
|
79
93
|
version: '0'
|
80
94
|
requirements: []
|
81
|
-
rubygems_version: 3.6.
|
95
|
+
rubygems_version: 3.6.8
|
82
96
|
specification_version: 4
|
83
97
|
summary: A Ruby interface to the X API.
|
84
98
|
test_files: []
|