@@ -0,0 +1,2398 @@
+package rs.luka;%0A%0Aimport javax.swing.JOptionPane;%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.nio.file.FileVisitOption;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0Apublic class Main %7B%0A    /**%0A     * Directory for all files created by this program, modify if needed. Windows is weird though, you better set it by hand.%0A     */%0A    static final File dir = new File(System.getProperty(%22user.home%22), %22askfm%22);%0A    /**%0A     * In case of multiple roots (or manual setting of index), this keeps already downloaded usernames.%0A     * ArrayList might be a tad faster for binarySearch/sort, but in the end, it'll be dumped to array anyway%0A     */%0A    static final List%3CString%3E existingFilenames = new ArrayList%3C%3E();%0A    /**%0A     * Queue for usernames%0A     */%0A    static UniQueue queue;%0A%0A    /**%0A     * Will run forever, don't forget to stop it when you get what you wanted%0A     * @param args will be ignored%0A     */%0A    public static void main(String%5B%5D args) %7B%0A        if(!dir.isDirectory())%0A            dir.mkdir();%0A        setExisting();%0A        String username = JOptionPane.showInputDialog(%22Enter username:%22);%0A        queue = new UniQueue(username);%0A        System.out.println(queue.peek());%0A        try %7B%0A            Thread.sleep(10_000);%0A        %7D catch (InterruptedException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        while(queue.hasNext()) %7B%0A            queue.addSeparator();%0A            username = queue.next();%0A            if(Collections.binarySearch(existingFilenames, username) %3C 0 %7C%7C !queue.isBuilt()) %7B%0A                System.out.println(%22Starting %22 + username);%0A                new Retriever(username, dir).go();%0A            %7D else %7B%0A                System.out.println(username + %22 already downloaded%22);%0A            %7D%0A        %7D%0A    %7D%0A%0A    /**%0A     * Setting existing files%0A     * @see this#existingFilenames%0A     */%0A    public static void setExisting() %7B%0A        try %7B%0A            Files.walk(dir.toPath(), FileVisitOption.FOLLOW_LINKS).forEach((Path p) -%3E %7B%0A                String%5B%5D tokens = p.getFileName().toString().split(%22%5C%5CQ - %5C%5CE%22);%0A                existingFilenames.add(tokens%5Btokens.length - 1%5D.split(%22%5C%5C.%22)%5B0%5D);%0A            %7D);%0A            Collections.sort(existingFilenames);%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%7D%0A

Create Main.java