sensahin/YouWhisper

Youtube Link - Not a Valid Link

Opened this issue · 2 comments

Describe the bug
Many videos are displaying the Not a Valid Link error.

To Reproduce
Steps to reproduce the behavior:

  1. Put some valid Link "youtube.com/watch?v=[videoid]"
  2. Click on 'Convert'
    3.Result is None

image

Expected behavior
Download the Video.

Screenshots
If applicable, add screenshots to help explain your problem.

image

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

I had the same problem.
When I ran the following code in python
import pytube
video = pytube.YouTube("<URL-here>")
video.streams
I got the exception
pytube.exceptions.AgeRestrictedError: xxxxxx is age restricted, and can't be accessed without logging in.
But the video is not age restricted in my browser without login.

I found a issue at the pytube repo: pytube/issues#1712

In the file
site-packages\pytube\__main__.py
line 253 (beginning of bypass_age_gate) I replaced ANDROID_EMBED with ANDROID.
It's a hack, I don't know if this parameter is exposed.

After changing it, it works now.

This solution still works.