Skip to content

Commit ac7d85a

Browse files
Update YouTubeScraper.java
found a solution to the captcha issue, still haven't automated it though
1 parent 719ee48 commit ac7d85a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/YouTubeScraper.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ public static void main(String[] args) throws IOException, InterruptedException{
7070
process.query("input[type='submit']").get().click();
7171
//copied over the url and clicked the button
7272
TimeUnit.SECONDS.sleep(20);//delay to make it work for slow networks
73-
String ur =(String) docu.executeScript("window.location.href");//got the current URLf
73+
String ur =(String) docu.executeScript("window.location.href");//got the current URL
74+
if(ur.contains("captcha")){//found a temporary solution for the captcha issue
75+
System.out.println("Please go to http://www.listentoyoutube.com/captcha.php and prove you're not a robot and run the program again");
76+
System.exit(0);
77+
}
7478
ur=ur.substring(49, ur.length());
7579
/*There are three parameters
7680
* 1. The Server number

0 commit comments

Comments
 (0)