diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..060d2c5
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..fd73aaf
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ "associatedIndex": 6
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1719090776295
+
+
+ 1719090776295
+
+
+
+
\ No newline at end of file
diff --git a/code/convertermusica.py b/code/convertermusica.py
index 691d882..84e0610 100644
--- a/code/convertermusica.py
+++ b/code/convertermusica.py
@@ -1,25 +1,27 @@
-from pytube import YouTube
from pathlib import Path
-import re
import os
-import moviepy.editor as mp
+import yt_dlp
+
def download_music():
- with open(r"C:\Users\pedrolmbs\spotifycrackeado\musicas.txt") as musicas_txt:
+ with open(r"_Caminho_de_um_arquivo_de_texto_com_os_links_das_músicas_no_Youtube") as musicas_txt:
for linha in musicas_txt:
link = linha
- path = (r"C:\Users\pedrolmbs\spotifycrackeado\musicas")
- yt = YouTube(link)
+ path = (r"_Diretório_para_onde_as_músicas_vão_")
+ ydl_opts = {
+ 'format': 'bestaudio/best',
+ 'outtmpl': os.path.join(path, '%(title)s.%(ext)s'),
+ 'postprocessors': [{
+ 'key': 'FFmpegExtractAudio',
+ 'preferredcodec': 'mp3',
+ 'preferredquality': '192',
+ }],
+ 'ffmpeg_location': r'_Caminho_para_o_executável_do_FFmpeg_',
+ }
#Fazer o dowload
- ys = yt.streams.filter(only_audio=True).first().download(path)
- #Converter o video(mp4) para mp3
- for file in os.listdir(path): #For para percorrer dentro da pasta passada anteriormente
- if re.search('mp4', file): #If verificando se o arquivo e .MP4
- mp4_path = os.path.join(path , file) #Cria uma variavel para armazenar o arquivo .MP4
- mp3_path = os.path.join(path, os.path.splitext(file)[0]+'.mp3') #Variavel que cria o nome do arquivo e adiciona .MP3 ao final
- new_file = mp.AudioFileClip(mp4_path) #Cria o arquivo de áudio (.MP3)
- new_file.write_audiofile(mp3_path) #Renomeia o arquivo, setando o nome criado anteriormente
- os.remove(mp4_path) #Remove o arquivo .MP4
- print("Download Completo")
+
+ with yt_dlp.YoutubeDL(ydl_opts) as ydl:
+ ydl.download([link])
+ print("Download completo")
download_music()
\ No newline at end of file