question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add logging_client_events

See original GitHub issue

Notes

This request is not associated with any specifific function This is a periodical request of instagram app at any version which contains a bunch of logs of users interaction with the app and a validation code. I’ve looked on github many instagram apis and so far nobody was able (or interested) in reverse engineer it. I do have a little suspect that it can be related to other problems i’ve in my project. Does anyoe have the skills to reverse it?

i’m pasting here a sample request of what im talking about

/logging_client_events HTTP/1.1
X-IG-Connection-Type: WIFI
X-IG-Capabilities: 3brTvw==
X-IG-App-ID: 567067343352427
User-Agent: Instagram 100.0.0.17.129 Android (26/8.0.0; 480dpi; 1080x1920; samsung; SM-A520F; a5y17lte; samsungexynos7880; pt_BR; 161478664)
Accept-Language: pt-BR, en-US
Content-Type: multipart/form-data; boundary=WclRaGE_-iaawkAGZnprHXDKaqrJ8r
Accept-Encoding: gzip, deflate
Host: graph.instagram.com
X-FB-HTTP-Engine: Liger
Connection: keep-alive
Content-Length: 1576

--WclRaGE_-iaawkAGZnprHXDKaqrJ8r
Content-Disposition: form-data; name="access_token"

567067343352427|f249176f09e26ce54212b472dbab8fa8
--WclRaGE_-iaawkAGZnprHXDKaqrJ8r
Content-Disposition: form-data; name="format"

json
--WclRaGE_-iaawkAGZnprHXDKaqrJ8r
Content-Disposition: form-data; name="cmsg"; filename="ab67f151-d0ae-4c63-a45e-3fa8eedf56ab_1_zero.batch.gz"
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary

?T?n?6?=GqQ?Mb??kg`???.
??(?%?Z??A????i&?>?E?z??????%h???<d]??P?#?	?h??A ???9D???^?LT}?A
#?)??=S{??!a?`(a?CE)#?0?<
S?<N??r!?,?9??#I)?9?d???	NIH2???dy??lU?j[
12?,???*?RWRFD?8?\?,'T&.??9?Jw???q???
#;U????7	b?c`?\o=#????????TZ????7?!;\??T?T?WWm'??,????F?4?X?O0$?rF ??8?iK???#?k^x/?+OW+??=??q
?6?????z	JQ.????8b?Q?]???,??%?????]???????b??b?(?`F?SiW8-|3?-???r???r?:N?Y??ls?'H?`??7r^5????x?xV(?[?7ll?CR??hwI??????8?y1~?&????/???o?Fl.d?
;????c????n?????*??j???6G1?q`?2-?m?N<-_rT??~????G???_^???F???+g.u+????\?V?'v?j?QF?V?w????E?i+?c??9?\??u?????'???k??"? ?	F???K???+?`
?F:N8?????!??5??\??n????t??u
??|B???"??n???0}S1g?y???K7?q?????n??h?j???]er?O???t*??????Kr??4c?w?T?????????g????!!?QFd?????;?,?X?B/???b?P@ "???????????3?}6????O??^?v??5?-??dy?Lff??n?D?Fk?X-??\?????~4m?n\l??G????p??ek??q?C[??,0v?q???J(/???W
--WclRaGE_-iaawkAGZnprHXDKaqrJ8r
Content-Disposition: form-data; name="sent_time"

1566875183.401
--WclRaGE_-iaawkAGZnprHXDKaqrJ8r
Content-Disposition: form-data; name="cmethod"

deflate
--WclRaGE_-iaawkAGZnprHXDKaqrJ8r--

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:29

github_iconTop GitHub Comments

1reaction
crylonbluecommented, Aug 7, 2021

To maybe solve this issue, the channel “regular” has no qs token. You can just send your events there. A simple implementation in python since, i am not that good in typescript.

import base64
import zlib
import requests

def logging_client_events(message_dict):
    data = {
        "format": "json",
        "access_token": constants.APP_ID + "|" + constants.ACCESS_TOKEN,
        "sent_time": self.api.get_client_time(),
        "system_uptime": self.get_system_uptime(),
        "compressed": "1",
        "messsage": base64.b64encode(zlib.compress(bytes(json.dumps(message_dict).encode()), 1)).decode()
    }

    log_request = self.session.post("https://graph.instagram.com/logging_client_events", data=data)

    return log_request

So i think its pretty much solved, now all you have todo is to add logging_client_events in each api_call, that has a event involved for example “ig_main_feed_request_succeeded” etc.

1reaction
Nerixyzcommented, Jul 8, 2020

@bolds07 no, no repo yet. Currently have few examples collected, probably it’ll help to collect more

Edit: this repo looks interesting, though: https://github.com/DamianoMagrini/instaverse/blob/857273e475a868585c91c07f626cbba5553ccb73/reversed-api/src/instagram/9568347_events.ts

This is for the web api.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging HOWTO — Python 3.11.1 documentation
Log event information is passed between loggers, handlers, filters and formatters in a LogRecord instance. Logging is performed by calling methods on instances ......
Read more >
Windows Setup Log Files and Event Logs - Microsoft Learn
Windows Setup Event Logs. Windows Setup includes the ability to review the Windows Setup performance events in the Windows Event Log viewer.
Read more >
Client Event Logs - WatchGuard Technologies
The Client Event Logs is a list of client connectivity events: ... You can view the Client Connection Logs in one of these...
Read more >
How to Build a Logging Web App with Server-Sent Events ...
Let's define a new route for our SSE connection. To enable SSE, we need to flush a couple of headers back to our...
Read more >
Windows Logging Basics - The Ultimate Guide To Logging
Examples are provided to give you a full grasp of how monitoring events can help you manage your systems for health and security....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found