- Joined
- Feb 23, 2018
- Messages
- 225
- Reaction score
- 35
- Achievement
Hi, this is script for searching video on youtube with a random keyword from 2 keywords ("bypass captcha 9hits" and "google search 9hits"). Then click to the video if found in the search result.
Finally, while viewing the video, the script will click to the playing time bar for 2 times.
You are able to modify this script to fit your need, as well as make it more flexible, more real. Or you can also as help from us to create your own script.
https://youtu.be/mT6NSk1M3E4
Finally, while viewing the video, the script will click to the playing time bar for 2 times.
You are able to modify this script to fit your need, as well as make it more flexible, more real. Or you can also as help from us to create your own script.
https://youtu.be/mT6NSk1M3E4
Code:
//Wait for page load
await Delay(1000);
while(await IsLoading()) await Delay(1000);
//typing a random keyword and hit enter (13 is key code of Enter key)
var randomKeyword = RandomArray(["bypass captcha 9hits", "google search 9hits"]);
await Delay(1000);
Typing(randomKeyword);
await Delay(1000);
SendKeyPress(13);
//delay for a while when we just press Enter.
await Delay(5000);
//check for our target if found or not. I would like to click to any video has title contain 9Hits
var myTarget = GenerateXpath("a", "text", "%9Hit%");
var found = false;
var pageCount = 0;
while(!found)
{
found = await GetAttribute(myTarget, "href");
//if found the target, do click it
if(found){
ClickByXpath(myTarget);
await Delay(5000); //wait for the video load
//click to the time playing process
await Delay(Random(5000, 10000));
ClickByClass("ytp-load-progress");
//click to the time playing process one more time
await Delay(Random(5000, 10000));
ClickByClass("ytp-load-progress");
// do more interaction....
//.....
//----------
break;
}
//if not found, scroll down to laod more result, and check again
SendMouseWheel(0, -10000);
await Delay(3000);
//suppose we only scroll down for 5 times.
if(pageCount > 5) break;
pageCount++;
}