Questions tagged [pafy]

pafy is used to retrieve YouTube content such as video, audio, and metadata such as viewcount, duration, rating, author, resolution, bitrate, format, filesize, thumbnail, keywords, etc.

Features

  • Retrieve metadata such as viewcount, duration, rating, author, thumbnail, keywords
  • Download video or audio at requested resolution / bitrate / format / filesize
  • Command line tool (ytdl) for downloading directly from the command line
  • Retrieve the URL to stream the video in a player such as vlc or mplayer
  • Works with age-restricted videos and non-embeddable videos
  • Small, standalone, single importable module file (pafy.py)
  • Select highest quality stream for download or streaming
  • Download video only (no audio) in m4v or webm format
  • Download audio only (no video) in ogg or m4a format
  • Retrieve playlists and playlist metadata
  • Works with Python 2.6+ and 3.3+
  • Optionally depends on youtube-dl (recommended; more stable)

Full documentation is available at http://pythonhosted.org/pafy

91 questions
0
votes
0 answers

How to solve "mkv demux error: unable to read KaxCluster during seek, giving up"?

I'm making a small music player using pafy and vlc. I get audio with Youtube urls and pass it to vlc. In most cases, it works perfectly. However, sometimes I get the below error on the log, and after that my player crashes. [0000027de1ccce40] main…
Adi_Hsiao_0410
  • 111
  • 2
  • 9
0
votes
0 answers

Python script won't open Youtube stream in vlc

I'm trying to open a youtube stream in vlc 3.0.11.1 (macOS mojave 10.14.6) When I run the script, a python window starts but nothing happens after that In the terminal : [00007fa7eff66ae0] videotoolbox decoder: Using Video Toolbox to decode…
mlvt
  • 31
  • 2
0
votes
1 answer

How to display an image from url into Qlabel

I made an app to download YouTube videos using pafy, and it works fine. Here is a code snippet: # Display video's thumbnail thumbnail = Image.open(requests.get(self.video.thumb, stream=True).raw) video_thumbnail =…
0
votes
1 answer

Stream Music from YouTube with Python

I'm looking to create a script that will pull a YouTube video url from a database and play it in a program using Python. I currently have pafy and vlc setup and it works, but not exactly how I need it to. import time, pafy, vlc, youtube_dl url =…
Carl
  • 245
  • 3
  • 4
  • 15
0
votes
1 answer

Downloading YouTube videoes with pafy module with tqdm progressbar

I am trying to make a code to download videos from YouTube using pafy module and a progressbar using tqdm module, however the progressbar is finished before the download complete. here is my code download piece: with tqdm.tqdm(desc=video_name,…
Hadi Ayoub
  • 380
  • 1
  • 5
  • 16
0
votes
1 answer

How to set 'Downloads' folder as default directory for python pafy downloads

I have a code that downloads video with python pafy module At default it downloads the video in where my .py file is. But I want the Windows Downloads Folder as the destination of the downloaded video. How can I do it? Thanks in Advance import…
0
votes
0 answers

Unable to fetch likes,dislikes using pafy

I am trying to webscrape youtube data to obtain the views,likes,dislikes,etc. I am using pafy library to achieve the same. While I am able to get the other info , I am unable to fetch the likes and dislikes as it is returning None. I have attached…
0
votes
1 answer

Problems with the module pafy (Python)

Code: import pafy video = pafy.new(url) best = video.getbest() playurl = best.url The problem is that the pufy module works for a while, and then non-working URLs are passed to the variable urlplay causing errors Error Trace
Lev145
  • 55
  • 2
  • 8
0
votes
1 answer

How to use threading in a function to preventing gui from freezing?

I'm making a simple audio downloader from video,but whenever i click download button gui stops until downloading has finished. I thought i can use threading for kind of these things but almost there are hundreds of method to achieve that,but i don't…
0
votes
1 answer

YouTube video Downloader python

I made a youtube video download Manager. It download a video but i am facing one issue when i download same video, it doesn't download it again. how can i download it again with same title like pic.png and send pic1.png. How can i do that? def…
0
votes
1 answer

How to resize output frame from live stream from youtube using opencv

It's my beginning with coding and this site. I'm working on project, where I want to use openCV, but I've got an issue with that. I need to resize output frame, for recognizing object. I have read, that frame should be in size 416x416, but when I'm…
Olocalt
  • 13
  • 5
0
votes
0 answers

Ask About this Error : Type Error: Can't mix string and bytes in path components

enter image description hereI make Download GUI Program with PyQt5 that download video from youtube, I use pafy modules in my code , the problem is when i Convert the script to exe file the gui appear but the program not responding when i press on…
0
votes
2 answers

Why can't I get the title of the youtube video by pafy

Here is my code: import pafy v = pafy.new('https://www.youtube.com/watch?v=gTOFksRBxeU') v.title I get the _ for v.title instead of real video name, other items like v.dislikes works fine, why?
Chris
  • 75
  • 7
0
votes
1 answer

How to get the download percentage and speed of a download using Paffy?

I have written a small python program to download videos from youtube. The function takes a URL as input and then downloads it. Code: def download(i): global path global c global threads try: fh1 = open(path + "done.txt","a")…
Sayok Majumder
  • 1,012
  • 13
  • 28
0
votes
1 answer

python-vlc doesn't plays and response with the youtube video link?

I have been trying to play the YouTube links from python using pafy and python-vlc. The code compiles and finishes but the link doesn't play through vlc even though I have called play() at bottom I have tried uninstalling the existing python-vlc and…
Path- Or
  • 43
  • 1
  • 4
  • 13