fork download
  1. import java.io.IOException;
  2. import org.jsoup.Jsoup;
  3. import org.jsoup.nodes.Document;
  4. import org.jsoup.select.Elements;
  5. import java.net.URL;
  6. import java.io.File;
  7. import java.io.InputStream;
  8. import java.nio.file.Files;
  9.  
  10. public class hello {
  11. public static void main(String[] args) {
  12. parce t = new parce("Parce");
  13.  
  14. t.start();
  15.  
  16. try {
  17.  
  18. t.join();
  19.  
  20. } catch (InterruptedException e) {
  21. System.out.printf("%s error with threaad", t.getName());
  22.  
  23. }
  24. }
  25. }
  26.  
  27. import java.io.IOException;
  28. import org.jsoup.Jsoup;
  29. import org.jsoup.nodes.Document;
  30. import org.jsoup.select.Elements;
  31. import java.net.URL;
  32. import java.io.File;
  33. import java.io.InputStream;
  34. import java.nio.file.Files;
  35. public class parce extends Thread {
  36. parce(String name) {
  37. super(name);
  38. }
  39. randd RRR = new randd();
  40. String adres = RRR.getadres();
  41. String filename = RRR.getFilename();
  42.  
  43. public void run() {
  44. while(!Thread.interrupted())
  45. try {
  46. Document doc = Jsoup.connect(adres).get();
  47. Elements h1 = doc.select("[src$=.png]");
  48. String Link = h1.attr("src");
  49. URL ttt = new URL(Link);
  50. InputStream inputStream = ttt.openStream();
  51. Files.copy(inputStream, new File("c:/files/" + filename).toPath());
  52. System.out.print(Link);
  53.  
  54. } catch (IOException e) {
  55. System.out.printf(" Error with parce ");
  56. }
  57.  
  58. }
  59. }
  60.  
  61. public class randd {
  62. String urlll = "https://p...content-available-to-author-only...t.sc/";
  63. String[] fullRandom = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
  64. int a = 0;
  65. int b = 36;
  66. int rand1 = a + (int) (Math.random() * b);
  67. int rand2 = a + (int) (Math.random() * b);
  68. int rand3 = a + (int) (Math.random() * b);
  69. int rand4 = a + (int) (Math.random() * b);
  70. int rand5 = a + (int) (Math.random() * b);
  71. int rand6 = a + (int) (Math.random() * b);
  72. String filename = (fullRandom[rand1] + fullRandom[rand2] + fullRandom[rand3] + fullRandom[rand4] + fullRandom[rand5] + fullRandom[rand6]) + ".png";
  73. String adres = urlll + (fullRandom[rand1] + fullRandom[rand2] + fullRandom[rand3] + fullRandom[rand4] + fullRandom[rand5] + fullRandom[rand6]);
  74.  
  75. public String getadres() {
  76. return adres;
  77. }
  78. public String getFilename(){
  79. return filename;
  80. }
  81.  
  82. }
  83.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:27: error: class, interface, or enum expected
import java.io.IOException;
^
Main.java:28: error: class, interface, or enum expected
import org.jsoup.Jsoup;
^
Main.java:29: error: class, interface, or enum expected
import org.jsoup.nodes.Document;
^
Main.java:30: error: class, interface, or enum expected
import org.jsoup.select.Elements;
^
Main.java:31: error: class, interface, or enum expected
import java.net.URL;
^
Main.java:32: error: class, interface, or enum expected
import java.io.File;
^
Main.java:33: error: class, interface, or enum expected
import java.io.InputStream;
^
Main.java:34: error: class, interface, or enum expected
import java.nio.file.Files;
^
8 errors
stdout
Standard output is empty