question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError exception when specifying extension and resolution to get()

See original GitHub issue

Using version 0.2 from PyPI, an AttributeError exception is thrown when both the file extension and resolution are specified. It works if I remove the resolution arg, but a higher resolution (720p) is downloaded.

from pytube import YouTube
yt = YouTube()
yt.url = "http://www.youtube.com/watch?v=R7yfISlGLNU"
video = yt.get(extension='mp4', resolution='360p')
video.download()

The video exists as can be seen from filter:

>>> yt.filter('mp4', '360p')
[<Video: H.264 (.mp4) - 360p - Baseline>]

Error at last line:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'download'

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
omarharchichcommented, Mar 1, 2018

i’m using the latest version of pytube and still have the problem with YouTube

0reactions
NavyaShreeDodlacommented, Sep 30, 2020

AttributeError Traceback (most recent call last) <ipython-input-35-382c586705bd> in <module>() ----> 1 yt.download(r"C:\Users\pruthvi kumar\Desktop\extra")

AttributeError: ‘YouTube’ object has no attribute ‘download’

I am facing an error while working with YouTube video downloader using python, How can I solve this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extension 'cogs.cmds' raised an error: AttributeError: 'Bot ...
The answer is really simple. discord.Bot doesn't support prefix commands, only application ones (like slash commands and context menus).
Read more >
Sphinx throws errors when using function in __getattr__ override
Describe the bug When using anonymous functions in getattr sphinx will raise an error: Handler for event 'autodoc-process-signature' threw ...
Read more >
Source code for imexam.ds9_viewer
If one extension of an MEF file is loaded this will be 1 regardless of the extension that was specified (because DS9 and...
Read more >
Reading and saving image files with Python, OpenCV (imread ...
In Python and OpenCV, you can read (load) and write (save) image files with cv2.imread() and cv2.imwrite() . Images are read as NumPy...
Read more >
3. Data model — Python 3.11.1 documentation
Function objects also support getting and setting arbitrary attributes, ... an exception when no appropriate method is defined (typically AttributeError or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found