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 = QImage(ImageQt(thumbnail))
self.lblThumbnail.setPixmap(QPixmap.fromImage(video_thumbnail))
But, when I used pytube, it didn't work. Here is a code snippet:
# Display video's thumbnail
thumbnail = Image.open(requests.get(self.video.thumbnail_url, stream=True).raw)
video_thumbnail = QImage(ImageQt(thumbnail))
self.lblThumbnail.setPixmap(QPixmap.fromImage(video_thumbnail))
Nothing different except thumbnail_url, both thumbnail_url and thumb are strings.
The apps freezes, then crashes without displaying any error in the terminal. Any suggestions are welcomed
Thank you