How to code youtube2mp3 3.01 release

1 minute read

๐Ÿ‘‹ ๊ตฌ๊ตฌ์ ˆ์ ˆ

Hows it going?

3.00 -> 3.01

ํŒจ์น˜ ๋‚ด์šฉ ์—…๋ฐ์ดํŠธ ํ•ด๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.

pafy๊ฐ€ ์ตœ๊ทผ์—๋Š” ์—…๋ฐ์ดํŠธ๊ฐ€ ์•ˆ๋˜๊ณ  ์žˆ์–ด์„œ ํ•ด๊ฒฐ๋˜์ง€ ์•Š์€ ๋ฒ„๊ทธ๊ฐ€ ๋งŽ์€ ๊ฒƒ์„ ํ™•์ธ ํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค

์žฌ์ด์˜ pafy ๋ฆฌํฌ ์ด์Šˆ

๊ทธ๋ž˜์„œ pafy๋ฅผ ์ง€์šฐ๊ณ  ๋ชจ๋“  ๊ธฐ๋Šฅ์„ pytube๋กœ ์˜ฎ๊ฒผ์Šต๋‹ˆ๋‹ค.

ํ˜„์žฌ๋กœ์ฌ ์ด๋ฒˆ ํŒจ์น˜๋ฅผ ๋งˆ๋ฌด๋ฆฌ๋กœ youtube2mp3 ํ”„๋กœ์ ํŠธ๋Š” ๋งˆ๋ฌด๋ฆฌ๋ฅผ ํ• ๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

์ด ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด์„œ ์˜ˆ์ „์— ๋ฐฐ์› ์—ˆ๋˜ ํŒŒ์ด์ฌ ์–ธ์–ด๋ฅผ ๋‹ค์‹œ ์†์— ์ตํž ์ˆ˜ ์žˆ์—ˆ๊ณ  ์ œ๊ฐ€ ํ•„์š”ํ•œ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์ง์ ‘ ๊ฐœ๋ฐœํ•ด์„œ ์‚ฌ์šฉ์„ ํ•  ์ˆ˜ ์žˆ๋‹ค๋Š”๊ฒƒ์— ๋Œ€ํ•ด์„œ ํ”„๋กœ๊ทธ๋ž˜๋จธ๋ž€ ์ง์—…์— ์ž๋ถ€์‹ฌ์— ๋งŽ์ด ์ƒ๊ฒผ์Šต๋‹ˆ๋‹ค.

ํ˜น์‹œ ์‚ฌ์šฉํ•˜์‹œ๋‹ค ๋ฒ„๊ทธ๊ฐ€ ์žˆ์œผ๋ฉด issue report๋ฅผ ํ•ด์ฃผ์‹œ๋ฉด ๋‹ต๋ฒˆ ํ•ด๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.

Check out my repository here!

3.00

  • switched from pafy to pytube due to a bug with pafyโ€™s remux_audio in download parameter options.
  • fixed the encoding problem so that iTunes can read the downloaded M4A file correctly.
  • fixed file name with regrex
  • mp4 and mp3 downloadable
  • automatically chooses highest quality files

    Possible future releases โ€ฆ

    • better GUI
    • IOS compatable
    • working progress bar

3.01

  • removed pafy due to out of date bugs
  • added moviepy to convert mp4 into mp3
  • added temp file name function
    try:
        # Insert Local Video File Path 
        clip = mp.AudioFileClip(out_file)
        # Insert Local Audio File Path
        clip.write_audiofile(out_file[:-4] + ".mp3")
        clip.close()
        new_file = os.path.join(destination.strip(),self.fulltitle.strip())
        os.rename(out_file[:-4] + ".mp3", new_file[:-4] + ".mp3")
        self.downloadText.insert(1.0,"Succefully saved file at location \n" + destination + "\n")
        os.remove(out_file)
    except Exception as e:
        messagebox.showwarning("Warning", str(e) + "\nFailed to convert mp4 file to mp3")
        return

Leave a comment