Open dziban303 opened 6 years ago
You have to install 3.6.6, looks like you installed latest 3.7:
Doh. Forgot to fix the PATH variable. Thanks, now the script it running. It went through a few giveaways, then crashed.
It's unable to grab the next page URL; I'm working on fix for that right now (shhh dont' tell @zdrouse )
That would be great if you could fix it. It's a bit beyond me, I'm afraid.
It'd be nice if it would accept username and password as command line variables, or store them in a cfg file.
This is my 2nd time ever messing around with python, honestly. I normally outsource it.
But i'm almost positive the xpath is incorrect (maybe something updated in the recent months), and it doesn't know how to use the "navigate to" function in that iteration function.
Lastly, I'm pretty sure we can just save the variables somewhere. I'll look at making a config line
So, to make it so you don't have to type login over and over, go to like 47/48 on giveaway.py
Updated and fixed the loop problem:
Works for a bit, and then:
I haven't figured out why pyppeteer likes to get hungup on tabs opening/closing
So i made a quick "ghetto" fix:
Create a file called "loop.py" (in same directory as give_it_away_now.py)
put this in it:
from subprocess import Popen
import sys
filename = sys.argv[1]
while True:
print("\nStarting " + filename)
p = Popen("python " + filename, shell=True)
p.wait()
Now start giveaway bot with
python loop.py "give_it_away_now.py"
Basically this is a way to make sure the process restarts. I'm working on a way to log the last page it gets "stuck" on, so if it restarts, it just continues.
There are a lot of pages, right? So upon restart, what about creating a random number in loop.py and starting at that page? That would ensure it's not doing the same 20 giveaways over and over.
Sure,
Add this to the top of the page:
Line: 13
RANDOM_PAGE = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
Add more numbers if you'd like
Then change the giveaway url string to (on line 23'ish, can't say since mine is edited a lot)
await login_page.goto('https://www.amazon.com/ga/giveaways?pageId=' + str(numpy.random.choice(RANDOM_PAGE)))
I see you added support for YT videos on your fork. Since the tab doesn't have to be in the foreground for the 30s timer to work, could the bot move on to the next giveaway and come back to the video giveaway tab afterwards? That way the bot won't get stuck only doing 2 giveaways per minute.
It's actually less than 2 per minute, because the bot's 30 second timer only starts several seconds after the tab is opened; the Continue button activates well before the bot clicks it.
Anyway you've got the "Issues" section disabled on your fork, you might consider turning it on (in repository settings).
Thanks for everything!
I've actually rebuilt a ton of features, just struggling time to upload them.
If you multi-thread the chrome process, it times out often. I tried :(
I added all video support, a database for remembering giveaways visited, and everytype of giveaway completed. I do the amazon video type by injecting javascript into the page lol
updated my repo, added the features above, and enabled issues tracker
After launching the script, it asks for Amazon username and password, then launches chromium. At that point, nothing else happens. It doesn't open anything in chromium.
Meanwhile, python.exe consumes a CPU core.![2018-07-05_15-51-59](https://user-images.githubusercontent.com/7931765/42347585-ef401292-806b-11e8-817b-d1f5d9a2c769.png)
Stopping the process yields the following:![cmd_2018-07-05_15-58-27](https://user-images.githubusercontent.com/7931765/42347699-4c18425a-806c-11e8-8774-2d57bd71b1cc.png)
Any ideas?