Skip to content

Added Project ID parsing for epic games#63

Closed
Pingger wants to merge 2 commits intodevedse:masterfrom
Pingger:master
Closed

Added Project ID parsing for epic games#63
Pingger wants to merge 2 commits intodevedse:masterfrom
Pingger:master

Conversation

@Pingger
Copy link

@Pingger Pingger commented Apr 20, 2025

At the very least we can now differentiate between the games that are downloaded, and for quite a few games that Project ID is almost equal to the game name (e.g. Fortnite=Fortnite, Kisima Ingitchuna=Kisima Ingitchuna (Never Alone)), but unfortunately an increasing number of games on epic just uses a hex-hash.

Still more info than before.

I have no idea, how you want non matching lines to be handles, so I just copied the steam on. Non-matching can look like this (non exhaustive):

[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:33:54 +0100] "HEAD /ias/fortnite/60aab3e1def4ad3e63ac3cb050aaf697c697125c.iochunktoc HTTP/1.1" 200 0 "-" "-" "MISS" "cloudflare.epicgamescdn.com" "-"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:33:54 +0100] "HEAD /ias/fortnite/60aab3e1def4ad3e63ac3cb050aaf697c697125c.iochunktoc HTTP/1.1" 200 0 "-" "-" "MISS" "cloudflare.epicgamescdn.com" "-"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:33:54 +0100] "HEAD /ias/fortnite/60aab3e1def4ad3e63ac3cb050aaf697c697125c.iochunktoc HTTP/1.1" 200 0 "-" "-" "MISS" "cloudflare.epicgamescdn.com" "-"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:33:55 +0100] "HEAD /ias/fortnite/60aab3e1def4ad3e63ac3cb050aaf697c697125c.iochunktoc HTTP/1.1" 200 0 "-" "-" "MISS" "cloudflare.epicgamescdn.com" "-"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:38:46 +0100] "HEAD /ias/fortnite/60aab3e1def4ad3e63ac3cb050aaf697c697125c.iochunktoc HTTP/1.1" 200 0 "-" "-" "MISS" "download.epicgames.com" "-"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:38:46 +0100] "HEAD /ias/fortnite/60aab3e1def4ad3e63ac3cb050aaf697c697125c.iochunktoc HTTP/1.1" 200 0 "-" "-" "HIT" "download.epicgames.com" "-"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:38:46 +0100] "HEAD /ias/fortnite/60aab3e1def4ad3e63ac3cb050aaf697c697125c.iochunktoc HTTP/1.1" 200 0 "-" "-" "HIT" "download.epicgames.com" "-"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:38:46 +0100] "HEAD /ias/fortnite/60aab3e1def4ad3e63ac3cb050aaf697c697125c.iochunktoc HTTP/1.1" 200 0 "-" "-" "HIT" "download.epicgames.com" "-"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:54 +0100] "GET /ias/fortnite/chunks/50/50f1d78bd36f6d0401d30c0bdc917a9484ebf086.iochunk HTTP/1.1" 206 1888 "-" "-" "MISS" "download.epicgames.com" "bytes=0-1887"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:54 +0100] "GET /ias/fortnite/chunks/0f/0f9790bcbf08664d22d16d530d3ae92450135569.iochunk HTTP/1.1" 206 21552 "-" "-" "MISS" "download.epicgames.com" "bytes=0-21551"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:54 +0100] "GET /ias/fortnite/chunks/8c/8c4d5ff13cfb007a246d37c97404277243139532.iochunk HTTP/1.1" 206 8224 "-" "-" "MISS" "download.epicgames.com" "bytes=0-8223"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:54 +0100] "GET /ias/fortnite/chunks/89/89dd305f0916527e45d1d557ec76cd270d54cd2b.iochunk HTTP/1.1" 206 79376 "-" "-" "MISS" "download.epicgames.com" "bytes=0-79375"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:54 +0100] "GET /ias/fortnite/chunks/41/4196668d066edd5216ec843b9b5363e1c13f3804.iochunk HTTP/1.1" 206 20608 "-" "-" "MISS" "download.epicgames.com" "bytes=0-20607"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:54 +0100] "GET /ias/fortnite/chunks/4e/4ed8c5fb97107d376f0071811a20a9307b48f392.iochunk HTTP/1.1" 206 131280 "-" "-" "MISS" "download.epicgames.com" "bytes=0-131279"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:54 +0100] "GET /ias/fortnite/chunks/4e/4ed8c5fb97107d376f0071811a20a9307b48f392.iochunk HTTP/1.1" 206 40672 "-" "-" "HIT" "download.epicgames.com" "bytes=131280-171951"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:54 +0100] "GET /ias/fortnite/chunks/4e/4ed8c5fb97107d376f0071811a20a9307b48f392.iochunk HTTP/1.1" 206 12704 "-" "-" "HIT" "download.epicgames.com" "bytes=171952-184655"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:55 +0100] "GET /ias/fortnite/chunks/e6/e6886bbd9597fa7c2e3c3efcce59ace6beaaf1f4.iochunk HTTP/1.1" 206 22912 "-" "-" "MISS" "download.epicgames.com" "bytes=0-22911"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:55 +0100] "GET /ias/fortnite/chunks/6e/6e624f946c7a9a570a30f0c05b0dc68ee01568fa.iochunk HTTP/1.1" 206 62080 "-" "-" "MISS" "download.epicgames.com" "bytes=0-62079"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:55 +0100] "GET /ias/fortnite/chunks/9d/9de0fdf8b31e796e4fee8c9989efe48713a6c212.iochunk HTTP/1.1" 206 33216 "-" "-" "MISS" "download.epicgames.com" "bytes=106736-139951"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:55 +0100] "GET /ias/fortnite/chunks/9d/9de0fdf8b31e796e4fee8c9989efe48713a6c212.iochunk HTTP/1.1" 206 11408 "-" "-" "HIT" "download.epicgames.com" "bytes=139952-151359"
[epicgames] 192.168.1.122 / - - - [25/Dec/2024:20:39:56 +0100] "GET /ias/fortnite/chunks/9d/9de0fdf8b31e796e4fee8c9989efe48713a6c212.iochunk HTTP/1.1" 206 106736 "-" "-" "HIT" "download.epicgames.com" "bytes=0-106735"

@Bensonheimer992
Copy link

@devedse

@devedse devedse requested a review from Copilot April 24, 2025 15:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds logic to parse Epic Games' project IDs from log requests and differentiate between builds and non-matching cases.

  • Added parsing of the URL from the Request to extract the Project ID when the URL path contains "Builds".
  • Throws an exception if the URL format does not match expected patterns.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@devedse
Copy link
Owner

devedse commented Apr 30, 2025

Can you maybe add some comments in the code what it's doing in what steps with some examples. Because I don't use epic myself atm so don't really have good examples to test this with.

Also the examples you mentioned that don't work still have fornite in them, so we could just grab that entry in a list splitted by / right? I'm not sure what you meant that it wouldn't work for those.

@Pingger
Copy link
Author

Pingger commented May 1, 2025

We could do that, yes. I mean, that the code I submitted currently checks for "Builds" and thus does not match on "ias". Somewhat noteworth: The capitalization of the CodeName is different between "Builds"-URLs and "ias"-URLs
I copied existing Steam-Code and adapted it for epic URLs.
I'm not a proper C#-Dev and thus was "only" pattern-matching.

Epic Download URLs look like this:
/Builds/Fortnite/CloudDir/ChunksV4/58/A2C909E75477808C_B279E81A43451CD75E3D36BF8FE5B80E.chunk
or more abstract
/Builds/<GameCodeNameOrBuildHash>/CloudDir/ChunksV4/<hash>/<moreHash>_<evenMoreHash>.chunk

Epic Patch/Update URLs are a bit different (as can be seen in the first post)

I might also, that the bounds check CoPilot suggested should also be added to the SteamID-Parser.

The code I wrote does this:

// Get the URL part from the http request line "GET <url> HTTP/1.1"
var urlPart = Request.Split(' ')[1];
// Split URL by '/'
var splittedUrl = urlPart.Split('/');
// Check that first subdirectory is "Builds". (Might need that additional case for updates to match for 'ias'
if (splittedUrl[1] == "Builds")
{
    // Next Subdirectory is thus the ProjectID/GameName
    DownloadIdentifier = splittedUrl[2];
}
// If not in Builds throw the Exception like in Steam parsing
else
{
    throw new InvalidOperationException($"Could not parse epicgamesProjectID from {Request}");
}

@devedse
Copy link
Owner

devedse commented May 1, 2025

I'm trying to figure out it I can somehow run the GitHub actions stuff on this PR so we get a BETA build. I'm reading some stuff here but can't find it yet:
https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/approving-workflow-runs-from-public-forks

@devedse
Copy link
Owner

devedse commented May 1, 2025

I installed EPIC games and downloaded a few games:

Super Space Club:
[epicgames] 10.88.42.1 / - - - [01/May/2025:23:46:20 +0200] "GET /Builds/Org/o-w5juz4p54jnbqrtqfw5x65yd6p6lpx/d23691af8c7d42729f66d929c8609676/default/ChunksV4/44/4FC69069BC8811E5_ABEC99A147DD723E34905FB007E37AF2.chunk HTTP/1.1" 200 28900 "-" "EpicGamesLauncher/18.5.1-42015280+++Portal+Release-Live Windows/10.0.26100.1.256.64bit" "MISS" "download.epicgames.com" "-"

Snakebird Complete:
[epicgames] 10.88.42.1 / - - - [01/May/2025:23:47:40 +0200] "GET /Builds/Org/o-c5ek86yk5np9s3wezvcqkfjdkkahk5/8ecb2895d94f4c64a743c1c4f056743f/default/ChunksV4/62/F0DA74AC1159789D_8CBFF7EB496875E5FDB9E08EF33F5C0D.chunk HTTP/1.1" 200 413529 "-" "EpicGamesLauncher/18.5.1-42015280+++Portal+Release-Live Windows/10.0.26100.1.256.64bit" "MISS" "cloudflare.epicgamescdn.com" "-"


Satisfactory:
[epicgames] 10.88.42.1 / - - - [01/May/2025:23:49:24 +0200] "GET /Builds/Org/o-9r9hp69ccnr39qp9f9mgpsznznu4as/Crab/default/ChunksV4/77/108A3B58210A1D41_02B87FE845C72BD9FBC26F9DD089E015.chunk HTTP/1.1" 200 33035 "-" "EpicGamesLauncher/18.5.1-42015280+++Portal+Release-Live Windows/10.0.26100.1.256.64bit" "MISS" "cloudflare.epicgamescdn.com" "-"

Sadly for a lot of the games I don't really see identifiers that we can use to identify the game. I guess we could detect individual game downloads but for the games itself we'd need a mapping of some sorts.

@devedse
Copy link
Owner

devedse commented May 1, 2025

I found some things, when a game starts downloading it first downloads a manifest file:

http://cloudflare.epicgamescdn.com/Builds/Org/o-w5juz4p54jnbqrtqfw5x65yd6p6lpx/d23691af8c7d42729f66d929c8609676/default/1sE9O19OT_X-rOWTFEiMUGNBYu8I1A.manifest?f_token=<blahblah>

Someone wrote a parser that can parse the data out of this:
https://github.com/NotOfficer/EpicManifestParser/tree/master

Using this parser I can read this data:
image

Using this I should be able to grab the game name. I'll think about this some more and might implement this in the future.

@devedse
Copy link
Owner

devedse commented May 6, 2025

I'll close this PR in favor of some things I'm currently working on:
#71

@devedse devedse closed this May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants