ddl

SJS Alpha

ddl
Sep 2nd, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.85 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import mytemp
  4. import sys
  5. import urllib
  6.  
  7. url = raw_input("Please, type in the url of the site to check:\n")
  8. if url == "":
  9.     sys.exit("Error URL")
  10.  
  11. webFile = urllib.urlopen(url)
  12. site = webFile.read()
  13. webFile.close()
  14.  
  15. siteup = site
  16. uploaderlst = []
  17. while 1:
  18.     tempup = mytemp.StringBetween(siteup,"<strong>Uploader:</strong> ","<")
  19.     if tempup == None:
  20.         break
  21.     pos = tempup.find("|")
  22.     if pos != 0:
  23.         tempup = tempup[:pos]
  24.     uploaderlst.append(tempup)
  25.     pos = siteup.find(tempup)
  26.     siteup = siteup[pos:]
  27.        
  28. print "Avaible Uploader:"
  29. for item in uploaderlst:
  30.     print item
  31.  
  32. uploader = raw_input("Please, type the name of the uploader in:\n")
  33. if uploader == "":
  34.     sys.exit("Error Uploader")
  35.  
  36. links = mytemp.StringBetween(site,"<strong>Uploader:</strong> "+uploader,"<strong>Uploader:</strong> ")
  37. if links == None:
  38.     sys.exit("Error with Uploader")
  39.  
  40. linkshost = mytemp.StringBetween(links,'<strong>Download:</strong>',"/p>")
  41. if linkshost == None:
  42.     sys.exit("Error with Downloads")
  43. hostlst = []
  44. while 1:
  45.     temphost = mytemp.StringBetween(linkshost,' target="_blank">hier</a>',"<")
  46.     if temphost == None:
  47.         break
  48.     hostlst.append(temphost[3:])
  49.     pos = linkshost.find(temphost)
  50.     linkshost = linkshost[pos:]
  51.  
  52. print "Avaible Hoster\n"
  53. for item in hostlst:
  54.     print item
  55. hoster = raw_input("\nPlease, type in the name of the hoster:\n")
  56. if hoster == "":
  57.     sys.exit("\n\tError Hoster")
  58.  
  59. link = []
  60. while 1:
  61.     strtemp = mytemp.StringBetween(links,'<strong>Download:</strong> <a href="','" target="_blank">hier</a> | ')
  62.     if strtemp != None:
  63.         pos = links[len('<strong>Download:</strong> <a href="'+strtemp+'" target="_blank">hier</a> | '):].find(hoster)
  64.         if pos == 1:
  65.             link.append(strtemp)
  66.     else:
  67.         break
  68.     strt = mytemp.strstr(links, '<br />')
  69.     if strt != None:
  70.         links = strt[len('<br />'):]
  71.     else:
  72.         break
  73. for item in link:
  74.     print item
Advertisement
Add Comment
Please, Sign In to add comment