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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dsu3/props.rb +26 -13
  3. data/lib/dsu3.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9a0705c6d460fe073239d8637574b0fa3e8abfb618064aca5d79271f34a0d70
4
- data.tar.gz: c622c03008ec604396abf1309d7fc87155bc9dca09650c7486305ec05214d6cb
3
+ metadata.gz: 9572203f08a6ce1f65c4a33b613b51a116c0fc935c6f26c8d0e5b2f0600740b6
4
+ data.tar.gz: 89b125202ba866c62599f69fa7f9321b82d4edf3773fdebcbe0dfe6771f1f724
5
5
  SHA512:
6
- metadata.gz: db0f31beb357f9e01751305fa00c0e914c0b2e9a51664afdbf88a2940e8b23fef2488e84597eb44c1e155d4bb6f6641f51ba86067dc7ca3fa537f86da13088b5
7
- data.tar.gz: 9a9c5288a110b35e13db5b5879c8d79ab9ba2b26f952b91b203a87ed628c1b100f0f69cfb8c27a267d1cbcd50cff43e770e3f80e5f50161492c051b2039d314d
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
- 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) '\
12
- 'discord/0.0.18 Chrome/91.0.4472.164 Electron/13.6.6 Safari/537.36'
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: 'Discord Client',
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
- client_version: '0.0.18',
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-US',
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
@@ -5,7 +5,7 @@ require 'dsu3/core'
5
5
 
6
6
  # Main DSU3 namespace
7
7
  module DSU3
8
- VERSION = '0.4'
8
+ VERSION = '0.5.0'
9
9
 
10
10
  LOGGER = Logger.new($stdout)
11
11
  LOGGER.level = Logger::WARN
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dsu3
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artur Sheremetjev IV