Jump to content
UBot Underground

Download Files using the Bot


Recommended Posts

Hi all,

 

lets take a simple example of a site

dafont.com

 

now i want to make a bot that downloads all the new fonts till then end so how can i do that?

Any hint or a slight guidance are most welcomed.

 

Thanks in advance.

Utsav

Link to post
Share on other sites
define Startup {
    clear list(%Main Menu)
    navigate("http://www.dafont.com/", "Wait")
    wait for element(<class="dl">, 120, "Appear")
    comment("Build Main Menu")
    add list to list(%Main Menu, $scrape attribute(<outerhtml=w"<a href=\"./alpha.php?lettre=*\"> *</a>">, "fullhref"), "Don\'t Delete", "Global")
}
define Go To Main Page {
    navigate($list item(%Main Menu, 0), "Wait")
    wait for browser event("Everything Loaded", "")
    wait for element(<class="dl">, 120, "Appear")
    if($comparison($scrape attribute(<name="fpp">, "value"), "!=", 50)) {
        then {
            change dropdown(<name="fpp">, 50)
            click(<value="Submit">, "Left Click", "No")
            wait for browser event("Page Loaded", 120)
        }
        else {
        }
    }
    set(#Temp URL, $url, "Global")
}
define Go To Sub Page {
    loop while($exists(<src="/img/page_suivante.gif">)) {
        click(<src="/img/page_suivante.gif">, "Left Click", "No")
        wait(10)
        wait for browser event("Page Loaded", 120)
        if($exists(<src="/img/theme_suivant.gif">)) {
            then {
            }
            else {
                wait for element(<src="/img/page_suivante.gif">, 120, "Appear")
            }
        }
        set(#Temp URL, $url, "Global")
        Download From Page()
        navigate(#Temp URL, "Wait")
    }
}
define Download From Page {
    clear list(%URL)
    add list to list(%URL, $scrape attribute(<class="dl">, "href"), "Don\'t Delete", "Global")
    loop while($comparison($list total(%URL), ">", 0)) {
        download file($list item(%URL, 0), "{$special folder("Desktop")}\\fonts\\{$find regular expression($list item(%URL, 0), "(?<=f\\=).*")}.zip")
        remove from list(%URL, 0)
    }
}
Startup()
loop while($comparison($list total(%Main Menu), ">", 0)) {
    Go To Main Page()
    Download From Page()
    comment("Work Around For Freez")
    navigate(#Temp URL, "Wait")
    Go To Sub Page()
    remove from list(%Main Menu, 0)
}

 

 

 

This bot will go through all the main pages, and then the sub pages and download all fonts on every page.

 

 

This will take a lot or resources from the site, so be gentle or they may ban your ip.

 

 

dafont.ubot

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...