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
4
votes
5 answers

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

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…
Tarun
  • 43
  • 1
  • 6
4
votes
5 answers

How to combine audio and video in Pytube?

I am trying to write a code to download YouTube videos using Pytube on Python 3.6. But for most videos progressive download(Audio and Video in same file) format is available only upto 360p. So I want to download audio and video files separately and…
Nikith Clan
  • 145
  • 1
  • 2
  • 6
4
votes
6 answers

Getting Error with Pytube: signature = cipher.get_signature(js, stream['s']) KeyError: 's'

I have been this error when running my Pytube script: signature = cipher.get_signature(js, stream['s']) KeyError: 's' My code is like this: url = 'https://www.youtube.com/watch?v=' train_List = [] i = 0 while i <…
topplethepat
  • 531
  • 6
  • 23
4
votes
1 answer

How do I rename the downloaded file from pytube automatically?

I'm new to Python, and have only worked with PHP 5 in the past, (many years ago now). As a beginner project I thought I'd make a YouTube downloader using pytube that lets you choose whether to download a video in highest quality or only download the…
Zareph
  • 43
  • 1
  • 6
4
votes
1 answer

How to combine pytube and tkinter label to show progress?

I am writing small program which downloads song from youtube (using pytube) and I want to add python tkinter GUI to show percent value when the file is downloading. Now when I execute my code, program at first downloads the file (takes about 60sec)…
Jonas.S.
  • 155
  • 1
  • 4
  • 14
4
votes
1 answer

Using pytube library to download youtube links from csv

I'm trying to use the pytube library to download a bunch of links I have on a .csv file. EDIT: WORKING CODE: import sys reload(sys) sys.setdefaultencoding('Cp1252') import os.path from pytube import YouTube from pprint import pprint import…
TheOlDirtyBastard
  • 167
  • 1
  • 3
  • 12
4
votes
6 answers

PYTUBE module error

Every time I try to use the PYTUBE module it shows this error. from pytube import YouTube ImportError: cannot import name 'YouTube'
Abdilatif Musa
  • 105
  • 1
  • 2
  • 4
4
votes
2 answers

Pytube Error: AttributeError: 'module' object has no attribute 'Client'

I've been trying to use the Pytube module and every time I use its Client attribute it keeps coming up with the following error: Traceback (most recent call last): File "", line 1, in client =…
Abdilatif Musa
  • 105
  • 1
  • 2
  • 4
3
votes
0 answers

RegexMatchError: get_throttling_function_name: could not find match for multiple

(Using pytube15.0.0) I am rerunning a code to download audio from YouTube using the following code: search_kw = tracks[i+1]['Artist'] + '+' + tracks[i+1]['Track Title'] print('Preparing ' + tracks[i+1]['Artist'] + '-' + tracks[i+1]['Track…
Anthony Reid
  • 89
  • 2
  • 9
3
votes
2 answers

how to download videos that require age verification with pytube?

I download and clip some youtube videos with pytube but some videos are not downloading and asking for age verification. How can I solve this? Thanks for your advice
byhite
  • 39
  • 1
  • 3
3
votes
2 answers

Pytube error when I'm trying download video

When I tried to download video with pytube there was error: pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple. I saw this here, but when I tried it didn't work. (if it's only decision please send all…
3
votes
0 answers

python pytube get url of audio live stream

Code: from pytube import YouTube yt = YouTube('https://www.youtube.com/watch?v=nt8b2d80kp4') yt.streams.filter(only_audio=True) Error: Traceback (most recent call last): File "/home/chris/Desktop/download-peradio-youtube.py", line 3, in
Chris P
  • 2,059
  • 4
  • 34
  • 68
3
votes
1 answer

How to make pytube print all available resolutions and the user inputs one

Intro: So I am trying to make a pytube project but I am stuck on this one step, Problem: I can't figure out how to make pytube list all the available resolutions from pytube import YouTube # import the package print("Please Paste The URL of the…
Dimitris184
  • 33
  • 1
  • 5
3
votes
2 answers

Python3.8 pytube ImportError: cannot import name 'YouTube' from 'pytube' (unknown location)

When i try to run my script, which is just those two lines: from pytube import YouTube YouTube('http://youtube.com/watch?v=9bZkp7q19f0').streams.first().download() i get the error: ImportError: cannot import name 'YouTube' from 'pytube' (unknown…
3
votes
1 answer

Error while implementing progress_bar in pytube3

I am implementing a youtube video downloader using pytube3. In the following progress_bar() function I am getting an positional argument missing error. My progress_bar() function: def progress_bar(stream, chunk, file_handle, bytes_remaining): …
Arun Suryan
  • 1,615
  • 1
  • 9
  • 27
1 2
3
34 35