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.

[BUG] Empty streams for some videos

See original GitHub issue

For some links, the streams property is empty, and the get_audio_only() method returns None. I’ve identified a few such links that seems to be reproducible. Here’s my test code that shows the problem:

from pytube import YouTube

FAILING = [
    "https://www.youtube.com/watch?v=L6nrMAFCzhg",
    "https://www.youtube.com/watch?v=T8de-31Hu7g",
    "https://www.youtube.com/watch?v=Y08HWyVSMxg",
    "https://www.youtube.com/watch?v=WchEW9LkK94",
]

OK = [
    "https://www.youtube.com/watch?v=7lYMmW2kPpQ",
    "https://www.youtube.com/watch?v=7eVQHt690nk",
    "https://www.youtube.com/watch?v=4bscOLDng0o",
]

for fail in FAILING:
    yt = YouTube(fail)
    stream = yt.streams.get_audio_only()

    # that's unexpected, stream shouldn't be None
    assert stream is None
    assert len(yt.streams) == 0

for ok in OK:
    yt = YouTube(ok)
    stream = yt.streams.get_audio_only()

    # same code, different links - all good
    assert stream is not None
    assert len(yt.streams) > 0

I’ve tested on freshly created virtualenv and the newest pytube. Same error on Windows and Ubuntu (WSL).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:23

github_iconTop GitHub Comments

3reactions
tfdahlincommented, Dec 13, 2020

@KrishnarajT and @PC-02 I believe your problems are also fixed in the github repository, just not the pypi repository. You should also run python -m pip install git+https://github.com/nficano/pytube to install from source, and see if that fixes the problem for you.

1reaction
PC-02commented, Dec 13, 2020

@tfdahlin The links work now, looks like it was an issue caused by using 10.0.0. Thank you so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Simple Ways To Fix All Video Streaming Issues
The 10 methods to fix video streaming problems include: · Check the internet connectivity · Switch to a different streaming platform · Reduce...
Read more >
Pytube yt.streams giving empty streams list for some videos
I'm trying to download this( http://youtube.com/watch?v=hnGWlry_H_Q ) or this ( https://www.youtube.com/watch?v=j4JQFz_8XxU ) from YouTube ...
Read more >
Troubleshoot your YouTube live stream - Google Help
To fix it, get a new stream key in Live Control Room and update your encoder. Go to YouTube Studio. To open Live...
Read more >
Videos not displaying in Streams - Microsoft Community Hub
Hi there, I've recorded 3 client call videos with Microsoft Teams. ... videos are also "empty", it really sound like a bug somewhere....
Read more >
[Update: Nov. 30] YouTube bugs/issues & pending ...
IST 07:45 pm: Some YouTubers are reporting that they aren't able to stream because a “Live streaming isn't available right now” error keeps ......
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