#another foolish script from an idiot from urllib import urlopen #get the url of the page, then use this script to get the direct download link srcUrl="http://taz2781.bazaarandroid.com/app/market/com.koushikdutta.rommanager/3017/5498/ROM%20Manager" #test splash=[0,0,0,0,0,0,0,0] def getSplashPos(nurl): i = 0 splash[i]=0 while i!=8: splash[i]=nurl.find('/',splash[i-1]+1) i+=1 def get_mUrl(nurl): getSplashPos(nurl) str1="http://m." str2=nurl[7:nurl.index(".bazaarandroid.com")+22] str3=nurl[splash[6]:splash[7]] str4=nurl[splash[4]:splash[5]] print "Waiting for mirror..." str5=urlopen(nurl).read() print "Waiting for content..." pos5=str5.index("softwareversion") str5="/"+str5[pos5+17:str5.find("",pos5)] str6=nurl[nurl.rfind('/'):] return str1+str2+str3+str4+str5+str6 def get_myapp(nurl): myapp_content = urlopen(get_mUrl(nurl)).read() print "Getting myapp file..." myapp_pos_end = myapp_content.find(".myapp")+6 myapp_pos_begin = myapp_content.find("app_install") myapp_pos_begin = myapp_content.find("http://",myapp_pos_begin) myapp_url = myapp_content[myapp_pos_begin:myapp_pos_end] return myapp_url def get_apk(myapp_url): apk_url = urlopen(myapp_url).read() begin = apk_url.index("http://") end = apk_url.index("") return apk_url[begin:end] print get_apk(get_myapp(srcUrl)) print "Done"