[第23期]Use pytube and PySide to download YouTube audio(mp3)/使用pytube與PySide下載YouTube聲音檔(mp3)

This vedio shows how to use pytube and PySide to download YouTube audio (mp3).

The content includes: 

  1. PySide Introduction

  2. Filter Audio Stream

  3. Download and rename Youtube mp3 file  


本視頻說明如何使用pytube與PyQt下載YouTube影片。

內容包含: 

  1. PySide簡介

  2. 篩選聲音資料流

  3. 下載和重新命名YouTube MP3檔

Pyside template 

import sys
from PySide6 import QtWidgets
from PySide6.QtCore import QFile, QIODevice
from PySide6.QtUiTools import QUiLoader


class MainWindow(QtWidgets.QMainWindow):
    def __init__(self, ui_file_name, *args, **kwargs):
# access methods of the base class
        super(MainWindow, self).__init__(*args, **kwargs)
        # Load the UI Page by PySide6
        loader = QUiLoader()
        file = QFile(ui_file_name)
        file.open(QIODevice.ReadOnly)
        self.ui = loader.load(file)
        file.close()

        self.ui.setWindowTitle("ui title")

        self.ui.show()


def main():
    app = QtWidgets.QApplication(sys.argv)
    ui_file_name = "ui_file.ui"
    main = MainWindow(ui_file_name)
    sys.exit(app.exec())


if __name__ == '__main__':
    main()

留言

這個網誌中的熱門文章

使用VS code開發Python程式 - Matplotlib繪圖

使用Pycharm開發Python程式與用Matplotlib繪圖

[Python][tkinter] Build tkinter GUI 使用tkinter建立圖形視窗