Are you looking for my non-technical blog?

This is now my technical-only blog, my non-technical blog is here.

07 January 2006


Python implementation of Fusker Introduction: Most probably you are redirected from Wikipedia to this page, so please if you have any comment on the code just leave it here so that I can improve it. Also if you can help me know why are people interested in the fusker technology that much, and what web sites do you usually fusker.
The Python Code
""" PyFusker """
""" Author: Tarek Amr """
""" Version: 0.1 """
""" File: """
""" Date: 07 January 2006 """
""" Replce [TAB] with \t """
class Fusker:
[TAB]def __init__(self, url):
[TAB][TAB]self.url = url
[TAB][TAB]self.urls = []
[TAB]def _generate(self):
[TAB][TAB]comp = re.compile("\\[.+\\]")
[TAB][TAB]x = comp.findall(self.url)
[TAB][TAB]if not x:
[TAB][TAB][TAB]print "Url parsing error!"
[TAB][TAB][TAB]x[0] = x[0].strip("[")
[TAB][TAB][TAB]x[0] = x[0].strip("]")
[TAB][TAB][TAB]x1,x2 = x[0].split("-")
[TAB][TAB][TAB]x1 = string.atoi(x1)
[TAB][TAB][TAB]x2 = string.atoi(x2)
[TAB][TAB][TAB]print "Url parsing error!"
[TAB][TAB]if x1 > x2:
[TAB][TAB][TAB]print "Invalid range"
[TAB][TAB]temp_url = comp.split(url)
[TAB][TAB]i = x1
[TAB][TAB]while i < x2 :
[TAB][TAB][TAB]self.urls.append(string.join(temp_url,"%s" % i))
[TAB][TAB][TAB]i = i + 1
[TAB][TAB]return self.urls
[TAB]def list_urls(self):
[TAB][TAB]print self.urls
[TAB]def download_urls(self):
[TAB][TAB]for u in self.urls:
[TAB][TAB][TAB][TAB]print "Downloading ... ", u
[TAB][TAB][TAB][TAB]os.system("wget %s" % u)
[TAB][TAB][TAB][TAB]print "Wget Error!"
if __name__ == "__main__":
[TAB][TAB]url = sys.argv[1]
[TAB][TAB]print "Usage: python[01-06].jpg"
[TAB]f = Fusker(url)
Tags: , ,


  1. You mau also replace os.system("wget %s" % u) with os.system("wget --user-agent=Mozilla %s" % u)

  2. this is my own implementation of a fusker .. it is a one line:

    wget -r -nc -A.jpg,.mpg,.avi,.mpeg -R *thumb*,*tn*,gif,GIF "$@"

    this would download any jpg, mpg, avi or mpeg file in a page. It will avoid gif images and images with the string "thumb" or "tn" in them.

  3. notice the above line extracts images linked in a page. if however i want to download a range of images i use curl.

    (replace those ugly [TAB] with tabs or 4 spaces i can't read your script)

  4. WRT to the so called ugly [TAB] see above or even see the previous post.

  5. "Also if you can help me know why are people interested in the fusker technology that much"

    porn mostly ;)

  6. YES,,, people are interested...
    Since the main site went off-line, there are MANY people still interested.
    Also, many fusker sites are popping up ... :):)