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

[FEATURE] Export by a date range #82

Open
magpires opened this issue Feb 6, 2024 · 7 comments
Open

[FEATURE] Export by a date range #82

magpires opened this issue Feb 6, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request pending for release Feature or bug fix to be released

Comments

@magpires
Copy link

magpires commented Feb 6, 2024

Is your feature request related to a problem? Please describe.
I want to create a repository on Google Drive with my conversations, creating a folder for each year, however, the tool does not allow me to extract the conversations for a date range.

Describe the solution you'd like
An option to inform the interval for extracting messages would be very welcome.

Additional context
An example would be the command:

wtsexporter -d --between 2022-01-01 00:00 - 2023-01-01 00:00

@KnugiHK KnugiHK added the enhancement New feature or request label Feb 7, 2024
@KnugiHK KnugiHK self-assigned this Feb 7, 2024
KnugiHK added a commit that referenced this issue Feb 12, 2024
KnugiHK added a commit that referenced this issue Feb 12, 2024
@KnugiHK
Copy link
Owner

KnugiHK commented Feb 12, 2024

Hi. Thanks for your suggestion. The feature is implemented in 2466e25 and 2b49ac2. You can try them in the dev branch.

PS. Inspired by your suggestion, I think export by chat is also a good filter.

@KnugiHK KnugiHK changed the title [FEATURE] Export by a date range [FEATURE] Export by a date range (EDIT) and chat Feb 13, 2024
@KnugiHK KnugiHK changed the title [FEATURE] Export by a date range (EDIT) and chat [FEATURE] Export by a date range Feb 13, 2024
@magpires
Copy link
Author

Hi. Today I tested the changes you made in the dev branch and I thought they were amazing. However, there was an exception error, regarding the timezone_offset parameter that you try to assign a value to in the dataModel Message. I have a little knowledge of Python and, from what I've seen, your code tries to assign a value to an attribute that doesn't exist, thus generating the exception. When I commented out the line that made this assignment, the application worked without problems. The exception occurs on line 346 of the android_handler.py file. I hope, in some way, to be contributing to the project.

@KnugiHK
Copy link
Owner

KnugiHK commented Feb 16, 2024

Can you post the stack traceback and the command you used?

@magpires
Copy link
Author

magpires commented Feb 16, 2024

Can you post the stack traceback and the command you used?

I used the following command in question

python main.py -a --split 900000 --date "2023-01-01 00:00 - 2024-01-01 00:00"

The traceback was this

Traceback (most recent call last):
 File "C:\Users\user\Desktop\Temps\WhatsApp\WhatsApp-Chat-Exporter-dev\Whatsapp_Chat_Exporter\main.py", line 497, in <module>
 main()
 File "C:\Users\user\Desktop\Temps\WhatsApp\WhatsApp-Chat-Exporter-dev\Whatsapp_Chat_Exporter\main.py", line 420, in main
 messages(db, data, args.media, args.timezone_offset, args.filter_date, filter_chat)
 File "C:\Users\user\Desktop\Temps\WhatsApp\WhatsApp-Chat-Exporter-dev\Whatsapp_Chat_Exporter\android_handler.py", line 341, in messages
 message = Message(
 TypeError: Message.init() got an unexpected keyword argument 'timezone_offset'

The exception persists even if I pass a value for time-offset using the argument "--time-offset -3"

@KnugiHK
Copy link
Owner

KnugiHK commented Feb 17, 2024

Could you please check the Message.__init__ in the data_model.py file? The timezone_offset should be there. See this link.

@magpires
Copy link
Author

Could you please check the Message.__init__ in the data_model.py file? The timezone_offset should be there. See this link.

Hey! I redid the tests, because I realized that I was having a conflict between the dev version and the main version on my machine. By redoing the tests correctly, I was successful. There was no error now.

@KnugiHK
Copy link
Owner

KnugiHK commented Feb 19, 2024

I will leave this open until next release.

@KnugiHK KnugiHK added the pending for release Feature or bug fix to be released label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pending for release Feature or bug fix to be released
Projects
None yet
Development

No branches or pull requests

2 participants