Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Tkinter import *
- import subprocess
- import urllib2
- import os
- username = "Name"
- password = "PW"
- pathToFilter = "filter.txt"
- pathToFormatFile = "Streamformats.txt"
- pathToYouTubeDL = "youtube-dl.exe"
- pathToDownloadBat = "download.bat"
- pathToATxt = "a.txt"
- pathToABat = "a.bat"
- def oldGetLinkpy():
- formatFileContent = open(pathToFormatFile).readlines()
- links = []
- for i in range(len(formatFileContent)):
- if("audio only" not in formatFileContent[i] and "unknown" not in formatFileContent[i]):
- if(v.get() == 2):
- if(("Sub" in formatFileContent[i]or "(UT)" in formatFileContent[i]) and int(formatFileContent[i].split()[2].split("x")[1])>= 720):
- links.append(formatFileContent[i])
- if(v.get() == 1):
- if("Dub" in formatFileContent[i] and int(formatFileContent[i].split()[2].split("x")[1])>= 720):
- links.append(formatFileContent[i])
- if(v.get() == 1):
- subprocess.call((pathToDownloadBat + " " + lnkInput.get("1.0",'end-1c') + " "+ links[0].split()[0] + " " + epiInput.get("1.0",'end-1c') + " " + getNameForEpisode(lnkInput.get("1.0",'end-1c'), "GerDub", epiInput.get("1.0",'end-1c'), "720p")))
- subprocess.call((pathToDownloadBat + " " + lnkInput.get("1.0",'end-1c') + " "+ links[len(links)-1].split()[0] + " " + epiInput.get("1.0",'end-1c')+ " " + getNameForEpisode(lnkInput.get("1.0",'end-1c'), "GerDub", epiInput.get("1.0",'end-1c'), "1080p.Plus")))
- if(v.get() == 2):
- subprocess.call((pathToDownloadBat+ " " + lnkInput.get("1.0",'end-1c') + " "+ links[0].split()[0] + " " + epiInput.get("1.0",'end-1c')+ " " + getNameForEpisode(lnkInput.get("1.0",'end-1c'), "GerSub", epiInput.get("1.0",'end-1c'), "720p")))
- subprocess.call((pathToDownloadBat+" " + lnkInput.get("1.0",'end-1c') + " "+ links[len(links)-1].split()[0] + " " + epiInput.get("1.0",'end-1c')+ " " + getNameForEpisode(lnkInput.get("1.0",'end-1c'), "GerSub", epiInput.get("1.0",'end-1c'), "1080p.Plus")))
- def getStreamformatsFromAoD():
- os.system(pathToYouTubeDL+ " \"" + lnkInput.get("1.0",'end-1c') +"\""+ " --password "+password+" -u "+username+" --all-formats"+" --get-format"+ " > " + pathToFormatFile)
- print(pathToYouTubeDL+ " \"" + lnkInput.get("1.0",'end-1c') +"\""+ " --password geheim -u geheim --all-formats"+" --get-format"+ " > " + pathToFormatFile)
- def getNameForEpisode(url, mode, epi, size):
- AnimeName = ""
- Episode = epi
- EpisodenName = ""
- Typ = mode
- Additional = ".Webrip.AAC."
- Aufloesung = size
- End = ".[Share-Bot]"
- content = urllib2.urlopen(url).read().split("\n")
- for i in range(len(content)):
- if("itemprop=\"name\"" in content[i]):
- filterContent = open(pathToFilter).readlines();
- AnimeName = (content[i+1].replace(" " , ".").replace("..","."))
- if(("Episode " + str(Episode)+"<br />") in content[i]):
- EpisodenName = (content[i].split("Episode " + str(Episode)+"<br />")[1].split("<")[0]).replace(" ",".")
- filterContent = open(pathToFilter).readlines();
- output = AnimeName + ".Ep." + str(Episode) + "." + EpisodenName + "."+Typ + Additional + size + End
- for j in range(len(filterContent)):
- print(filterContent[j].replace("\n",""))
- output = output.replace(filterContent[j].replace("\n", "") , "")
- return(output.replace("..","."))
- print(getNameForEpisode("https://www.anime-on-demand.de/anime/112", "GerSub", 1, "720p"))
- root = Tk()
- root.title("All in one Downloader made by Felix#2103")
- root.geometry("1200x300")
- root.resizable(0, 0)
- linkLabel = Label(root, font = "Arial 16")
- linkLabel.config(text="Link hier einfuegen: ")
- linkLabel.pack()
- lnkInput = Text(root, height=1, width=80, font = "Arial 16")
- lnkInput.pack()
- additionalContent = Label(root, font = "Arial 12")
- additionalContent.config(text="\nZusaetzliche Informationen (nur bei AoD Downloads)")
- additionalContent.pack()
- v = IntVar()
- Radiobutton(root, text="Dub", padx = 20, variable=v, value=1, font = "Arial 12").pack()
- Radiobutton(root, text="Sub", padx = 20, variable=v, value=2, font = "Arial 12").pack()
- epiLabel = Label(root, font = "Arial 12")
- epiLabel.config(text="Episode: ")
- epiLabel.pack()
- epiInput = Text(root, height=1, width=10, font = "Arial 12")
- epiInput.pack()
- def action():
- if(lnkInput.get("1.0",'end-1c')!=""):
- if("crunchyroll" in lnkInput.get("1.0",'end-1c')):
- os.system("echo " + lnkInput.get("1.0",'end-1c') + " > " + pathToATxt)
- os.system(pathToABat)
- if("anime-on-demand" in lnkInput.get("1.0",'end-1c')):
- getStreamformatsFromAoD()
- oldGetLinkpy()
- b = Button(root, text="Start", command=action, font = "Arial 16 bold")
- b.pack()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement