camtheperson / get-my-ps5 Goto Github PK
View Code? Open in Web Editor NEWA CLI utility to help people secure a PlayStation 5 (PS5).
A CLI utility to help people secure a PlayStation 5 (PS5).
I saw on twitter that this was potentially not working after a javascript change on Sony's side yesterday, is that still the case?
Is it possible to just have it open the site and get in the queue right away? I don't need it to put it in my cart and check out for me, I just need to get in the damned queue right away. Beyond that I still have to put all my payment info in since I can't find a way of getting that saved ahead of time without buying something (unless I am missing something).
Thanks.
Platform - Macos Big Sur (11.0.1)
Node Version - 15.4.0
npm version - v7.0.15
Currently I can get past which version i want and if i want an alarm but then when it tries to run it I get this message
Searching for PlayStation 5 disc edition...
/Users/yaboijonno/Desktop/get-my-ps5-master/node_modules/puppeteer/lib/cjs/puppeteer/node/Launcher.js:79
throw new Error(missingText);
^
Error: Could not find browser revision 818858. Run "PUPPETEER_PRODUCT=firefox npm install" or "PUPPETEER_PRODUCT=firefox yarn install" to download a supported Firefox browser binary.
at ChromeLauncher.launch (/Users/yaboijonno/Desktop/get-my-ps5-master/node_modules/puppeteer/lib/cjs/puppeteer/node/Launcher.js:79:23)
at async /Users/yaboijonno/Desktop/get-my-ps5-master/index.js:33:84
npm ERR! code 1
npm ERR! path /Users/yaboijonno/Desktop/get-my-ps5-master
npm ERR! command failed
npm ERR! command sh -c node index
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/yaboijonno/.npm/_logs/2020-12-11T07_22_53_353Z-debug.log
yaboijonno@Jonnos-MacBook-Pro get-my-ps5-master %
Was able to get around 400pings before getting a false positives each time now. Now I can't even login to Playstation on chrome on my pc. (I can still login on my phone using wifi)
After running it for 12 hours, I now get the follow message from all my devices at home:
Access Denied
You don't have permission to access "http://direct.playstation.com/" on this server.
Reference #18.df467b68.1607800613.812b0a7
Hi Cam,
Really great work for spinning up this script. Works as advertised. My js knowledge is limited, so instead of hacking around, thought I'd just ask: where would be the best place to specify a CA file? I'm currently getting
UnhandledPromiseRejectionWarning: Error: net::ERR_CERT_AUTHORITY_INVALID at https://direct.playstation.com/en-us/consoles/console/playstation5-console.3005817
Added sound support for linux distros with the following code change:
function playAlarm() {
const os = process.platform;
if (os === "darwin") {
cmd.runSync("afplay ./alarm.mp3");
} else if (os === "win32") {
cmd.runSync("start ./alarm.mp3");
} else {
cmd.runSync("mplayer ./alarm.mp3")
}
}
Obviously requires mplayer installed.
Works as expected. Thank you for this project, works great!
npm ERR! code 1
npm ERR! path /*/get-my-ps5/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! The chromium binary is not available for arm64:
Ref: https://chromium.googlesource.com/chromium/src.git/+/master/docs/mac_arm64.md
(node:76664) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 69.192.7.202:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1129:14)
(node:76664) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:76664) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I will follow up with a PR later today.
First, let's present the error to the user to make future troubleshooting easier. Something like this:
console.log("Error connecting to PlayStation Direct store.");
console.log(err);
return;
Secondly, let's implement one of these fixes for the Puppeteer timeout issue: https://ourcodeworld.com/articles/read/1106/how-to-solve-puppeteer-timeouterror-navigation-timeout-of-30000-ms-exceeded
Hello,
I am finding that when I execute the run watch
command it is instantly popping up and saying the queue is open, even though it is not. Is there something I'm not doing correctly? I followed the instructions for setting up. and I'm currently running v12.18.1 of node. Attached is a screenshot of what I see happen as soon as I run it, as well as verification of my node version. Please let me know what other details I can provide. Thank you for your efforts!
Hi, I do not know anything on this subject. Am I running ok the bot? Do I have some issues? Because it looks weird to me
Last login: Sat Dec 12 18:24:45 on ttys000
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh
.
For more details, please visit https://support.apple.com/kb/HT208050.
Justins-MacBook-Pro:get-my-ps5-master-2 justindutari$ npm install
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see request/request#3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
[email protected] install /Users/justindutari/Downloads/get-my-ps5-master-2/node_modules/puppeteer
node install.js
Downloading Chromium r818858 - 132.4 Mb [====================] 100% 0.0s
Chromium (818858) downloaded to /Users/justindutari/Downloads/get-my-ps5-master-2/node_modules/puppeteer/.local-chromium/mac-818858
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No repository field.
added 547 packages from 377 contributors and audited 547 packages in 20.828s
29 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities
Justins-MacBook-Pro:get-my-ps5-master-2 justindutari$ npm run watch
[email protected] watch /Users/justindutari/Downloads/get-my-ps5-master-2
node index
Which version would you like? (disc or digital) disc
Would you like to hear a loud, annoying alarm when we find your PS5? (Y or N) Y
Searching for PlayStation 5 disc edition...
No redirect detected. Trying again...
Number of tries 1
No redirect detected. Trying again...
Number of tries 2
No redirect detected. Trying again...
Number of tries 3
No redirect detected. Trying again...
Number of tries 4
No redirect detected. Trying again...
Number of tries 5
Can you make it so it opens an incognito window?
The url passed to puppeteer if the digital edition ps5 is chosen routes to a 404 Page Not Found playstation page. This might not matter since the goal is to look for "queue-it_log" instead of "softblock" but just wanted to note that the urls between ps5 disc and ps5 digital are different besides just the version ID.
Running on OSX.
Pulled master (currently at 1.1)
Ran NPM install
Ran NPM run watch failed
deleted node modules and re-ran npm install/run watch but got the same error.
Previously worked yesterday before pulling 1.1
Error Message:
[email protected] watch /Users/user/Documents/workspace/get-my-ps5
node index
/Users/User/Documents/workspace/get-my-ps5/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:707
catch {
^
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/Users/user/Documents/workspace/get-my-ps5/node_modules/puppeteer/lib/cjs/puppeteer/common/Target.js:19:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch: node index
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/user/.npm/_logs/2020-12-11T18_25_36_215Z-debug.log
@camtheperson please help me tried everthing to resolve these errors for hours nothing is working. Please help i will donate!
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn bash
npm ERR! file bash
npm ERR! path bash
npm ERR! errno -4058
npm ERR! [email protected] watch: node ./src/index
npm ERR! spawn bash ENOENT
npm ERR!
npm ERR! Failed at the [email protected] watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Drewski\AppData\Roaming\npm-cache_logs\2020-12-13T07_32_19_755Z-debug.log
C:\Users\Drewski\Desktop\get-my-ps5>
Maybe it's waiting for the MP3 to finish playing?
Pretty sure there should be a way to do this based on a response code or something.
Windows 10, fresh Node install. Running through Windows Terminal.
Everything runs and the test commands work great, but I left the script running overnight and when I woke up the next morning I found this message.
There are a few warnings, but most obvious one to me is "TimeoutError: Navigation timeout of 30000 ms exceeded"
I wish I had more insight into what caused this, but it seems like an important issue if this script is going to accomplish what it sets out to do. I'll be leaving it on overnight again and will report back if I can replicate it.
I follow the instructions up to typing cmd into the address bar and it opens cmd in the folder, but typing npm install
just makes it return 'npm' is not recognized as an internal or external command, operable program or batch file.
I'd like to know if there is anything I can do to make it easier/quicker to launch this. Here is my current 5 step process
everytime I launch the bot.
How/would it be possible to setup a script or a shortcut that does those 5 steps automatically when I just click on an icon?
Running on Windows 10 from Documents folder. Node was installed into my program files.
I am getting a timeout error that precents the bot from running on its own for long periods of time. Highest number of tries i got was 297. This has been pretty consistent at failing around the 30 try mark. Below is the full dump of error message:
C:\Users\thund\Documents\PS5\get-my-ps5-master\get-my-ps5-master\node_modules\puppeteer\lib\cjs\puppeteer\common\LifecycleWatcher.js:106
return new Promise((fulfill) => (this._maximumTimer = setTimeout(fulfill, this._timeout))).then(() => new Errors_js_1.TimeoutError(errorMessage));
^
TimeoutError: Navigation timeout of 30000 ms exceeded
at C:\Users\thund\Documents\PS5\get-my-ps5-master\get-my-ps5-master\node_modules\puppeteer\lib\cjs\puppeteer\common\LifecycleWatcher.js:106:111
npm ERR! code 1
npm ERR! path C:\Users\thund\Documents\PS5\get-my-ps5-master\get-my-ps5-master
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node index
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\thund\AppData\Local\npm-cache_logs\2020-12-12T17_39_33_233Z-debug.log
npm ERR! code 1
npm ERR! path /Users/xxx/Downloads/get-my-ps5-master
npm ERR! command failed
npm ERR! command sh -c node index
Steps I fdollowed:
Doanloaded and unzipped
navigated to directory
npm install
npm run watch
type disc
error
Cheers, thanks for the help
Hey @camtheperson, if we publish to npm we could simplify instructions down to npx get-my-ps5
. That'd be cool. What do you think?
Hey man, so I'm hell bent on getting this to work on my phone. (AndroidOS). I've gotten this far...everything but the last step. I'm using Termux which works pretty well overall, and the Javascript node was not a problem. I even have the zip file downloaded and extracted using a file Mgr. But I'll be honest, my brain is getting fuzzy because this github is knowledge side project in my life (Most important job raising a preschooler, and full time job as Industrial Hygiene Tech and dog mom of 4, and wife, etc). Help, please? It's gonna be a Christmas gift for my son and his dad/my husband. Thanks
When using npm run round on a mac with 11.0.1, no sound is played. However, when running afplay ./alarm.mp3 from the folder, the sound plays.
Here's one for ya:
I can only run the bot once. If I close it correctly, and then later open a new elevated command prompt, open the working directory, and try to run, it just sits there. Tried npm install
- same thing, sites there. Tried npm run watch
- just sits there. If I reboot my system, I can run the bot again. Thoughts? Last tested with v1.1.0.
I'm running W10 Pro with an i7 8th gen, 40GB RAM, 1TB M.2 SSD, etc. My a/v software is Emsisoft Anti-Malware, but I've set my working directory as an exclusion
I've had this script running for the past week now, and there have been two different Sony Direct restocks in that time, and this script has not alerted me, put me in queue, etc.
I have been using a vpn the whole time, and changing the IP of it every 12 hours or so, so I know I'm not IP banned.
Thanks for all your help creating this! When you get a chance, can you add a step for uninstall...typical uninstall npm or msiexec /x npm does not work.
Currently, the bot directs people to the site as soon as a queue starts forming. However, the queue itself is edition-agnostic, meaning a user running the script could get directed to the site even when their desired edition isn't available.
It would be nice to more effectively detect which edition is actually in stock, and perhaps only send users to the queue if their desired edition is available.
This is kind of a weird problem, because I imagine most people wouldn't mind either edition, period. But I'm not entirely sure how to solve this one at the moment.
Any other thoughts here?
I'm getting the following error on win10:
Error log:
C:\Users\username\Documents\GitHub\get-my-ps5>npm run watch
[email protected] watch C:\Users\username\Documents\GitHub\get-my-ps5
node index
Which version would you like? (disc or digital) disc
Would you like to hear a loud, annoying alarm when we find your PS5? (Y or N) Y
Searching for PlayStation 5 disc edition...
(node:31888) UnhandledPromiseRejectionWarning: Error: Could not find browser revision 818858. Run "PUPPETEER_PRODUCT=firefox npm install" or "PUPPETEER_PRODUCT=firefox yarn install" to download a supported Firefox browser binary.
at ChromeLauncher.launch (C:\Users\username\Documents\GitHub\get-my-ps5\node_modules\puppeteer\lib\cjs\puppeteer\node\Launcher.js:79:23)
at async C:\Users\username\Documents\GitHub\get-my-ps5\index.js:33:84
(Use node --trace-warnings ...
to show where the warning was created)
(node:31888) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:31888) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Hey all,
Trying to get npm run watch to work but I get kicked an error saying the script is missing. I also tried npm open and npm sound and it gave me the same error.
Steps I take:
run cmd (admin)
npm install
npm run watch (no dice)
node -v v15.10.0
npm -v 7.5.3
I do have a VPN set up and this thing HAS worked for me in the past but I gave up and went on to other things and now im trying to hunt again.
We should consider increase the default base interval from 5s
to something like 30s
to 1m
since the new playstation direct queue is putting users in a random position in queue.
This project is still useful because it will open the page when ready, allowing you to not have to worry about checking twitter or where ever else users are checking in stock notifications.
This will help negate being IP banned.
Edit: my original message and title said "reduce"... totally wrong, it should have been "increase"
The bot was working perfectly but something change this morning. Every time I start it tells me that it found one and logs me in. But its still out of stock and no que. I think something change on the website.
Ideal implementation:
.env-example
file.env
to set it up locally.env
file would include parameters for browser path, and incognito (true/false)Had it run to 287 before not trying anymore. Restarted then started again and stopped in the 300s
node v12.19.0
Windows 10 Enterprise
Let me know if I can provide any additional details
Consider directing users to the queue directly instead:
Investigate pushing data into dynamic CLI table. Need to investigate existing UI options for streaming data to console in table format.
Trying this in ChromeOS (Google Pixelbook) and the reponse.data contains something like this (instead of the page content):
<div class="nojavascript alert alert-error">\n' +
` <p>The site requires JavaScript to be enabled! The browser you're using doesn't support JavaScript, or has JavaScript turned off. <br>Try again with a browser that has JavaScript turned on. <a href="https://www.enable-javascript.com/" target="_blank">Learn More</a></p>\n` +
' </div>\n' +
node version: v14.15.1
npm version: 6.14.9
Edit: Same on Mac OS Big Sur (11) / node v15.3.0 / npm 7.0.14
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.