dsu3 0.4 → 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 +4 -4
- data/lib/dsu3/props.rb +26 -13
- data/lib/dsu3.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9572203f08a6ce1f65c4a33b613b51a116c0fc935c6f26c8d0e5b2f0600740b6
|
4
|
+
data.tar.gz: 89b125202ba866c62599f69fa7f9321b82d4edf3773fdebcbe0dfe6771f1f724
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fd28581d81eeead4c8295818ef4f1484218e7771b42709a47991696da2b0eb9c9b936aa0fbaa36b800b5f798d55271e3b5acf333a59895658d1b4c87acdb312
|
7
|
+
data.tar.gz: 2857ce644817ba1f2965de5d82585322ecd889fa4eb87f5a7980119a22654d623f1e1af84c174c3a029bbbf04bd5e3f82e3b7e1fea1848ffea96ab1dc360ed66
|
data/lib/dsu3/props.rb
CHANGED
@@ -5,24 +5,34 @@ require 'json'
|
|
5
5
|
require 'base64'
|
6
6
|
|
7
7
|
module DSU3
|
8
|
+
# The fundamental class in this vast system, on which all the other parts of the structure depend
|
9
|
+
# pretty bad code in this module rests by the way
|
8
10
|
module Props
|
9
11
|
# user-agent header
|
10
|
-
USER_AGENT =
|
11
|
-
|
12
|
-
|
12
|
+
USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0'
|
13
|
+
|
14
|
+
DATAMINING_COMMITS_URL = 'https://api.github.com/repos/Discord-Datamining/Discord-Datamining/commits/master'
|
15
|
+
|
16
|
+
# Fetches Discord client build number
|
17
|
+
def fetch_build_number
|
18
|
+
JSON.parse(RestClient.get(DATAMINING_COMMITS_URL))['commit']['message'].match(/Build (\d+)/)[1]
|
19
|
+
end
|
13
20
|
|
14
21
|
# Decoded x-super-properties header
|
15
22
|
SUPER_PROPERTIES = {
|
16
23
|
os: 'Linux',
|
17
|
-
browser: '
|
24
|
+
browser: 'Firefox',
|
25
|
+
device: '',
|
26
|
+
system_locale: 'en',
|
27
|
+
browser_user_agent: USER_AGENT,
|
28
|
+
browser_version: '91.0',
|
29
|
+
os_version: '',
|
30
|
+
referrer: '',
|
31
|
+
referring_domain: '',
|
32
|
+
referrer_current: '',
|
33
|
+
referring_domain_current: '',
|
18
34
|
release_channel: 'stable',
|
19
|
-
|
20
|
-
os_version: '5.10.0-14-amd64',
|
21
|
-
os_arch: 'x64',
|
22
|
-
system_locale: 'en-US',
|
23
|
-
window_manager: 'XFCE,xfce',
|
24
|
-
distro: 'Debian GNU/Linux 11 (bullseye)',
|
25
|
-
client_build_number: 136_921,
|
35
|
+
client_build_number: fetch_build_number,
|
26
36
|
client_event_source: nil
|
27
37
|
}.freeze
|
28
38
|
|
@@ -32,16 +42,19 @@ module DSU3
|
|
32
42
|
HEADERS = {
|
33
43
|
accept: '*/*',
|
34
44
|
accept_encoding: 'gzip, deflate, br',
|
35
|
-
accept_language: 'en
|
45
|
+
accept_language: 'en',
|
46
|
+
alt_used: 'discord.com',
|
47
|
+
connection: 'keep-alive',
|
48
|
+
host: 'discord.com',
|
36
49
|
sec_fetch_dest: 'empty',
|
37
50
|
sec_fetch_mode: 'cors',
|
38
51
|
sec_fetch_site: 'same-origin',
|
52
|
+
te: 'trailers',
|
39
53
|
user_agent: USER_AGENT,
|
40
54
|
x_debug_options: 'bugReporterEnabled',
|
41
55
|
x_discord_locale: 'en-US',
|
42
56
|
x_super_properties: Base64.strict_encode64(SUPER_PROPERTIES.to_json),
|
43
57
|
content_type: 'application/json',
|
44
|
-
origin: 'https://discord.com',
|
45
58
|
cookie: HTTP::Cookie.cookie_value(resp.cookie_jar.cookies),
|
46
59
|
x_fingerprint: JSON.parse(resp.body)['fingerprint']
|
47
60
|
}.freeze
|
data/lib/dsu3.rb
CHANGED