emusks 2.0.6 → 2.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emusks",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
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",
package/src/graphql.js CHANGED
@@ -82,7 +82,8 @@ export default async function graphql(queryName, { variables, fieldToggles, body
82
82
  },
83
83
  method,
84
84
  )
85
- ).json();
85
+ ).text();
86
+ console.log(res);
86
87
 
87
88
  if (res?.errors?.[0]) {
88
89
  throw new Error(res.errors.map((err) => err.message).join(", "));
@@ -96,9 +96,9 @@ async function makeUploadRequest(
96
96
  "x-twitter-auth-type": "OAuth2Session",
97
97
  "x-twitter-client-language": "en",
98
98
  priority: "u=1, i",
99
- "sec-ch-ua": '\u0022Not(A:Brand\u0022;v=\u00228\u0022, \u0022Chromium\u0022;v=\u0022144\u0022',
99
+ "sec-ch-ua": 'Not(A:Brand;v=8, Chromium;v=144',
100
100
  "sec-ch-ua-mobile": "?0",
101
- "sec-ch-ua-platform": '\u0022macOS\u0022',
101
+ "sec-ch-ua-platform": 'macOS',
102
102
  "sec-fetch-dest": "empty",
103
103
  "sec-fetch-mode": "cors",
104
104
  "sec-fetch-site": "same-site",
@@ -1,6 +1,7 @@
1
1
  export async function timeline(opts = {}) {
2
2
  return await this.graphql("NotificationsTimeline", {
3
3
  variables: {
4
+ timeline_type: opts.timeline_type || "All",
4
5
  count: opts.count || 20,
5
6
  cursor: opts.cursor,
6
7
  includePromotedContent: false,
@@ -65,9 +65,9 @@ async function createPollCard(instance, poll) {
65
65
  "x-twitter-auth-type": "OAuth2Session",
66
66
  "x-twitter-client-language": "en",
67
67
  priority: "u=1, i",
68
- "sec-ch-ua": '\u0022Not(A:Brand\u0022;v=\u00228\u0022, \u0022Chromium\u0022;v=\u0022144\u0022',
68
+ "sec-ch-ua": 'Not(A:Brand;v=8, Chromium;v=144',
69
69
  "sec-ch-ua-mobile": "?0",
70
- "sec-ch-ua-platform": '\u0022macOS\u0022',
70
+ "sec-ch-ua-platform": 'macOS',
71
71
  "sec-fetch-dest": "empty",
72
72
  "sec-fetch-mode": "cors",
73
73
  "sec-fetch-site": "same-site",
package/src/index.js CHANGED
@@ -75,7 +75,7 @@ export default class Emusks {
75
75
  if (typeof p.client === "string") p.client = clients[p.client];
76
76
  if (!p.client) throw new Error("invalid client!");
77
77
  if (p.proxy) this.proxy = p.proxy;
78
-
78
+
79
79
  if (!p.client.bearer) {
80
80
  throw new Error("client is missing bearer token!");
81
81
  }
@@ -83,7 +83,7 @@ export default class Emusks {
83
83
  p.client.userAgent =
84
84
  p.client.userAgent ||
85
85
  "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36";
86
-
86
+
87
87
  p.client.fingerprints = p.client.fingerprints || {
88
88
  ja3: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,35-5-27-16-0-10-13-23-45-65037-17613-18-65281-51-43-11,4588-29-23-24,0",
89
89
  ja4r: "t13d1516h2_002f,0035,009c,009d,1301,1302,1303,c013,c014,c02b,c02c,c02f,c030,cca8,cca9_0005,000a,000b,000d,0012,0017,001b,0023,002b,002d,0033,44cd,fe0d,ff01_0403,0804,0401,0503,0805,0501,0806,0601",