-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(playstation): add queuing selector #1173
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding a new store, do you mind adding to the inStock
array?
You can add by doing this:
diff --git a/src/store/model/playstation.ts b/src/store/model/playstation.ts
--- a/src/store/model/playstation.ts
+++ b/src/store/model/playstation.ts
@@ -3,10 +3,16 @@ import fetch from 'node-fetch';
export const PlayStation: Store = {
labels: {
- inStock: {
+ inStock: [
+ {
container: '.productHero-info .add-to-cart:not(.hide)',
text: ['Add']
- },
+ },
+ {
+ container: '.bulleted-info.queue',
+ text: ['queue']
+ }
+ ],
outOfStock: {
container: '.productHero-info .out-stock-wrpr:not(.hide)',
text: ['Out of Stock']
Other than that, thank you updating!
Ah cool, I didn't know that could be a list. Adding this could lead to some false positives for people who have added the Playstation store but on balance it's a pretty good signal. |
Would this still work even if you get the softblock captcha page? After running the script for a few minutes on the ps5 website, it hits this "We're trying to get you in" captcha page (eg. https://direct-queue.playstation.com/softblock/?c=sonyied&e=psdirectprodku1), does the queue checking work even if it gets hit with this captcha? Or would we have to solve the captcha ourselves every so often to keep it alive Edit 12/8/2020: Would like to report that this fork worked perfectly today on the ps5 queue. |
Have more info on how to get this implemented? Queue went up today and did not get in on time. |
It didn't alert me for today's queue- but I think it might be due to the fact that my instance was one of the first to access the site at the time the queue went up, therefore bypassing the queue? I was running non-headless and I saw it was still able to access the product page perfectly fine, which is why I come to that conclusion. With that being said, it might be hit or miss if this works at times. For implementation, until this gets pushed into the main branch, you'd have to clone willwhitney's repo, and follow the same instructions as a normal install. In your .env file you would put I believe that was all I had to do to get it working. |
you need to not persist cookies to check queue
…On Wed, Dec 9, 2020 at 1:47 PM kenbalint ***@***.***> wrote:
It didn't alert me for today's queue- but I think it might be due to the
fact that it was one of the first to access the site, therefore bypassing
the queue? I was running non-headless and I saw it was still able to access
the product page perfectly fine, which is why I come to that conclusion.
With that being said, it might be hit or miss if this works at times.
For implementation, until this gets pushed into the main branch, you'd
have to clone willwhitney's repo, and follow the same instructions as a
normal install. In your .env file you would put
SHOW_ONLY_SERIES="sonyps5c,sonyps5de" and STORES="playstation-queue"
I believe that was all I had to do to get it working.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC2ZZEMLMVW6EQYTCUY4CDST7V6TANCNFSM4UN7R3EA>
.
--
محمد Τυπάλδος
|
Yes, forcing it to re-create cookies every time would work to ensure it checks queue. I personally have not checked too far into this repository so I am unsure if this is a pre built-in functionality, but I assume with selenium, removing cookies should not be difficult. |
So what seems to be to verdict here? Should we consolidate or should we keep as-is and fix the linting issues? Not sure if I follow the comments 😞 |
@kenbalint does the change proposed by @jef take care of this? If the browser already has cookies that get it into the store, would it simply report that the console is available from seeing the page? Relatedly, if the browser has already recently visited the store before the queue goes up, could this let us bypass the queue entirely for purchasing? |
This I don't know. It's entirely up to how Sony handles their queuing system. If a queue is ready, this would at least alert the user to open the browser (or open it for you, depending on settings). As for joining the queue, I'm not sure. If you're asking if the Chromium browser keeps the cookies, yes -- it does. Unless you're using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Thank you very much :-)
Awesome work here!
Unfortunately, the stock drops later than the queue itself, so it will not immediately report that the console is available from seeing the page.
I tested this theory today, I got through the queue "bypassed" as one could say, but unfortunately I don't think this would work for checking out, as it kicked me out of the queue later on (probably since I was on the product page for 10 minutes, which is how long they give you to check out) and forced me to solve a captcha and get a new place in line. Best bet would be to have it so that it just throws away cookies every time it closes the page, so that it starts fresh on each reload if that's possible with the current api / implementations. With new cookies every time, it would certainly get a queue message when the queue comes live, and there is no chance that it loads the product page instead of the queue page, thus skipping any alerts. |
If this is the case, run streetmerchant with I forget right now if we destroy cookies or not everytime, but perhaps we should do this by default. Maybe not caching (keep using |
Description
Addresses #1049 by checking for the queue information bullet points when visiting the Playstation Store.
Testing
Ran streetmerchant while there was a queue at the PS store. Observed notifications.