<commit_before>import os, subprocess

def getLength(filename):
  result = subprocess.Popen(["ffprobe", filename],stdout = subprocess.PIPE, stderr = subprocess.STDOUT).communicate()[0].decode('UTF-8')
  for resultline in result.rsplit(sep="\n"):  #quebra o resultado em linhas
        if 'Duration' in resultline:
            print (resultline) # Duration: 00:01:26.89, start: 0.000000, bitrate: 11975 kb/s
            words = resultline.rsplit(sep=",", maxsplit=2)
            wcount = 0
            for word in words:
                print (wcount, " = ", word)
                wcount += 1

print ("Lendo diretório: ", os.getcwd())
for filename in os.listdir():
    print (" -- Lendo arquivo: ", filename)
    ext = filename[-3:] #extensão do arquivo
    if ext == 'MOV' or ext == 'MP4': #se for um vídeo...
        getLength(filename)



<commit_msg>Muda a saída para: Arquivo - ##h##m##.##s<commit_after>import os, subprocess

def getLength(filename):
  result = subprocess.Popen(["ffprobe", filename],stdout = subprocess.PIPE, stderr = subprocess.STDOUT).communicate()[0].decode('UTF-8')
  for resultline in result.rsplit(sep="\n"):  #quebra o resultado em linhas
        if 'Duration' in resultline:
            #print (resultline) # Duration: 00:01:26.89, start: 0.000000, bitrate: 11975 kb/s
            words = resultline.split(sep=" ")
            duration = words[3]
            #print ("Duração: ", duration[:-1])
            time = duration[:-1].split(sep=':')
            #print(time)
            #print ("Duração: ", time[0], "h", time[1], 'm', time[2], 's')
            print ("%s - %sh%sm%ss" % (filename, time[0], time[1], time[2]))
            #wcount = 0
            #for word in words:
            #    print (wcount, " = ", word)
            #    wcount += 1

print ("Lendo diretório: ", os.getcwd())
for filename in os.listdir():
    #print (" -- Lendo arquivo: ", filename)
    ext = filename[-3:] #extensão do arquivo
    if ext == 'MOV' or ext == 'MP4': #se for um vídeo...
        getLength(filename)




{'fraction_non_alphanumeric': 0.1625615763546798, 'fraction_numerical': 0.030541871921182268, 'mean_word_length': 2.538327526132404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1248075', 'n_tokens_mistral': 715, 'n_tokens_neox': 669, 'n_words': 177}