Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Adding the is_private, id, and is_short property attributes. :) #1835

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Voltaic314
Copy link

I hope I followed all the git contribution guidelines, I didn't change any imports or deleted anything. I just added some stuff. I checked the tests but didn't see any specifics for all the properties so I didn't add any pytests for these properties. But I can try if need be.

Basically I added 2 new properties to the YouTube class object:

  • id (like the last string at the end of the url)

  • is_private (checks this by using the self.streams attribute and if the VideoPrivate exception gets raised then we can return True, else False)

  • is_short (this one works by making a web request to the YT shorts url with the video id, if the request works with no final redirects, then it's a short, if not, it's not a short. This is ideally meant to be used with normal YT videos, not livestreams, but I think it would technically still work).

Let me know if I need to do anything else to make this work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant