Advertisement
Guest User

Untitled

a guest
Mar 10th, 2019
558
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.10 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. from Tkinter import *
  3. import subprocess
  4. import os
  5. username = "Furryking"
  6. password = "Elechatgewonnen"
  7.  
  8.  
  9.  
  10. pathToFormatFile = "Streamformats.txt"
  11. pathToYouTubeDL = "youtube-dl.exe"
  12. pathToDownloadBat = "download.bat"
  13. pathToATxt = "a.txt"
  14. pathToABat = "a.bat"
  15.  
  16.  
  17. def oldGetLinkpy():
  18.     formatFileContent = open(pathToFormatFile).readlines()
  19.  
  20.     links = []
  21.     for i in range(len(formatFileContent)):
  22.         if("audio only" not in formatFileContent[i] and "unknown" not in formatFileContent[i]):
  23.             if(v.get() == 2):
  24.                 if(("Sub" in formatFileContent[i]or "(UT)" in formatFileContent[i]) and int(formatFileContent[i].split()[2].split("x")[1])>= 720):
  25.                     links.append(formatFileContent[i])
  26.             if(v.get() == 1):
  27.                 if("Dub" in formatFileContent[i] and int(formatFileContent[i].split()[2].split("x")[1])>= 720):
  28.                     links.append(formatFileContent[i])
  29.     if(v.get() == 1):
  30.         subprocess.call((pathToDownloadBat + " " + lnkInput.get("1.0",'end-1c') + " "+ links[0].split()[0] + " " + epiInput.get("1.0",'end-1c')))
  31.         subprocess.call((pathToDownloadBat + " " + lnkInput.get("1.0",'end-1c') + " "+ links[len(links)-1].split()[0] + " " + epiInput.get("1.0",'end-1c')))
  32.     if(v.get() == 2):
  33.         subprocess.call((pathToDownloadBat+ " " + lnkInput.get("1.0",'end-1c') + " "+ links[0].split()[0] + " " + epiInput.get("1.0",'end-1c')))
  34.         subprocess.call((pathToDownloadBat+" " + lnkInput.get("1.0",'end-1c') + " "+ links[len(links)-1].split()[0] + " " + epiInput.get("1.0",'end-1c')))
  35.  
  36. def getStreamformatsFromAoD():
  37.     os.system(pathToYouTubeDL+ " \"" + lnkInput.get("1.0",'end-1c') +"\""+ " --password "+password+" -u "+username+" --all-formats"+" --get-format"+ " > " + pathToFormatFile)
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. root = Tk()
  46. root.title("All in one Downloader made by Felix#2103")
  47. root.geometry("1200x300")
  48. root.resizable(0, 0)
  49.  
  50. linkLabel = Label(root, font = "Arial 16")
  51. linkLabel.config(text="Link hier einfügen: ")
  52. linkLabel.pack()
  53.  
  54. lnkInput = Text(root, height=1, width=80, font = "Arial 16")
  55. lnkInput.pack()
  56.  
  57. additionalContent = Label(root, font = "Arial 12")
  58. additionalContent.config(text="\nZusätzliche Informationen (nur bei AoD Downloads)")
  59. additionalContent.pack()
  60.  
  61. v = IntVar()
  62.  
  63. Radiobutton(root, text="Dub", padx = 20, variable=v, value=1, font = "Arial 12").pack()
  64. Radiobutton(root, text="Sub", padx = 20, variable=v, value=2, font = "Arial 12").pack()
  65.  
  66. epiLabel = Label(root, font = "Arial 12")
  67. epiLabel.config(text="Episode: ")
  68. epiLabel.pack()
  69.  
  70.  
  71. epiInput = Text(root, height=1, width=10, font = "Arial 12")
  72. epiInput.pack()
  73.  
  74.  
  75. def action():
  76.     if(lnkInput.get("1.0",'end-1c')!=""):
  77.         if("crunchyroll" in lnkInput.get("1.0",'end-1c')):
  78.             os.system("echo " + lnkInput.get("1.0",'end-1c') + " > " + pathToATxt)
  79.             os.system(pathToABat)
  80.         if("anime-on-demand" in lnkInput.get("1.0",'end-1c')):
  81.             getStreamformatsFromAoD()
  82.             oldGetLinkpy()
  83. b = Button(root, text="Start", command=action, font = "Arial 16 bold")
  84. b.pack()
  85.  
  86. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement