-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[ie/mixch] Add comment extraction; update a test #9860
Conversation
This is not ideal. Is there any other key that could be used as ID? |
Hi, @pukkandan .
Unfortunately, there is no such key. So, should we remove "id"? |
yt_dlp/extractor/mixch.py
Outdated
'author': ('name', {str_or_none}), | ||
'author_id': ('user_id', {int_or_none}), | ||
'id': ('message_id', {str_or_none}), | ||
'text': ('body', {str_or_none}), | ||
'timestamp': ('created', {int_or_none}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It is better to have
id=None
thanid=""
. author_id
should be returned as as astr
, notint
.{TYPE_or_none}
converts the data intoTYPE
while{TYPE}
verifies the data isTYPE
without converting
Considering these, I believe this is the proper impl:
'author': ('name', {str_or_none}), | |
'author_id': ('user_id', {int_or_none}), | |
'id': ('message_id', {str_or_none}), | |
'text': ('body', {str_or_none}), | |
'timestamp': ('created', {int_or_none}), | |
'author': ('name', {str}), | |
'author_id': ('user_id', {str_or_none}), | |
'id': ('message_id', {str}, {lambda x: x or None), | |
'text': ('body', {str}), | |
'timestamp': ('created', {int}), |
Correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I must have been confused "{TYPE_or_none}" and "{TYPE}" at that time.
Fixed in 5bbd6c1.
"{str_or_none}" vs. "{str}" Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
info_json:
.
Template
Before submitting a pull request make sure you have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:
What is the purpose of your pull request?