Skip to main content

No project description provided

Project description

RiotManifest

riot提供的manifest文件进行解析下载

介绍

目前的功能是可以传入URL或本地文件目录,解析manifest文件,下载文件。

大部分代码都来自于CommunityDragon/CDTB项目,感谢他们的工作。

PatcherManifest进行修改使其支持URL manifest文件下载,细化filter_files方法,使其支持正则表达式过滤文件。

PatcherFile增加download_file方法,使其支持文件下载。并且使用aiohttp进行异步下载。默认并发数为50,并发数可以通过实例化PatcherManifestconcurrency_limit参数进行设置; 也可以调用PatcherFiledownload_file方法时传入concurrency_limit参数进行设置。

安装

pip3 install riotmanifest

poetry

poetry add riotmanifest

使用

import asyncio
from riotmanifest.manifest import PatcherManifest
async def main():
    bundle_url = 'https://lol.dyn.riotcdn.net/channels/public/bundles/'
    manifest = PatcherManifest(
      r"https://lol.secure.dyn.riotcdn.net/channels/public/releases/CB3A1B2A17ED9AAB.manifest",
      path=r'E:\out',
      bundle_url=bundle_url)
    
    
    files = list(manifest.filter_files(flag='zh_CN', pattern='wad.client'))

    await manifest.download_files_concurrently(files, 5)



if __name__ == '__main__':
    asyncio.run(main())

注意,单个文件的下载并发是50,download_files_concurrently方法是对多个文件进行并发下载。建议这个数不要超过10,否则有封IP的风险(实测PatcherManifest传入100,download_files_concurrently传入10,后台可查最大线程为800+,正常执行,量力而行)。

维护者

Virace

感谢

许可证

GPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

riotmanifest-1.0.2.tar.gz (20.5 kB view hashes)

Uploaded Source

Built Distribution

riotmanifest-1.0.2-py3-none-any.whl (21.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page