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.

86 lines
2.1KB

  1. import os
  2. from sites import gfy, imgur, tumblr, reddit
  3. class scrapper():
  4. def __init__(self):
  5. pass
  6. def get(self, url):
  7. url2 = ""
  8. if "imgur" in url:
  9. url2 = imgur.imgur().get(url)
  10. elif "gfycat" in url:
  11. url2 = gfy.gfycat().get(str(url))
  12. elif "eroshare" in url:
  13. #eroshare.eroshare().get(url)
  14. pass
  15. elif "redd.it" in url or "i.reddituploads" in url:
  16. url2 = reddit.reddit().get(url)
  17. elif "media.tumblr" in url:
  18. url2 = tumblr.tumblr().get(url)
  19. return url2
  20. """def main(choice):
  21. print("====== Menu ======")
  22. print("1: Download Subreddit")
  23. print("2: Download User")
  24. print("3: Download Your Front Page")
  25. print("9: Settings")
  26. while choice == 0:
  27. try:
  28. choice = int(input("Choice: "))
  29. if choice == 1:
  30. reddit().menu()
  31. elif choice == 2 or choice == 3:
  32. print("Feature in development")
  33. choice = 0
  34. elif choice == 9:
  35. schoice = 0
  36. print("")
  37. print("")
  38. print("====== Settings ======")
  39. print("1: Run redditsub in debug mode")
  40. print("2: Run eroshare in debug mode")
  41. print("3: Run imguralbum in debug mode")
  42. print("4: Run gfycatget in debug mode")
  43. print("5: Run Imgur().Get() in debug mode")
  44. print("9: Exit Program")
  45. schoice = int(input("Choice: "))
  46. if schoice == 1:
  47. reddit().menu()
  48. elif schoice == 2:
  49. url = input("Url: ")
  50. eroshare().get(url,"Test")
  51. elif schoice == 3:
  52. id = input("ID: ")
  53. imgur().get_album(id,"Test")
  54. elif schoice == 4:
  55. url = input("Url: ")
  56. gfycat().get(url)
  57. elif schoice == 5:
  58. url = input("URL: ")
  59. imgur().get(url[::-1],"Test")
  60. elif schoice == 6:
  61. reddit().saved()
  62. elif schoice == 9:
  63. return True
  64. else:
  65. print("Can't even fucking select the right shit")
  66. else:
  67. print("Your choice doesn't exist")
  68. choice = 0
  69. except ValueError:
  70. print("Use an interger number to choose from the menu")
  71. choice = 0
  72. """
  73. if __name__ == "__main__":
  74. varsetup()
  75. #spreadsheetsetup()
  76. print("Setting up Directory")
  77. os.chdir('/home/roxie/Storage_1/Hello')
  78. print("")
  79. exitchoice = False
  80. while exitchoice is False:
  81. exitchoice = main(0)