from urllib import urlopen
#srcUrl="http://fredek7.bazaarandroid.com/app/market/com.superdrill.engine/4/72895/Super%20Drill%20Panic" #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("</span>",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("</get>")
return apk_url[begin:end]
while(1):
srcUrl=raw_input("Url\n")
print get_apk(get_myapp(srcUrl))
raw_input("Done\n")
baz.zip_easy
版权申诉
119 浏览量
2022-09-20
19:22:34
上传
评论
收藏 723B ZIP 举报
御道御小黑
- 粉丝: 58
- 资源: 1万+