Пример #1
0
def giveMe(songName):
    videos= mt.search_youtube(songName)
    v= videos[0]
    bolo= is_downloaded(v.title)
    if(bolo=='NO'):
        log.info("Downloading "+v.title)
        return download(v)
    else:
    	log.info("Already Downloaded")
    	return bolo
Пример #2
0
def giveTitle(songName):
    videos= mt.search_youtube(songName)
    v= videos[0]
    size, sizes= giveInfo(v)
    data= '*Name:* '+v.title+'\n*Size:* '+sizes+'\n*Duration:* '+v.duration
    legel= size<=c.SIZE_LIMIT 
    if(not legel):
    	data+="\n`File size should be less than "+str(c.SIZE_LIMIT)+" MB`\n*Try with another keyword*"
    else:
    	data+="\n`Downloading, Please wait`"
    return legel, data
Пример #3
0
    while True:
        pass


def download(v):
    link = v.url
    ress = mt.getAllStreams(link)
    audio_streams = []
    for r_stream in ress:
        if (r_stream.type == 'video'):
            audio_streams.append(r_stream)
    r = audio_streams[0]
    mt.downloadV(r)
    fpath = str(os.path.join('Videos', safe_filename(
        v.title))) + '.' + r.subtype
    playVideo(v.title, fpath)


text = input("Enter Video Name:- ")

videos = mt.search_youtube(text)

v = videos[0]

bolo = is_downloaded(v.title)
if (bolo == 'NO'):
    print("Downloading ", v.title)
    download(v)
else:
    playVideo(v.title, bolo)