elogank/lol-replay-downloader
Composer 安装命令:
composer require elogank/lol-replay-downloader
包简介
League of Legends replay downloader library
README 文档
README
This project provides you a way to easily download a League of Legends replay game which still in process (ingame), like lolking.net or op.gg feature. Replays are stored in your server and can be watched at any time.
All download files can be decoded to parse them.
Features
- A built-in replay decoder for each files (chunks & keyframes).
- An asynchronous system (multi processes), allow to download some replays at the same time and save the log into the replay folder, it needs the CLI dependency : https://github.com/EloGank/lol-replay-downloader-cli.
- Download previous data if you start the download process after the start of the game (can download only 10 minutes in the past due to a limitation of the Riot spectator server engine).
- Can wait for the start of the game if you start the download process too early (during the game loading process or the first 3 minutes of the game).
- Easily extendable and configurable.
Installation
Composer
Simply clone this project and run the composer install command.
If you don't know what is Composer, read the dedicated documentation.
Configuration
To configure the library, you have some $options parameters in the classes constructor. Just pass an array to override them, see the getDefaultOptions() method of each class.
See the "download and decode example", which overrides two configurations of the ReplayDownloader class.
Notes with xDebug
If you have enabled xDebug, please set your max nesting level to more than 200. This lib uses a recursive method to download a game data, and can reach the max value (100) when a game length is more than 40 minutes.
To edit the default max nesting level, open your xDebug configuration file (/etc/php5/your_engine(cli, fpm or apache2)/conf.d/20-xdebug.ini by default) and append this :
[xdebug] xdebug.max_nesting_level = 300
How to use (examples)
Some examples are available in the examples repository folder.
How to get the region, game id or encryption key ?
Some regions (not all) are listed in the LoLNexusParser class as constants.
From an unofficial API
For the game id and the encryption key, it's a few harder. Indeed, the official Riot API doesn't provide yet an API to retrieve this data.
To get it, you have to use an unofficial API, like this : https://github.com/EloGank/lol-php-api, please see the route game.retrieve_in_progress_spectator_game_info. Note that using other route is not allowed, by the new Riot Terms of Use (see "Important notes" below).
From LoLNexus website
For testing purpose, you can simply go to spectating websites like lolnexus, click on "Spectate" button on a game, and you'll have the region, game id & encryption key in the command line to launch the game, see the end of the line :
"C:\Riot Games\League of Legends\RADS\solutions\lol_game_client_sln\releases\0.0.1.xx\deploy\League of Legends.exe" "8394" "LoLLauncher.exe" "" "spectator SERVER_ADDRESS ENCRYPTION_KEY GAME_ID REGION"
Example :
"C:\Riot Games\League of Legends\RADS\solutions\lol_game_client_sln\releases\0.0.1.68\deploy\League of Legends.exe" "8394" "LoLLauncher.exe" "" "spectator 185.40.64.163:80 nwP+BEYqHgk4sElnU2uRogoxGPUw1dzE 1234567890 EUW1"
So, you can extract :
| Region | Game ID | Encryption Key |
|---|---|---|
| EUW1 | 1234567890 | nwP+BEYqHgk4sElnU2uRogoxGPUw1dzE |
From LoLNexus parser
A LoLNexus PHP parser exists here : https://github.com/EloGank/lol-replay-downloader/blob/master/examples/utils/LoLNexusParser.php
Usage is simple : you juste have to select the region by calling LoLNexusParser::parseRandom($regionId) or LoLNexusParser::parsePlayer($regionId, $playerName) methods and it will bring you all parameters for running a command by calling LoLNexusParser::getRegion(), LoLNexusParser::getGameId() or LoLNexusParser::getEncryptionKey() methods.
Example is available here : https://github.com/EloGank/lol-replay-downloader/blob/master/examples/download-replay.php#L32-L48
Important notes
According to the new Riot Terms of Use (1st October 2014), using data from another source of their official API is not allowed. So using data by parsing decoded files is not allowed. This project provides a way to decode file only for teaching purpose.
You can download a full game only if you start the download process before the ~8th ingame minute. Otherwise, you won't have the start of the game.
A game is still viewable if the game hasn't been updated. If one or more updates has been applied since the replay has been downloaded, there may be has some ingame glitches (movements, monsters, sounds, etc).
Reporting an issue or a feature request
Feel free to open an issue, fork this project or suggest an awesome new feature in the issue tracker.
Credit
See the list of contributors.
Licence
This repository isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends.
League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends (c) Riot Games, Inc.
elogank/lol-replay-downloader 适用场景与选型建议
elogank/lol-replay-downloader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 351 次下载、GitHub Stars 达 55, 最近一次更新时间为 2014 年 11 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「library」 「record」 「Match」 「league of legends」 「LoL」 「replay」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 elogank/lol-replay-downloader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elogank/lol-replay-downloader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 elogank/lol-replay-downloader 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Propel2 is an open-source Object-Relational Mapping (ORM) for PHP 5.5 and up.
PHP Interface for Babel Street Text Analytics
AppVerk extension of PHP Matcher, it enables you to match values with patterns
A client for Happyr match API
Anax Database Active Record module for model classes.
Craft field type for text fields that match a regex pattern
统计信息
- 总下载量: 351
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 55
- 点击次数: 30
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2014-11-22