pytube

Pytube only works periodically (KeyError: 'assets')

与世无争的帅哥 提交于 2020-12-23 02:15:32
问题 Five out of ten times Pytube will send me this error when attempting to run my small testing script. Here's the script: import pytube import urllib.request from pytube import YouTube yt = YouTube('https://www.youtube.com/watch?v=3NCyD3XoJgM') print('Youtube video title is: ' + yt.title + '! Downloading now!') Here's what I get: Traceback (most recent call last): File "youtube.py", line 6, in <module> yt = YouTube('https://www.youtube.com/watch?v=3NCyD3XoJgM') File "C:\Users\test\AppData\Local

Pytube only works periodically (KeyError: 'assets')

自闭症网瘾萝莉.ら 提交于 2020-12-23 02:15:19
问题 Five out of ten times Pytube will send me this error when attempting to run my small testing script. Here's the script: import pytube import urllib.request from pytube import YouTube yt = YouTube('https://www.youtube.com/watch?v=3NCyD3XoJgM') print('Youtube video title is: ' + yt.title + '! Downloading now!') Here's what I get: Traceback (most recent call last): File "youtube.py", line 6, in <module> yt = YouTube('https://www.youtube.com/watch?v=3NCyD3XoJgM') File "C:\Users\test\AppData\Local

PyTube3 Playlist returns empty list

…衆ロ難τιáo~ 提交于 2020-08-05 06:45:10
问题 It seems that sometime in the past 2 or 3 weeks, the Playlist class seems to have stopped working for me. I've tried the following code snippet adapted from their GitHub: from pytube import Playlist playlist = Playlist("https://www.youtube.com/playlist?list=PLynhp4cZEpTbRs_PYISQ8v_uwO0_mDg_X") print(len(playlist.video_urls)) for url in playlist.video_urls: print(url) I've tried multiple public playlists but they all produced an empty list object. This code was working about 3 weeks ago. Also,

Getting the title of youtube video in pytube3?

匆匆过客 提交于 2020-07-22 06:06:13
问题 I am trying to build an app to download YouTube videos in python using pytube3 . But I am unable to retrieve the title of the video. Here goes my code: from pytube import YouTube yt = YouTube(link) print(yt.title) No matter whatever is the link I always get the title returned as YouTube instead of title of the video. Is there anyway to fix it? 回答1: try this instead yt.streams[0].title or yt.streams[0].default_filename 来源: https://stackoverflow.com/questions/62652157/getting-the-title-of

AttributeError: 'YouTube' object has no attribute 'get_videos'

我是研究僧i 提交于 2020-07-07 01:07:19
问题 While trying to download a YouTube video from python, I come across this error AttributeError: 'YouTube' object has no attribute 'get_videos' . Last line causes the error. import pytube link = "" yt = pytube.YouTube(link) videos = yt.get_videos() Thanks! 回答1: import pytube link = "https://www.youtube.com/watch?v=mpjREfvZiDs" yt = pytube.YouTube(link) stream = yt.streams.first() stream.download() Try above code. Here and here similar code which does not work. 回答2: from pytube import YouTube yt

Why my YouTube video downloader only downloads some videos and for other videos it shows keyerror like URL and cipher?

Deadly 提交于 2020-06-23 03:31:41
问题 I am trying to make a YouTube video downloader using Python pytube3 but it doesn't download all the videos. Some videos download very easily but some videos won't download and instead of download it shows error: Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\tarun\PycharmProjects\YTDownloader\venv\lib\site-packages\pytube\extract.py", line 297, in apply_descrambler for format_item in formats File "C:\Users\tarun\PycharmProjects\YTDownloader\venv\lib\site