Пример #1
0
def main():
    ngdp = NGDP('wow_beta')
    ngdp.set_cdn('us')
    ngdp.set_version('us')
    cdn_config = ngdp.get_cdn_config()

    b = Build(ngdp.get_hash(cdn_config['builds'][1]))
    print(b.build_name[0])
    patch_config = ngdp.get_hash(b.patch_config[0])
    if not os.path.exists('./download/'): os.makedirs('./download')
    if not os.path.exists('./download/data/'): os.makedirs('./download/data/')
    if not os.path.exists('./download/config/'): os.makedirs('./download/config/')
    for i in re.findall('[0-9a-z]{32}',patch_config):
        print('Downloading %s...' % i)
        for path_type in ['config', 'data']:
            for index in [True, False]:
                filename = './download/%s/%s%s' % (
                    path_type,
                    i,
                    '.index' if index else ''
                )
                data = ngdp.get_hash(i, path_type, index)
                if data:
                    with open(filename, 'wb+') as output:
                        output.write(data)
Пример #2
0
import re, os, glob
from NGDP import NGDP, Build

ngdp = NGDP('wow_beta')
ngdp.set_cdn('us')
ngdp.set_version('us')
print('Current version: {ngdp.version.versions_name}'.format(ngdp=ngdp))
cdn_config = ngdp.get_cdn_config()

for i, hash in enumerate(cdn_config['builds']):
    if i >= 5:
        break
    b = Build(ngdp.get_hash(hash))
    print('%50s %10s' % (b.build_name[0], b.patch_size[0]))