mps-youtube / pafy

Python library to download YouTube content and retrieve metadata
1.39k stars 313 forks source link

"None" issue with getbestaudio method #299

Open sincerestsentry opened 3 years ago

sincerestsentry commented 3 years ago

Hi!

So I'm having this issue with the getbestaudio method: I attempted to use it in a variable as a list with other data:

yt_meta = [video.title, video.duration, video.viewcount, video.getbestaudio

and print it in a GUI window, but each time it printed "none".

I changed a few settings and ended up getting a reference to the function object, but that didn't really fix anything.

Then, I was curious, so I set up the download method as

video.getbestaudio().download(filepath='/Downloads/video.mp3', quiet=False)

and this resulted in the printing of the expected text that's listed in the documentation when download is used, however, beneath it, was "None" and notably, nothing downloaded. I tried this several times with several different videos, and it always resulted in "None" and no download.

It prints:

  5,523,355.0 Bytes [100.00%] received. Rate: [19019 KB/s].  ETA: [0 secs]    
None

And no download.

I presume this is a problem with my code I simply am not seeing, but I wanted to bring it to your attention simply to ensure it was indeed my problem.

joshcohen-515 commented 3 years ago

my problem is similar. It does download to the current directory, but it doesn't return downloaded filename as None.