Skip to content

Instantly share code, notes, and snippets.

@Scrxtchy
Last active January 24, 2019 13:06
Show Gist options
  • Save Scrxtchy/af00c737cf05ecaee102de8126363336 to your computer and use it in GitHub Desktop.
Save Scrxtchy/af00c737cf05ecaee102de8126363336 to your computer and use it in GitHub Desktop.
import requests
from uuid import uuid4
import json
headers = {"X-GatewaySession":"[REDACTED]", "X-ClientVersion":'dev'}
data = {
"jsonrpc": '2.0',
"method": "Companion.initApp",
"params": {"locale": "en_US", "fallbackLocale": "en-GB"},
"id": str(uuid4())
}
x = requests.post("https://companion.battlefield.com/jsonrpc/web/api?Companion.initApp", headers=headers, data=json.dumps(data))
from pprint import pprint
pprint(x.json())
this.jsonRpc("Telemetry.sendCompanionEvent", {
this.jsonRpc("Telemetry.batchSendCompanionEvents", {
}, a.prototype.jsonRpc = function(e, t, n, r, i) {
SC.client.jsonRpc(e, t, function(t) {
SC.client.jsonRpc("Companion.setActivePersona", n, function() {
this.jsonRpc("Battlepack.getSummary", r, e, t)
this.jsonRpc("Battlepack.listBattlepackVouchers", n, e, t, !0)
this.jsonRpc("Friend.getFriendsWithPresence", {}, e, t)
this.jsonRpc("Friend.setFollowing", r, function() {
this.jsonRpc("Friend.setFutureFollowing", r, function() {
this.jsonRpc("Loadout.getItems", {
this.jsonRpc("Loadout.getItemGates", {
this.jsonRpc("Loadout.getLoadout", {
o("savePresets", e, t), this.jsonRpc("Loadout.savePresets", {
o("getPresets", e, t), this.jsonRpc("Loadout.getPresetsByPersonaId", {
this.jsonRpc("Battlepack.getSummary", {
this.jsonRpc("Loadout.purchaseItemByGuid", {
this.jsonRpc("Stats.getCareerForOwnedGamesByPersonaId", r, t, n)
this.jsonRpc("Progression.getDogtagsByPersonaId", i, function(e) {
this.jsonRpc("Loadout.getEquippedDogtagsByPersonaId", i, function(e) {
this.jsonRpc("Loadout.equipDogtag", i, function(e) {
this.jsonRpc("Companion.getClaimableCompanionDogtag", r, t, n)
this.jsonRpc("Companion.claimCompanionDogtag", r, t, n)
this.jsonRpc("Progression.getFilteredCodexByPersonaId", r, function(e) {
this.jsonRpc("Progression.getWeaponsByPersonaId", i, function(e) {
this.jsonRpc("Progression.getWeapon", a, function(e) {
this.jsonRpc("Progression.getVehiclesByPersonaId", i, function(e) {
this.jsonRpc("Progression.getVehicle", a, function(e) {
this.jsonRpc("Progression.getMedalsByPersonaId", i, function(e) {
this.jsonRpc("Progression.getKitRanksMapByPersonaId", {
this.jsonRpc("Stats.detailedStatsByPersonaId", i, function(e) {
r.jsonRpc(t, n, function(e) {
this.jsonRpc("CompanionSettings.getAllSettings", {}, e, t)
this.jsonRpc("CompanionSettings.setLocale", r, t, n)
this.jsonRpc("CompanionSettings.setEnableFriendsPlayingDigest", r, t, n)
this.jsonRpc("CompanionSettings.setEnableCrashReports", r, t, n)
this.jsonRpc("CompanionSettings.setEnableUsageSharing", r, t, n)
this.jsonRpc("CompanionSettings.setShowProfileTo", r, t, n)
e = e || !1, this.jsonRpc("Companion.getBattlelogAuthCode", {}, function(i) {
SC.client.jsonRpc("Companion.isLoggedIn", {}, function() {}, function() {})
SC.client.jsonRpc("Companion.isLoggedIn", {}, function(e) {
this.jsonRpc("Identity.getEntitlements", {}, e, t)
this.jsonRpc("Emblems.fetchAllPrivateEmblems", r, function(t) {
this.jsonRpc("Emblems.getExclusiveEmblems", {}, function(t) {
this.jsonRpc("Emblems.getAvailableShapes", r, e, t)
this.jsonRpc("Emblems.fetchPrivateEmblem", a, function(e) {
this.jsonRpc("Emblems.savePrivateEmblem", o, function(e) {
this.jsonRpc("Emblems.newPrivateEmblem", r, function(e) {
this.jsonRpc("Emblems.equipEmblem", {
this.jsonRpc("Emblems.equipExclusiveEmblem", {
this.jsonRpc("Emblems.getEquippedEmblem", i, n, r)
this.jsonRpc("Emblems.deletePrivateEmblem", {
this.jsonRpc("Emblems.shareGalleryEmblem", {
this.jsonRpc("Emblems.fetchSharedEmblem", {
this.jsonRpc("Emblems.importSharedEmblem", {
this.jsonRpc("Petition.reportEquippedEmblem", {
this.jsonRpc("Petition.reportSharedEmblem", {
this.jsonRpc("News.getNewsWithGameByTopic", o, i, a)
this.jsonRpc("News.getGameVideosByTopic", o, i, a)
this.jsonRpc("News.getStreamsWithGame", a, r, i)
# https://eaassets-a.akamaihd.net/bfcompanionprod/static/main/bundles/9014390/vendor.js -- 7:24 PM 4/08/2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment