Enhancement: Adding the is_private, id, and is_short property attributes. :) #1835
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!