JuanBindez / pytubefix

Python3 library for downloading YouTube Videos.
https://pytubefix.readthedocs.io
MIT License
722 stars 100 forks source link

AttributeError: 'function' has no attribute 'decode'. #349

Open OGavrilista opened 10 hours ago

OGavrilista commented 10 hours ago

Describe the bug: The bug is an AttributeError where the function would not have the decode attribute.

Code:

from pytubefix import YouTube, Playlist
def link():
    opcao = int(input("Opção: "))
    if opcao == 1:
        videoDownload()
    elif opcao == 2:
        playlistDownload()
    else:
        exit(1)
    link = input("Link: ")

def videoDownload():
    yt = YouTube(link)
    stream = yt.streams.first()
    stream.download()

def playlistDownload():
    playlist = Playlist(link)
    for video in playlist.videos:
        streamPlaylistVideo = video.streams.first()
        streamPlaylistVideo.download()

link()

Screenshots:

Screenshot_20241121-233839

Screenshot_20241121-233947


Desktop (please complete the following information):


Additional context Add any other context about the problem here.