testando pós scripts
This commit is contained in:
1 parent
0a2815a731
commit
f7ff164eb9
284 files changed
+6500484
-656933
No files matched your search
@@ -5,19 +5,25 @@ import json
|
||||
base_dir = "/nethome/jotachina/projetos/mmpSearch/mmp/instruments"
|
||||
|
||||
# Caminho para salvar o arquivo JSON na pasta metadata (na raiz do seu site)
|
||||
output_file = "metadata/src_audio_files.json" # Substitua com o caminho correto
|
||||
output_file = "/var/www/html/trens/src_mmpSearch/metadata/src_audio_files.json" # Substitua com o caminho correto
|
||||
|
||||
|
||||
# Função para percorrer o diretório e suas subpastas
|
||||
def find_audio_files(base_dir):
|
||||
audio_files = []
|
||||
for root, dirs, files in os.walk(base_dir):
|
||||
for file in files:
|
||||
if (file.endswith(".wav") or file.endswith(".ogg") or
|
||||
file.endswith(".flac") or file.endswith(".mp3")):
|
||||
if (
|
||||
file.endswith(".wav")
|
||||
or file.endswith(".ogg")
|
||||
or file.endswith(".flac")
|
||||
or file.endswith(".mp3")
|
||||
):
|
||||
# Adiciona o caminho completo do arquivo
|
||||
audio_files.append(os.path.join(root, file))
|
||||
return audio_files
|
||||
|
||||
|
||||
# Chama a função para encontrar os arquivos
|
||||
audio_files = find_audio_files(base_dir)
|
||||
|
||||
|
||||
Reference in new issue
Block a user