Coder Social home page Coder Social logo

Comments (11)

gergelyszabo94 avatar gergelyszabo94 commented on August 14, 2024 1

@heartz66 I merged it to master, the next public version will include it. Thanks for the contribution!

from csgo-trader-extension.

cjavad avatar cjavad commented on August 14, 2024

I went back and forth a bit, and based on the POST request from cs.money to cs.money/generate_screenshot i was able to reverse engineer the post request, so basically all the information /generate_screenshot requires is 1. an inspect link attached as a json body 2. a cookie containing a var called csgo_ses and steamid, i have tested it a bit and it seems that even after recreating my sessions on cs.money the following variables {"csgo_ses":"e2b82703525de8b751c7e132d3b41bcd05fe5cfc8767aee0078701d1c086fc8d", "steamid":"76561198428292331"} seems to still work, i am assuming the steamid can be changed to whatever but i need to confirm that. The request returns an id which can be added to the base links of cs.money's screenshot service.

Short snippet to demonstrate the principles in python3 (Using the third-party extension requests)

import requests

insp = "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198428292331A16376533832D5388044860375221111"
url = "https://cs.money/generate_screenshot"

def get_screen_id(inspect_link):
    r = requests.post(url, json={"inspect_link":inspect_link}, cookies={"csgo_ses":"e2b82703525de8b751c7e132d3b41bcd05fe5cfc8767aee0078701d1c086fc8d", "steamid":"76561198428292331"})
    return r.text

def get_screen_links(csm_id):
    link2d = "https://s.cs.money/{}_image.jpg".format(csm_id)
    link3d = "https://3d.cs.money/?q={}".format(csm_id)
    return {"2d":link2d,"3d":link3d}

from csgo-trader-extension.

gergelyszabo94 avatar gergelyszabo94 commented on August 14, 2024

@cjavad This request returns "19 sign via steam" for me, but I will poke around later. It would still mean users having to update their csmoney cookies in the extension for this to work I believe, so the user experience would be degraded. The extension could be modified to run on cs.money as well and update the cookies when/if they are changed. In my experience cs.money logs you out every 24 hours.

from csgo-trader-extension.

cjavad avatar cjavad commented on August 14, 2024

Upon further inspection, when switching my internet connection or changing my ip, the response indeed becomes "19 sign via steam".

Edit: It might be possible to automatically fetch the cookies, so the user only simply has to login into cs.money once.

from csgo-trader-extension.

gergelyszabo94 avatar gergelyszabo94 commented on August 14, 2024

As I said fetching the cookies should be possible by giving the extension permission to run on cs.money, however the site would have to be open all the time and users would have to reauthenticate with cs.money daily. I don't think we can achieve good enough UX so I am putting this aside again. Thanks for the investigation and your findings.

from csgo-trader-extension.

cjavad avatar cjavad commented on August 14, 2024

I re-ran the same script today with the same variables as previous with new unregistered inspect links, and it returned correct results every time. The cookie returned has a 1 year expiration date (Tue, 04 Aug 2020 14:26:43 GMT). Based on this it seems that one authentication is enough for a longer period of time.

from csgo-trader-extension.

gergelyszabo94 avatar gergelyszabo94 commented on August 14, 2024

That would be nice, if I log out of csmoney it returns the sign in thing again though. I will log back in and check if it works tomorrow when it logs me out automatically.

from csgo-trader-extension.

gergelyszabo94 avatar gergelyszabo94 commented on August 14, 2024

I either forgot to check it when it logged me out or it did not log me out. Anyway, the same thing that worked two days ago does not work right now, unfortunate.

from csgo-trader-extension.

heartz66 avatar heartz66 commented on August 14, 2024

If you are still interested in a similar feature for this, I can make a PR to support swap.gg their screenshot API.

from csgo-trader-extension.

gergelyszabo94 avatar gergelyszabo94 commented on August 14, 2024

@heartz66 Hi, that could be great actually! I did not know they have one. cs.deals' service has been under maintenance for god knows how long. I started giving up on it.

from csgo-trader-extension.

heartz66 avatar heartz66 commented on August 14, 2024

I have just published a pull request for this improvement: #354

from csgo-trader-extension.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.