You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
756B

  1. class eroshare():
  2. def __init__(self):
  3. pass
  4. def get(self,url, name):
  5. page = requests.get(url)
  6. tree = html.fromstring(page.content)
  7. links = tree.xpath('//source[@src]/@src')
  8. if links:
  9. album_create(name)
  10. for link in links:
  11. if "lowres" not in link:
  12. wget.download(link)
  13. print("Downloaded ", link)
  14. links = tree.xpath('//*[@src]/@src')
  15. if len(links) > 2 and not album_create.hasbeencalled:
  16. album_create(name)
  17. for link in links:
  18. if "i." in link and "thumb" not in link:
  19. if link.split("/")[-1] not in os.listdir("./"):
  20. wget.download("https:" + link)
  21. print("Downloaded ", link)
  22. else:
  23. print("Already exists")
  24. if album_create.hasbeencalled:
  25. os.chdir("../")
  26. album_create.hasbeencalled = False