feat(PlaylistVideo): Extract video_info and accessibility_label texts #376
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.
Description
Unfortunately playlist videos don't have fields for the uploaded date or number of views. Instead they are in the video info property. The video info property contains text runs that can consist of the short view count and uploaded date, the number of people watching the live stream or be empty.
This pull request also extracts the accessibility label string, which among other things contains the exact number of video views (thanks @AudricV for pointing that out). One important thing to note, is that said string is language dependant, so any library user wanting to parse it will have to keep that in mind, also 0 views are shown as
no views
.Here are a couple of playlists to see the different values of those properties:
Normal videos: https://www.youtube.com/playlist?list=PL8mG-RkN2uTypNLvzSMJZjjztzVatqgQ6
Some upcoming videos: https://www.youtube.com/playlist?list=PLAWO6dmnJ7Oxne23Iv14NbOcXeRv2eLYz
Live videos: https://www.youtube.com/playlist?list=PL6NdkXsPL07IFb3kA-m9QNY8oUMctNM3i
Type of change
Please delete options that are not relevant.
Checklist: