@@ -20,21 +20,23 @@ class DepotFile(object):
20
20
"""
21
21
22
22
#: The url template for all DepotFiles
23
- url_template = "https ://{}-s2-depot.classic.blizzard.com {}/{}.{}"
23
+ url_template = "{} ://{}-s2-depot.{}/{}.{}"
24
24
25
25
def __init__ (self , bytes ):
26
26
#: The server the file is hosted on
27
27
self .server = bytes [4 :8 ].decode ("utf-8" ).strip ("\x00 " )
28
28
29
29
# Used to make it possible to load maps from CN.
30
30
# This isn't needed for any other region and so is blank by default.
31
- self .url_suffix = ""
31
+ self .scheme = "https"
32
+ self .domain = "classic.blizzard.com"
32
33
33
34
# There is no SEA depot, use US instead
34
35
if self .server == "SEA" :
35
36
self .server = "US"
36
37
elif self .server == "CN" :
37
- self .url_suffix = ".cn"
38
+ self .scheme = "http"
39
+ self .domain = "battlenet.com.cn"
38
40
39
41
#: The unique content based hash of the file
40
42
self .hash = binascii .b2a_hex (bytes [8 :]).decode ("utf8" )
@@ -46,7 +48,7 @@ def __init__(self, bytes):
46
48
def url (self ):
47
49
"""Returns url of the depot file."""
48
50
return self .url_template .format (
49
- self .server , self .url_suffix , self .hash , self .type
51
+ self .scheme , self . server , self .domain , self .hash , self .type
50
52
)
51
53
52
54
def __hash__ (self ):
0 commit comments