How to code youtube2mp3 custom python script

1 minute read

유튜브 오디오를 다운로드 하는 파이썬 스크립트를 만들었습니다.

Check out my repository here!

youtube2mp3

custom Youtube video to mp3 converter

👋 Introduction

Hello World!

I was working on recording videos and needed audio clips from Youtube. I could use Youtube to mp3 conversion service sites… but I am a programmer. So I went ahead and created a simple script to download Youtube audios straight from Youtube.

📑 How to Install and Run

The installation requirements for this python script is

  • python 3
  • pafy
  • youtube-dl

Once you have python 3 downloaded, follow the instructions below.

  1. Clone the repo in your desired location.
  2. Run the Powershell commands in the run.txt in order.
  3. Download the video.

Things to Note

Author: JWL

try:
    audiostreams[index].download()
    # bestaudio = video.getbestaudio()
    # bestaudio.download()
    cwd = os.getcwd()
    print("\n  다음 경로로"+cwd+"\n\n  "+video.title+"\n\n  파일을 성공적으로 저장하였습니다.\n")
    print("\nOperation successful.....Terminating the program.\n")
except Exception as e:
    print("\n\nAn exception occurred!\n")
    print(e)
    print("\n\t.........Terminating the program.\n\n\n")

Leave a comment