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

Incomplete Parsing of Fundraising Donation Messages in Live Chat #227

Open
repollo opened this issue Oct 9, 2023 · 2 comments
Open

Incomplete Parsing of Fundraising Donation Messages in Live Chat #227

repollo opened this issue Oct 9, 2023 · 2 comments
Labels
question Further information is requested

Comments

@repollo
Copy link

repollo commented Oct 9, 2023

Description:

Hello maintainers of chat-downloader,

Firstly, I'd like to express my appreciation for the incredible work on this library. I've been using the tool to parse live chat fundraising donation messages from YouTube and identified some issues in the extraction process.

Issue:
The current parsing mechanism for the donation_announcement messages doesn't correctly extract all pertinent details, such as the donation amount and currency. This leads to the constructed output message lacking essential information about the donation.

Proposed Changes:

  1. Enhanced Handling of donation_details in _REMAPPING:
    Update the _REMAPPING dictionary to accurately capture donation_details:
_REMAPPING = {
    ...
    'text': r('donation_details', _parse_runs, False),
    ...
}
  1. Improved Parsing Logic in _parse_item:
    Modify the _parse_item function to better handle donation details:
...
# After the remapping is done, now handle the custom logic for donations
if 'donation_details' in info:
    donation_text = info['donation_details']['message']
    # Extract the donation amount using a split method
    match = donation_text.split('donated')
    if match:
        amount_text = match[-1].strip()
        dummy_load = {"simpleText": amount_text}
        currency_info = YouTubeChatDownloader._parse_currency(dummy_load)
        info['donation_details'] = currency_info
...

By implementing these changes, the parser should be able to extract all relevant details about the donation, making the output message more complete and informative.

I hope you consider integrating these adjustments into the main library. It would greatly enhance the capability and accuracy of the tool when parsing fundraising donation messages.

Thank you for your attention to this matter.

Warm regards,
repollo

@repollo repollo added the question Further information is requested label Oct 9, 2023
@xenova
Copy link
Owner

xenova commented Oct 15, 2023

Thanks for this! @repollo would you like to open a PR (since you already seem to have found a fix). That would help a lot!

@repollo
Copy link
Author

repollo commented Oct 21, 2023

Do you have a specific preference of the key you would like to use? Any standardization on the matter? Right now I implemented with donation_details but that was for my use case. Let me know.

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

No branches or pull requests

2 participants