Questions tagged [pytube]

For issues relating to the pytube Python library.

pytube is a lightweight, dependency-free library (and command-line utility) for downloading Videos.

Features

  • Support for Both Progressive & DASH Streams
  • Easily Register on_download_progress & on_download_complete callbacks
  • Command-line Interfaced Included
  • Caption Track Support
  • Outputs Caption Tracks to .srt format (SubRip Subtitle)
  • Ability to Capture Thumbnail URL.
  • Extensively Documented Source Code
  • No Third-Party Dependencies

Where to learn more

528 questions
23
votes
16 answers

Download video in mp3 format using pytube

I have been using pytube to download youtube videos in python. So far I have been able to download in mp4 format. yt = pytube.YouTube("https://www.youtube.com/watch?v=WH7xsW5Os10") vids= yt.streams.all() for i in range(len(vids)): print(i,'.…
Muhammad Khan
  • 991
  • 1
  • 12
  • 26
20
votes
8 answers

pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple

I used to download songs the following way: from pytube import YouTube video = YouTube('https://www.youtube.com/watch?v=AWXvSBHB210') video.streams.get_by_itag(251).download() Since today there is this error: Traceback (most recent call last): …
Sciveo
  • 329
  • 1
  • 2
  • 7
19
votes
7 answers

Pytube: urllib.error.HTTPError: HTTP Error 410: Gone

I've been getting this error on several programs for now. I've tried upgrading pytube, reinstalling it, tried some fixes, changed URLs and code, but nothing seems to work. from pytube import YouTube #ask for the link from user link = input("Enter…
Madjid
  • 215
  • 1
  • 2
  • 7
15
votes
6 answers

pytube: AttributeError: 'NoneType' object has no attribute 'span'

I just downloaded pytube (version 11.0.1) and started with this code snippet from here: from pytube import YouTube YouTube('https://youtu.be/9bZkp7q19f0').streams.first().download() which gives this error: AttributeError …
Lukas Nothhelfer
  • 820
  • 1
  • 7
  • 23
13
votes
9 answers

How to add progress bar?

Is there a way to add progress bar in pytube? I don't know how to use the following method: pytube.Stream().on_progress(chunk, file_handler, bytes_remaining) My code: from pytube import YouTube # from pytube import Stream from general import…
Gayan Jeewantha
  • 335
  • 1
  • 3
  • 9
12
votes
14 answers

Using Pytube to download playlist from YouTube

I am looking to download a YouTube playlist using the PyTube library. Currently, I am able to download a single video at a time. I cannot download more than one video at once. Currently, my implimentation is import pytube link = input('Please enter…
Anish Mazumdar
  • 315
  • 1
  • 4
  • 8
12
votes
4 answers

Python download youtube with specific filename

I'm trying to download youtube videos with pytube this way: from pytube import YouTube YouTube('http://youtube.com/watch?v=9bZkp7q19f0').streams.first().download() but the file will have the same name as the original video name. How do I specify a…
ehsan shirzadi
  • 4,709
  • 16
  • 69
  • 112
10
votes
1 answer

getting Http error 404 in Pytube. What is reason for this?

This code used to work 4 days back now it is showing error. I tried using pytube3 but that does not help. from pytube import YouTube** YouTube('https://www.youtube.com/watch?v=JbBsqmKclXE').streams** HTTPError …
shadow5893
  • 337
  • 4
  • 10
9
votes
3 answers

pytube.exceptions.RegexMatchError: __init__: could not find match for ^\w+\W

So my issue is I run this simple code to attempt to make a pytube stream object... from pytube import YouTube yt = YouTube('https://www.youtube.com/watch?v=aQNrG7ag2G4') stream = yt.streams.filter(file_extension='mp4') And end up with the error in…
8
votes
4 answers

Pytube keyerror 'streamData' while downloading a video

I was writing a code to see available streams of the video by writing below code from pytube import Playlist from pytube import YouTube as YT import threading as th import time plist=input('Enter the playlist:…
Aaryan R Soni
  • 91
  • 1
  • 1
  • 4
8
votes
1 answer

How to add tqdm to show progress bar when downloading you tube video with pytube?

I am learning pytube to download Youtube video and tried tqdm on top of it to show progress bar but it shows various error and also I could not understand what is happening when I download video with pytube and showing progress bar which is the…
8
votes
2 answers

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

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 =…
user9594573
  • 109
  • 1
  • 1
  • 5
7
votes
3 answers

ImportError: cannot import name 'quote'

I have learned basics of python, so tried this code below from pytube import YouTube Save_path="E:\python\youtube downloader" link="https://www.youtube.com/watch?v=xWOoBJUqlbI" try: yt=YouTube(link) except: print("Connection error!") …
7
votes
1 answer

Download audio from YouTube using pytube

I'm using pytube and Python 3.5 to download videos from YouTube but I need to convert the videos to audio with an .avi extension. Here is my code that I'm currently working with: from pytube import YouTube yt = YouTube(str(input("Enter the video…
omar harchich
  • 79
  • 1
  • 1
  • 5
6
votes
1 answer

pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match

def video_downloader(video_url_list: List[str], download_folder: str) -> None: """ Download videos from a list of YouTube video URLs. Args: video_urls (List[str]): The list of YouTube video URLs to download. …
AlexOAD
  • 63
  • 4
1
2 3
34 35