Comments (11)
@heartz66 I merged it to master, the next public version will include it. Thanks for the contribution!
from csgo-trader-extension.
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.
@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.
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.
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.
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.
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.
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.
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.
@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.
I have just published a pull request for this improvement: #354
from csgo-trader-extension.
Related Issues (20)
- Getting rate limited after spending some time on market. HOT 1
- NSFW filter improvement suggestion HOT 1
- Generate multisell link from items chosen in inventory HOT 4
- Cancelling market trades adds checkboxes
- Extension crashing vivaldi HOT 1
- feat request: ability to see the amount of a specific item that you own HOT 7
- inv is bugged HOT 2
- Inv is bugged HOT 1
- Price, Float, SCM and Paint Index indicators overlap due to the new steam UI changes. Font for inventory value is smaller because of the same changes.
- Cookies no longer refresh after expired? HOT 1
- For the life of me, I can't find the settings... HOT 3
- Icon sometimes erroneously displays 1000s of notifications HOT 4
- Inventory - Get float values automatically
- Price scraper no longer generates csgotrader pricing HOT 1
- Selecting Skins in Inventory Bug HOT 1
- CSGO Trader is incorrectly showing the price of my item. HOT 1
- Prices Wildly Incorrect / Out of Date in Latest JSON HOT 4
- Handling of "Run T, Run" Sticker is bugged
- Cs2stash links are broken HOT 2
- Dopplerinfo is broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csgo-trader-extension.