emusks 2.0.13 → 2.0.15
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.
- package/README.md +3 -1
- package/package.json +5 -5
- package/src/helpers/media.js +15 -2
package/README.md
CHANGED
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
Log in and interact with the unofficial X API using any client identity — web, Android, iOS, or TweetDeck
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
officially dmca'd by twitter™ 🏆 • includes a few leaked ads bearers
|
|
7
|
+
|
|
8
|
+
[Learn more →](https://emusks.tiago.zip) [Radicle](https://app.radicle.xyz/nodes/rosa.radicle.xyz/rad:z4F48Wmhm5Mian1rgZjmnKxEQ5ays)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emusks",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.15",
|
|
4
4
|
"description": "Reverse-engineered Twitter API client. Log in and interact with the unofficial X API using any client identity — web, Android, iOS, or TweetDeck",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"client",
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"x",
|
|
11
11
|
"x-api"
|
|
12
12
|
],
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://emusks.tiago.zip",
|
|
14
14
|
"bugs": {
|
|
15
|
-
"url": "https://
|
|
15
|
+
"url": "https://app.radicle.xyz/nodes/rosa.radicle.xyz/rad:z4F48Wmhm5Mian1rgZjmnKxEQ5ays"
|
|
16
16
|
},
|
|
17
17
|
"license": "AGPL-3.0-only",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "https://
|
|
20
|
+
"url": "https://app.radicle.xyz/nodes/rosa.radicle.xyz/rad:z4F48Wmhm5Mian1rgZjmnKxEQ5ays"
|
|
21
21
|
},
|
|
22
22
|
"type": "module",
|
|
23
23
|
"main": "src/index.js",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"cycletls": "^2.0.5",
|
|
29
|
-
"x-client-transaction-id": "^0.
|
|
29
|
+
"x-client-transaction-id": "^0.2.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/helpers/media.js
CHANGED
|
@@ -71,10 +71,11 @@ async function makeUploadRequest(instance, method, params, body, extraHeaders =
|
|
|
71
71
|
"x-twitter-active-user": "yes",
|
|
72
72
|
"x-twitter-auth-type": "OAuth2Session",
|
|
73
73
|
"x-twitter-client-language": "en",
|
|
74
|
+
origin: "https://x.com",
|
|
74
75
|
priority: "u=1, i",
|
|
75
|
-
"sec-ch-ua": "Not(A:Brand;v=8, Chromium;v=144",
|
|
76
|
+
"sec-ch-ua": '"Not(A:Brand";v="8", "Chromium";v="144"',
|
|
76
77
|
"sec-ch-ua-mobile": "?0",
|
|
77
|
-
"sec-ch-ua-platform": "macOS",
|
|
78
|
+
"sec-ch-ua-platform": '"macOS"',
|
|
78
79
|
"sec-fetch-dest": "empty",
|
|
79
80
|
"sec-fetch-mode": "cors",
|
|
80
81
|
"sec-fetch-site": "same-site",
|
|
@@ -85,6 +86,14 @@ async function makeUploadRequest(instance, method, params, body, extraHeaders =
|
|
|
85
86
|
...extraHeaders,
|
|
86
87
|
};
|
|
87
88
|
|
|
89
|
+
if (instance.auth.generateTransactionId) {
|
|
90
|
+
const uploadUrl = new URL(url);
|
|
91
|
+
headers["x-client-transaction-id"] = await instance.auth.generateTransactionId(
|
|
92
|
+
method.toUpperCase(),
|
|
93
|
+
uploadUrl.pathname,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
88
97
|
return await cycleTLS(
|
|
89
98
|
url,
|
|
90
99
|
{
|
|
@@ -140,6 +149,10 @@ export async function create(source, opts = {}) {
|
|
|
140
149
|
media_category: category,
|
|
141
150
|
});
|
|
142
151
|
|
|
152
|
+
if (initRes.status !== 200 && initRes.status !== 202) {
|
|
153
|
+
const text = typeof initRes.body === "string" ? initRes.body : await initRes.text();
|
|
154
|
+
throw new Error(`upload INIT failed (HTTP ${initRes.status}): ${text}`);
|
|
155
|
+
}
|
|
143
156
|
const initData = await initRes.json();
|
|
144
157
|
if (!initData?.media_id_string) {
|
|
145
158
|
throw new Error(`upload INIT failed: ${JSON.stringify(initData)}`);
|