CS: GO get a link to the. dem file
You need to get the file link in the format .dem by demo code (as an example code CSGO-OyjY3-pPKCF-cmpHJ-wdohh-CY5dK
)
The desired link looks like this http://replay124.valve.net/730/003072985384448163905_0699089210.dem.bz2
, but how do I get the values from the demo code?:
003072985384448163905
0699089210
124
I would like to do it in PHP, but you can also do it in NodeJS, but I didn't find anything on this topic on the Internet.
Up:
In the game itself, the demo can be downloaded from the game's internal console with the command csgo_download_match код демо
for example csgo_download_match CSGO-pj5MV-zyzpa-PaHVb-tFUwV-HGXbD
, but it's still like it deciphering the link remains a mystery
3 answers
Your problem is already solved, moreover, there is a library for nodejs https://www.npmjs.com/package/csgo And here is the code that decrypts your code:
var scDecoder = new csgo.SharecodeDecoder("CSGO-U6MWi-hYFWJ-opPwD-JciHm-qOijD");
console.log(scDecoder.decode());
The turnip has a more complete example, use it.
--
The in-game loader uses the CMsgGCCStrike15_v2_MatchListRequestFullGameInfo function from the internal library NetHook2.dll
UPD: Here is a method that uses these functions, even called also https://github.com/joshuaferrara/node-csgo/blob/master/handlers/match.js#L77
You can look here (c#) generatematchlist function https://github.com/akiver/CSGO-Demos-Manager/blob/04b44968a4d3c70664e1b3c85c93f5e68ca9a5d2/src/ViewModel/HomeViewModel.cs
Well, who asks questions like that?! What kind of link should I create? But, if, as I understand, you need to give the file to a specific request, then something like this once did a long time ago.
if($_GET['code'] == 'CSGO-OyjY3-pPKCF-cmpHJ-wdohh-CY5dK') {
Header("HTTP/1.1 200 OK");
Header("Connection: close");
Header("Content-Type: application/pdf");
Header("Accept-Ranges: bytes");
Header("Content-Disposition: Attachment; filename=new_filename.pdf");
Header("Content-Length: 50000");
readfile('test_file.pdf');
}