Closed Xoma163 closed 6 months ago
Oh. I open this file in txt editor and find link to download .dem file. Thanks! How I can to decode it? I read that I need use protobuf, yes?
Sorry for the late bump. Did you have any issues downloading the demo from the link provided in the output file? I get a link like; http://replay171.valve.net/730/XXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX.dem.bz2, however it returns 404.
If I look at the demo download links in steamcommunity.com premier match history i don't find any links matching the one produced by boiler-writter. Is there additional work to be done to use the link to download the demo?
I have used other share code decoders to see if that was the issue but all return the same result.
Sorry for the late bump. Did you have any issues downloading the demo from the link provided in the output file? I get a link like; http://replay171.valve.net/730/XXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX.dem.bz2, however it returns 404.
If I look at the demo download links in steamcommunity.com premier match history i don't find any links matching the one produced by boiler-writter. Is there additional work to be done to use the link to download the demo?
I have used other share code decoders to see if that was the issue but all return the same result.
Hm, probably not. Check this code, it works for me https://github.com/Xoma163/CS2Rank/blob/98f7f5f44b77cebdc9c11b82da5c1aeb6c90c660/src/match.py#L97
This tool doesn't download .dem
files but generates a file that contains a protobuf message (CMsgGCCStrike15_v2_MatchList
or CDataGCCStrike15_v2_MatchInfo
).
The field map
of the last entry of the array roundstatsall
in a CDataGCCStrike15_v2_MatchInfo
message contains the demo link.
As mentioned here, the proper way to retrieve the demo link would be to parse the proto message.
csgo-protobuf provides ready-to-use CS proto classes for JS. You could use it or generate proto-classes for your target language. The readme shows an example, to retrieve the demo link, it would be:
import fs from "fs";
import { CDataGCCStrike15_v2_MatchInfo } from "csgo-protobuf";
fs.readFile("./sample.info", (error, bytes) => {
if (error) {
console.error(error);
return;
}
const matchInfo = CDataGCCStrike15_v2_MatchInfo.fromBinary(bytes);
const demoUrl = matchInfo.roundstatsall[matchInfo.roundstatsall.length-1].map;
console.log(demoUrl);
});
Links expire after ~1 month, so if you have a 404, it means the link has expired.
Hi I decoded share code and try to run script like this:
And demo.dem generated, but it was 5kb file, not real demo. What am I doing wrong?
Windows 10 I can download demo in cs2, it works, but not throw this project