Giter VIP home page Giter VIP logo

evernote-backup's People

Contributors

antonkorobkov avatar favoyang avatar houska1 avatar rhettbull avatar vzhd1701 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

evernote-backup's Issues

[Bug]: PDFs missing when importing enex to Apple Notes

evernote-backup version

1.9.3

What OS are you using?

MacOS

OS Version / Linux distribution

macOS 14.1

Bug description

Hi!

I would like to switch from Evernote to Apple Notes. Thank you for this helpful tool.
Downloading my notes worked flawlessly. However, when I import the enex-files to Apple Notes I only see something like {{NotesAttachment:060e4b8ee82472f916b89aecd30332cc}} instead of a PDF file that was part of the note.

As I have quite a lot of PDFs in my notes this is crucial to me. I would appreciate it enormously if anyone could help me fix this.

Julius

Log excerpt

No response

Error: SSL: CERTIFICATE_VERIFY_FAILED

Not sure what happens and why.

Getting this error when trying to login using evernote-backup init-db.

How can I help debug this?

Username or Email: *********
Password: 
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/cli.py", line 272, in main
    cli()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/cli.py", line 147, in init_db
    cli_app.init_db(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/cli_app.py", line 36, in init_db
    auth_token = get_auth_token(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/cli_app_auth.py", line 52, in get_auth_token
    return evernote_login_password(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/cli_app_auth_password.py", line 56, in evernote_login_password
    auth_res = auth_client.login(auth_user, auth_password)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/evernote_client_auth.py", line 27, in login
    return self.user_store.authenticateLongSessionV2(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/evernote_client.py", line 138, in wrapper
    return target_method_retry(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/evernote_client_util.py", line 28, in wrapper
    return fun(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/evernote_client_classes.py", line 283, in authenticateLongSessionV2
    self.send_authenticateLongSessionV2(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/evernote_client_classes.py", line 328, in send_authenticateLongSessionV2
    self._oprot.trans.flush()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/thrift/transport/THttpClient.py", line 113, in _f
    result = f(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/thrift/transport/THttpClient.py", line 146, in flush
    self.__http.endheaders()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1280, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1040, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 980, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

[Bug]: Progress bar breaks

evernote-backup version

1.8.0

What OS are you using?

Linux

OS Version / Linux distribution

Ubuntu 21.10

Bug description

I started a sync with evernote-backup sync. The progress bar initially worked well but after 473 notes it broke and started adding a new line for each note.

evernote-backup-progressbar

I did not resize the terminal or anything similar during this time. I was running it in a tmux session over ssh, on a remote computer elsewhere. The terminal emulator used was Yakuake 21.12.3.

Log excerpt

No response

[Feature request]: export with --overwrite flag?

Suggestion

Currently I run a docker container with sync command daily and export command daily. The purpose is to export the data onto a backup device separate to the locally sync'd database using the sync command.

Can an '--overwrite' flag be added to enable option of overwrite files during export? Currently, running export twice writes duplicate file with (#) appended. Folders are ok.

NOTE: I'm using --single-notes mode in this instance.

[Bug]: Crashes on Evernote Outage/Maintenance

evernote-backup version

1.9.2

What OS are you using?

MacOS

OS Version / Linux distribution

ARM64, M1

Bug description

Crashes on attempt to do evernote-backup sync which has been working quite well through yesterday.

Guessed that it might be reauth time so I tried evernote-backup reauth which also failed after collecting email and password (but not the 2FA).

Log excerpt

√ evernoteBackup % evernote-backup reauth
Reading database en_backup.db...
Logging in to Evernote...
Username or Email: [email protected]
Password: 
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/cli.py", line 305, in main
    cli()
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/cli.py", line 291, in reauth
    cli_app.reauth(
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/cli_app.py", line 80, in reauth
    auth_token = get_auth_token(
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/cli_app_auth.py", line 56, in get_auth_token
    return evernote_login_password(
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/cli_app_auth_password.py", line 56, in evernote_login_password
    auth_res = auth_client.login(auth_user, auth_password)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/evernote_client_auth.py", line 27, in login
    return self.user_store.authenticateLongSessionV2(
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/evernote_client.py", line 138, in wrapper
    return target_method_retry(*args, **kwargs)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/evernote_client_util.py", line 28, in wrapper
    return fun(*args, **kwargs)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/evernote_client_classes.py", line 294, in authenticateLongSessionV2
    return self.recv_authenticateLongSession()
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote/edam/userstore/UserStore.py", line 767, in recv_authenticateLongSession
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/thrift/protocol/TBinaryProtocol.py", line 145, in readMessageBegin
    type = self.readByte()
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/thrift/protocol/TBinaryProtocol.py", line 201, in readByte
    val, = unpack('!b', buff)
struct.error: unpack requires a buffer of 1 bytes

?1 evernoteBackup % evernote-backup --verbose reauth
Reading database en_backup.db...
Logging in to Evernote...
Username or Email: [email protected]
Password: 
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/cli.py", line 305, in main
    cli()
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/cli.py", line 291, in reauth
    cli_app.reauth(
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/cli_app.py", line 80, in reauth
    auth_token = get_auth_token(
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/cli_app_auth.py", line 56, in get_auth_token
    return evernote_login_password(
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/cli_app_auth_password.py", line 56, in evernote_login_password
    auth_res = auth_client.login(auth_user, auth_password)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/evernote_client_auth.py", line 27, in login
    return self.user_store.authenticateLongSessionV2(
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/evernote_client.py", line 138, in wrapper
    return target_method_retry(*args, **kwargs)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/evernote_client_util.py", line 28, in wrapper
    return fun(*args, **kwargs)
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote_backup/evernote_client_classes.py", line 294, in authenticateLongSessionV2
    return self.recv_authenticateLongSession()
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/evernote/edam/userstore/UserStore.py", line 767, in recv_authenticateLongSession
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/thrift/protocol/TBinaryProtocol.py", line 145, in readMessageBegin
    type = self.readByte()
  File "/opt/homebrew/Cellar/evernote-backup/1.9.2/libexec/lib/python3.10/site-packages/thrift/protocol/TBinaryProtocol.py", line 201, in readByte
    val, = unpack('!b', buff)
struct.error: unpack requires a buffer of 1 bytes

[Feature request]: copy suggestion. rename "exporting notes" to be more clear the progress bar is notebooks not notes

Suggestion

When running evernote-backup export, the progress bar looks like his

Reading database en_backup.db...
Exporting notes...
  [####################################]  30/30
All notes have been exported!

This confused me and maybe others - i thought there was a bug and that my notes were not being counted properly (I have way more than 40 notes 😅 ). Perhaps change the copy to Exporting notebooks to make it clear that the progressbar is # of notebooks?

[Bug]: Reminder Time Formatted Incorrectly in exported note inside a notebook

evernote-backup version

1.9.3

What OS are you using?

MacOS

OS Version / Linux distribution

Sonoma 14.4.1

Bug description

Yarle reports that the reminder time is in the wrong format.

evernote-backup's notebook XML of a note shows

  <reminder-time>1719842400000</reminder-time>

where an ENEX export of the same notebook shows the note's reminder as

  <reminder-time>20240701T140000Z</reminder-time>

10.84.3-mac-ddl-public (20240409145102)
Editor: v177.16.3
Service: v1.100.4
© 2019 - 2024 Evernote Corporation. All rights reserved

Log excerpt

No response

[Bug]: Latest versions not available using pip/pipx

evernote-backup version

1.8.0

What OS are you using?

Linux

OS Version / Linux distribution

Oracle Linux

Bug description

pipx install evernote-backup==1.9.2
pip install evernote-backup==1.9.2

ERROR: Could not find a version that satisfies the requirement evernote-backup==1.9.2 (from versions: 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.7.0, 1.7.1, 1.8.0)
ERROR: No matching distribution found for evernote-backup==1.9.2

Log excerpt

No response

Export failure

Since evernote hasn't a feature like pin-to-top, I modify the update time of certain notes to 30YY-MM-DD as an alternative. However these notes cannot be exported and the app crashes. Here is the log print:

Exporting note 'xxx' [xxx], notebook_id [xxx]
Traceback (most recent call last):
  File "evernote_backup\cli.py", line 272, in main
  File "site-packages\click\core.py", line 1137, in __call__
  File "site-packages\click\core.py", line 1062, in main
  File "site-packages\click\core.py", line 1668, in invoke
  File "site-packages\click\core.py", line 1404, in invoke
  File "site-packages\click\core.py", line 763, in invoke
  File "evernote_backup\cli.py", line 237, in export
  File "evernote_backup\cli_app.py", line 146, in export
  File "evernote_backup\note_exporter.py", line 52, in export_notebooks
  File "evernote_backup\note_exporter.py", line 77, in _export_active
  File "evernote_backup\note_exporter.py", line 88, in _export_notes
  File "evernote_backup\note_exporter.py", line 116, in _output_notebook
  File "evernote_backup\note_exporter.py", line 141, in _write_export_file
  File "evernote_backup\note_formatter.py", line 26, in format_note
  File "evernote_backup\note_formatter_util.py", line 9, in fmt_time
OSError: [Errno 22] Invalid argument

How can we tip you? :-)

Suggestion

Thank you for writing and maintaining this tool! It does exactly what it says it does without any fuss. Perfect.

How can we donate a few dollars or send a tip to show our appreciation?

Cheers!

Occasionally getting `struct.error` exception on fresh sync

Ran a full fresh sync overnight and ran into this failure:

2021-09-03 23:00:02,397 | [DEBUG] | 4520603136 | Adding/updating note 'Packing' [7ace7ad1-6997-4fe7-97fa-b450e3120add], notebook_id [88e9bfed-4d4e-497b-b5b3-e32b806b9d55]
2021-09-03 23:00:02,407 | [DEBUG] | 4520603136 | Added note [7ace7ad1-6997-4fe7-97fa-b450e3120add]
2021-09-03 23:00:02,407 | [CRITICAL] | 4520603136 | Exception caught while downloading note 'Packing list - short (2-4 work days) business trip overseas'!
2021-09-03 23:00:02,407 | [WARNING] | 4520603136 | Aborting, please wait...
2021-09-03 23:00:08,755 | [DEBUG] | 123145456091136 | Finished downloading note [a324de10-592f-46d4-b33e-25be5f989012]
2021-09-03 23:00:08,755 | [DEBUG] | 123145456091136 | Memory consumed: 0.0% [LIMIT 256 MB]
2021-09-03 23:00:09,205 | [DEBUG] | 123145405722624 | Finished downloading note [a3bedb49-07f9-4edf-a1fe-58f3f1297f4f]
2021-09-03 23:00:09,205 | [DEBUG] | 123145405722624 | Memory consumed: 0.001% [LIMIT 256 MB]
2021-09-03 23:00:09,226 | [DEBUG] | 123145439301632 | Finished downloading note [57be1baa-e716-4206-b8f7-ec5443e3f4d0]
2021-09-03 23:00:09,227 | [DEBUG] | 123145439301632 | Memory consumed: 0.002% [LIMIT 256 MB]
2021-09-03 23:00:17,490 | [DEBUG] | 123145422512128 | Finished downloading note [5ce693dd-bfab-4242-99f6-e30d8bab8286]
2021-09-03 23:00:17,490 | [DEBUG] | 123145422512128 | Memory consumed: 0.003% [LIMIT 256 MB]
2021-09-03 23:00:33,544 | [DEBUG] | 123145472880640 | Finished downloading note [65bdc413-5e45-4d5d-8e19-850e28a15edf]
2021-09-03 23:00:33,566 | [DEBUG] | 123145472880640 | Memory consumed: 0.052% [LIMIT 256 MB]
2021-09-03 23:00:33,566 | [CRITICAL] | 4520603136 | Traceback (most recent call last):
  File "evernote_backup/cli.py", line 272, in main
  File "click/core.py", line 1137, in __call__
  File "click/core.py", line 1062, in main
  File "click/core.py", line 1668, in invoke
  File "click/core.py", line 1404, in invoke
  File "click/core.py", line 763, in invoke
  File "evernote_backup/cli.py", line 199, in sync
  File "evernote_backup/cli_app.py", line 123, in sync
  File "evernote_backup/note_synchronizer.py", line 197, in sync
  File "evernote_backup/note_synchronizer.py", line 342, in _download_scheduled_notes
  File "evernote_backup/note_synchronizer.py", line 370, in _process_download_chunk
  File "concurrent/futures/thread.py", line 57, in run
  File "evernote_backup/note_synchronizer.py", line 134, in __call__
  File "evernote_backup/evernote_client_sync.py", line 39, in get_note
  File "evernote_backup/evernote_client.py", line 131, in wrapper
  File "evernote_backup/evernote_client_util.py", line 28, in wrapper
  File "evernote/edam/notestore/NoteStore.py", line 4142, in getNote
  File "evernote/edam/notestore/NoteStore.py", line 4158, in recv_getNote
  File "thrift/protocol/TBinaryProtocol.py", line 145, in readMessageBegin
  File "thrift/protocol/TBinaryProtocol.py", line 201, in readByte
struct.error: unpack requires a buffer of 1 bytes

This looks to be related to Evernote/evernote-sdk-python3#27. That issue is open, but in the discussion thread it looks like Evernote may have patched it earlier this year in a recent build of the Python3 SDK?

Suggestion: Export Default output directory

This tool works really well!

I love how you are using defaults that work just great out of the box. For example, the backup file is in the current directory.

Suggestion to simplify things even further:
It would be great to be able to just run $ evernote-backup export without the need to add an output directory.

Instead, it could output to the current directory, or create a default directory in the current location called export/.

[Bug]: Logging Account ssl.SSLCertVerificationError

evernote-backup version

evernote-backup 1.9.0

What OS are you using?

MacOS

OS Version / Linux distribution

MacOS 12.1

Bug description

image

Hi, I try to use your tools to export my notes from yinxiang,when I first try to log in my account, it run error with ssl.SSLCertVerificationError,how can I deal with it?

Please help me, thank you.

Log excerpt

Traceback (most recent call last):
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/evernote_backup/cli.py", line 305, in main
    cli()
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/evernote_backup/cli.py", line 158, in init_db
    cli_app.init_db(
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/evernote_backup/cli_app.py", line 38, in init_db
    auth_token = get_auth_token(
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/evernote_backup/cli_app_auth.py", line 56, in get_auth_token
    return evernote_login_password(
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/evernote_backup/cli_app_auth_password.py", line 56, in evernote_login_password
    auth_res = auth_client.login(auth_user, auth_password)
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/evernote_backup/evernote_client_auth.py", line 27, in login
    return self.user_store.authenticateLongSessionV2(
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/evernote_backup/evernote_client.py", line 138, in wrapper
    return target_method_retry(*args, **kwargs)
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/evernote_backup/evernote_client_util.py", line 28, in wrapper
    return fun(*args, **kwargs)
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/evernote_backup/evernote_client_classes.py", line 283, in authenticateLongSessionV2
    self.send_authenticateLongSessionV2(
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/evernote_backup/evernote_client_classes.py", line 328, in send_authenticateLongSessionV2
    self._oprot.trans.flush()
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/thrift/transport/THttpClient.py", line 113, in _f
    result = f(*args, **kwargs)
  File "/Users/penghonghao/.local/pipx/venvs/evernote-backup/lib/python3.9/site-packages/thrift/transport/THttpClient.py", line 146, in flush
    self.__http.endheaders()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1248, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1008, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 948, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1422, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)

[Request]: New release to resolve `oauth2` issues

Suggestion

Hello 👋 . I'm a maintainer for the Homebrew project. While working on our package for evernote-backup, we ran into issues with the deprecated oauth2 resource. We noticed this has been resolved in 32a094c, but hasn't been released yet. I wanted to ask if there are plans for a new release anytime soon so us downstream packagers can move away from oauth2. Thank you!

Relates to Homebrew/homebrew-core#163530.

MemoryError

Output:

% ~/.local/bin/evernote-backup export /srv/Data-Backup/Rob/Evernote
Reading database en_backup.db...
Exporting notes...
  [##############################------]  42/49  00:01:33  Paper Records         
Traceback (most recent call last):
  File "/home/rob/.local/lib/python3.9/site-packages/evernote_backup/cli.py", line 272, in main
    cli()
  File "/home/rob/.local/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/rob/.local/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/rob/.local/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/rob/.local/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/rob/.local/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/rob/.local/lib/python3.9/site-packages/evernote_backup/cli.py", line 233, in export
    cli_app.export(
  File "/home/rob/.local/lib/python3.9/site-packages/evernote_backup/cli_app.py", line 146, in export
    exporter.export_notebooks(single_notes, include_trash)
  File "/home/rob/.local/lib/python3.9/site-packages/evernote_backup/note_exporter.py", line 52, in export_notebooks
    self._export_active(single_notes)
  File "/home/rob/.local/lib/python3.9/site-packages/evernote_backup/note_exporter.py", line 77, in _export_active
    self._export_notes(nb, single_notes)
  File "/home/rob/.local/lib/python3.9/site-packages/evernote_backup/note_exporter.py", line 88, in _export_notes
    self._output_notebook(parent_dir, notebook.name, notes_source)
  File "/home/rob/.local/lib/python3.9/site-packages/evernote_backup/note_exporter.py", line 116, in _output_notebook
    _write_export_file(notebook_path, notes_source)
  File "/home/rob/.local/lib/python3.9/site-packages/evernote_backup/note_exporter.py", line 137, in _write_export_file
    for note in note_source:  # noqa: WPS440
  File "/home/rob/.local/lib/python3.9/site-packages/evernote_backup/note_storage.py", line 287, in iter_notes
    cur = con.execute(
MemoryError

The notebook being exported is particularly large. It contains about 2000 notes, each with small PDF files in them. I was running this on a 4GB Raspberry Pi. It clearly ran out of memory.

What I don't understand is why adding an 8GB swap file did not make any difference.

Any guidance on how I can resolve this challenge? Your script performs really well and I'd like to use it for daily backups of my Evernote account.

[Feature request]:

Suggestion

$evernote-backup export output_dir/

where can I find the path of output_dir ?

[Bug]: Linux standalone binaries don't work

evernote-backup version

1.9.2

What OS are you using?

Linux

OS Version / Linux distribution

Ubuntu 22.04.1 LTS

Bug description

Can't run released binary:

$ ./evernote-backup -h
Traceback (most recent call last):
  File "evernote_backup/__main__.py", line 1, in <module>
  File "/root/.pyenv/versions/3.7.5/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
  File "evernote_backup/cli.py", line 11, in <module>
  File "/root/.pyenv/versions/3.7.5/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
  File "evernote_backup/cli_app.py", line 8, in <module>
  File "/root/.pyenv/versions/3.7.5/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
  File "evernote_backup/cli_app_storage.py", line 5, in <module>
  File "/root/.pyenv/versions/3.7.5/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
  File "evernote_backup/note_storage.py", line 4, in <module>
  File "/root/.pyenv/versions/3.7.5/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
  File "lzma.py", line 27, in <module>
ModuleNotFoundError: No module named '_lzma'
[807851] Failed to execute script __main__

Log excerpt

No response

Re-Installation problem

Today I upgraded from Ubuntu 20.04 to 22.04. After that evernot-backup was not found.

pipx install evernote-backup with and without --force cause errors.

cmd_2022-08-18_21.02.17_pip_errors.log shows:

PIP STDERR

/home/sprickw/.local/pipx/venvs/evernote-backup/bin/python: No module named pip

cmd_2022-08-18_21.02.17.log

Is there some way to fix this?

Greetings Wolfgang

[Bug]: init-db gives " struct.error: unpack requires a buffer of 1 bytes"

evernote-backup version

1.9.2

What OS are you using?

Linux

OS Version / Linux distribution

Ubuntu 20.04

Bug description

I can no longer initialise the database - I get this error:

evernote-backup init-db
Logging in to Evernote...
Username or Email: mynamehere
Password: 
Traceback (most recent call last):
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/cli.py", line 305, in main
    cli()
........
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/thrift/protocol/TBinaryProtocol.py", line 201, in readByte
    val, = unpack('!b', buff)
struct.error: unpack requires a buffer of 1 bytes

I've tried re-installing and tried multiple times to init-db but now I keep getting this error.

Note that last night, the first time i tried it, it worked OK, and I was able to run a sync, but no longer.

Any help appreciated.
Pete

Log excerpt

pete@star:~/src/evernote-backup/tmp/ > evernote-backup init-db
Logging in to Evernote...
Username or Email: mynamehere
Password: 
Traceback (most recent call last):
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/cli.py", line 305, in main
    cli()
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/cli.py", line 158, in init_db
    cli_app.init_db(
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/cli_app.py", line 38, in init_db
    auth_token = get_auth_token(
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/cli_app_auth.py", line 56, in get_auth_token
    return evernote_login_password(
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/cli_app_auth_password.py", line 56, in evernote_login_password
    auth_res = auth_client.login(auth_user, auth_password)
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/evernote_client_auth.py", line 27, in login
    return self.user_store.authenticateLongSessionV2(
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/evernote_client.py", line 138, in wrapper
    return target_method_retry(*args, **kwargs)
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/evernote_client_util.py", line 28, in wrapper
    return fun(*args, **kwargs)
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/evernote_client_classes.py", line 294, in authenticateLongSessionV2
    return self.recv_authenticateLongSession()
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote/edam/userstore/UserStore.py", line 767, in recv_authenticateLongSession
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/thrift/protocol/TBinaryProtocol.py", line 145, in readMessageBegin
    type = self.readByte()
  File "/home/pete/.local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/thrift/protocol/TBinaryProtocol.py", line 201, in readByte
    val, = unpack('!b', buff)
struct.error: unpack requires a buffer of 1 bytes

configurable oauth api token

Hi, would be great to have env vars or some other runtime way to replace in https://github.com/vzhd1701/evernote-backup/blob/master/evernote_backup/config.py I'm using docker so I can naturally mount a replacement file in, but that's not ideal and won't work for those running the binary(?)

Also notes on the approach taken to get approved keys with production evernote access would be great

[Bug]: Error exporting notes

evernote-backup version

1.9.2

What OS are you using?

Windows

OS Version / Linux distribution

Windows 10

Bug description

Sync and auth works fine, but exporting notes give an error. Allways same notebook (8 from 91), no matter if single export or notebook export.

Log excerpt

(--verbose doesn't work), but in screen
Reading database en_backup.db...
Exporting notes...
  [###---------------------------------]  8/91  00:12:29
Traceback (most recent call last):
  File "evernote_backup\cli.py", line 305, in main
  File "click\core.py", line 1130, in __call__
  File "click\core.py", line 1055, in main
  File "click\core.py", line 1657, in invoke
  File "click\core.py", line 1404, in invoke
  File "click\core.py", line 760, in invoke
  File "evernote_backup\cli.py", line 260, in export
  File "evernote_backup\cli_app.py", line 160, in export
  File "evernote_backup\note_exporter.py", line 64, in export_notebooks
  File "evernote_backup\note_exporter.py", line 88, in _export_active
  File "evernote_backup\note_exporter.py", line 99, in _export_notes
  File "evernote_backup\note_exporter.py", line 122, in _output_notebook
  File "evernote_backup\note_exporter.py", line 154, in _write_export_file
  File "evernote_backup\note_formatter.py", line 25, in format_note
  File "evernote_backup\note_formatter_util.py", line 14, in fmt_time
OSError: [Errno 22] Invalid argument

[Bug]: "OSError: [Errno 36] File name too long" after initial export

evernote-backup version

1.9.1

What OS are you using?

Linux

OS Version / Linux distribution

Ubuntu 22.04

Bug description

V1.9.1 fixed the "OSError: [Errno 36] File name too long" symptom with "evernote-backup export". But trying to update the export dir by executing the command again still leeds to this error.

Log excerpt

No response

Request: Zero change files

At the moment, evernote-backup writes the exported files with an export-date in one of the first lines. Both in notebook export as well as the --single-notes version. Obviously, the value of this field changes the content of the file. This triggers backup software to either backup the entire file or chunks of it.

I have for now removed the field from line 20 of note_exporter.py, but obviously this is not a sustainable option.

I was wondering if it would be possible to offer a command-line option --no-export-date to the export function of the program.

Too long file name

The single notes export crashes if the name of a note is too long. I suggest to shorten the name and write a warning / note to stdout. It would also be good if errors regarding to the file system could be fetched by default and handled with a warning / error.

evernote-backup export [HOME_DIR_PATH_REMOVED]evernote_export --single-notes

Reading database en_backup.db...
Exporting notes...
  [############------------------------]  2/6  Anderes                     
Traceback (most recent call last):
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/cli.py", line 282, in main
    cli()
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/cli.py", line 242, in export
    cli_app.export(
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/cli_app.py", line 147, in export
    exporter.export_notebooks(single_notes, include_trash, no_export_date)
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/note_exporter.py", line 53, in export_notebooks
    self._export_active(single_notes, no_export_date)
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/note_exporter.py", line 78, in _export_active
    self._export_notes(nb, single_notes, no_export_date)
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/note_exporter.py", line 89, in _export_notes
    self._output_single_notes(parent_dir, notes_source, no_export_date)
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/note_exporter.py", line 112, in _output_single_notes
    _write_export_file(note_path, note, no_export_date)
  File "[HOME_DIR_PATH_REMOVED].local/pipx/venvs/evernote-backup/lib/python3.8/site-packages/evernote_backup/note_exporter.py", line 129, in _write_export_file
    with open(file_path, "w", encoding="utf-8") as f:
OSError: [Errno 36] File name too long: '[VERY_LONG_NAME_REMOVED]'.enex'

[Bug]: password login disable

evernote-backup version

Lasted

What OS are you using?

Windows

OS Version / Linux distribution

Windows 7

Bug description

IMG_0554
I login Evernote through email, not using google or others.
Im sure my password is entered correctly.
And I can login in Evernote app.
But its still as the image.
How can I fix it?
Thanks

Log excerpt

No response

[Feature request]: Internal Evernote Link Redirector

Suggestion

Internal Evernote links are one of the biggest problems when backing up or migrating from Evernote.
Actually, "evernote-backup" extracts all the necessary information to be able to rewrite internal Evernote links. An automatic "rewrite" feature for Evernote links would be a great feature.
For this, it would be additionally necessary to implement a "link redirector" that might somehow "translate" incoming "Evernote note links", for example, into Markdown links…

[Bug]: Error while importing note

evernote-backup version

1.3.6.241

What OS are you using?

Windows

OS Version / Linux distribution

Windows 10

Bug description

While importing an ENEX file created with Evernote, I received a popup window reporting a "System Runtime InteropServices COMException error. The note appears to be ok when viewed in Evernote.

snap558

The log file referenced in the popup message is attached: error log.txt

The message encouraged reporting in this forum, so I am doing so.
Geoffrey

Log excerpt

No response

exception "file name to long"

First thing first: Great package, will help me a LOT!

evernote-backup export --single-notes /home/xxx/somedir

leads to exception

File "/home/sprickw/PycharmProjects/evernote/venv/lib/python3.8/site-packages/evernote_backup/note_exporter.py", line 122, in _write_export_file
with open(file_path, "w", encoding="utf-8") as f:
OSError: [Errno 36] File name too long:

Looking into the code the reason is clear: the notes title is simply too long.

Probable simple solution: just shorten the file name part of the path to 255 chars. Maybe even better: calculate some crc32 (or similar) from title and content, shorten the filename and and the hash at its end, finally adding ".enex".

[Bug]: Note backed up by evernote-backup is missing pics compared to same note backed up manually with Evernote

evernote-backup version

1.9.3

What OS are you using?

Windows

OS Version / Linux distribution

Windows 11

Bug description

I found that when importing enex files from evernote-backup into UpNote, some of the pictures did not come through.
Example: Evernote note had 5 pics but after running evernote-backup and importing the result file, it only had 3 pics. Same note imported after manual export from Evernote came through with all 5 pics.
Note name is "2019/20 - Street Glide Pics".
Interestingly, when importing my entire notebook, Evernote-backup correctly titled 3 notes that are titled as "Untitled Note" when using Evernote manual backup. So it seems you are doing something "better" than what Evernote does... thanks.
Test Notebook.zip

Log excerpt

I am not able to use Verbose mode:
D:\Evernote\Backup>evernote-backup export Newback2 --verbose
Usage: evernote-backup export [OPTIONS] OUTPUT_PATH
Try 'evernote-backup export --help' for help.

Error: No such option: --verbose Did you mean --overwrite?

Notebooks skipped

Thanks for making this tool available -- looks very promising. I just tried it with my Evernote configuration and found that it seems to have skipped a number of notebooks. These are neither in the final ENEX export nor in the Notebooks table in the sqlite database after the sync completes. Is there a debug mode or additional logging that can be turned on to get a more detailed activity trace?

Exception caught when downloading note

While performing the initial sync I bumped into this error Exception caught while downloading note.

It was toward the end, when there were 29 notes left to sync, out of 9049 notes in total.

Thankfully, running the sync command for the second time it successfully synced the remaining 29 notes.
Running the sync for the third time successfully said Synchronization completed!

Not sure if I can help you debug this because I can't reproduce it, but this log might be helpful.

 Exception caught while downloading note 'xxxxx'!
Aborting, please wait...

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/cli.py", line 272, in main
    cli()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/cli.py", line 199, in sync
    cli_app.sync(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/cli_app.py", line 123, in sync
    note_synchronizer.sync()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/note_synchronizer.py", line 215, in sync
    self._download_scheduled_notes(notes_to_sync)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/note_synchronizer.py", line 360, in _download_scheduled_notes
    self._process_download_chunk(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/note_synchronizer.py", line 388, in _process_download_chunk
    raise f_exc
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/note_synchronizer.py", line 136, in __call__
    note = self.download_note(note_id)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/note_synchronizer.py", line 148, in download_note
    return self._note_client.get_note(note_id)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/evernote_client_sync.py", line 39, in get_note
    note = self.note_store.getNote(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/evernote_client.py", line 131, in wrapper
    return functools.partial(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote_backup/evernote_client_util.py", line 28, in wrapper
    return fun(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote/edam/notestore/NoteStore.py", line 4142, in getNote
    return self.recv_getNote()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/evernote/edam/notestore/NoteStore.py", line 4170, in recv_getNote
    raise result.userException
evernote.edam.error.ttypes.EDAMUserException: EDAMUserException(errorCode=9, parameter='authenticationToken')

[Bug]: sync raise result.notFoundException

evernote-backup version

1.9.3

What OS are you using?

Windows

OS Version / Linux distribution

win11 23H2 专业版

Bug description

Run evernote-backup sync for the first time.
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote\edam\notestore\NoteStore.py", line 4174, in recv_getNote
raise result.notFoundException
evernote.edam.error.ttypes.EDAMNotFoundException: EDAMNotFoundException(message=None, identifier='Note.guid', key='977af345-fcb6-40ad-9477-a92389469ca0')

but,
Run evernote-backup sync a second time.
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\thrift\protocol\TBinaryProtocol.py", line 201, in readByte
val, = unpack('!b', buff)
struct.error: unpack requires a buffer of 1 bytes

Log excerpt

one!!!

Reading database en_backup.db...
Authorizing auth token, china backend...
Successfully authenticated as *********!
Current login will expire at 2024-12-17 09:08:53.
Syncing user notebooks...
[####################################] 191262/191262
Syncing linked notebooks...
2770 note(s) to download...
Requesting access to 2 linked notebook(s)...
Downloading 2770 note(s)...
[#####################---------------] 1635/2770 00:16:11Exception caught while downloading note '参赛: 031- 蝴蝶V1 版'!
Aborting, please wait...

Traceback (most recent call last):
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\cli.py", line 305, in main
cli()
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\cli.py", line 211, in sync
cli_app.sync(
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\cli_app.py", line 128, in sync
note_synchronizer.sync()
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\note_synchronizer.py", line 215, in sync
self._download_scheduled_notes(notes_to_sync)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\note_synchronizer.py", line 359, in _download_scheduled_notes
self._process_download_chunk(
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\note_synchronizer.py", line 387, in _process_download_chunk
raise f_exc
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\concurrent\futures\thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\note_synchronizer.py", line 136, in call
note = self.download_note(note_id)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\note_synchronizer.py", line 148, in download_note
return self._note_client.get_note(note_id)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\evernote_client_sync.py", line 39, in get_note
note = self.note_store.getNote(
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\evernote_client.py", line 131, in wrapper
return functools.partial(
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\evernote_client_util.py", line 28, in wrapper
return fun(*args, **kwargs)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote\edam\notestore\NoteStore.py", line 4142, in getNote
return self.recv_getNote()
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote\edam\notestore\NoteStore.py", line 4174, in recv_getNote
raise result.notFoundException
evernote.edam.error.ttypes.EDAMNotFoundException: EDAMNotFoundException(message=None, identifier='Note.guid', key='977af345-fcb6-40ad-9477-a92389469ca0')

two!!!

Reading database en_backup.db...
Authorizing auth token, china backend...
Successfully authenticated as *********!
Current login will expire at 2024-12-17 09:08:53.
Syncing user notebooks...
User notebooks are up to date, nothing to sync!
Syncing linked notebooks...
Traceback (most recent call last):
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\cli.py", line 305, in main
cli()
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\cli.py", line 211, in sync
cli_app.sync(
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\cli_app.py", line 128, in sync
note_synchronizer.sync()
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\note_synchronizer.py", line 207, in sync
self._sync_linked_notebook(l_notebook)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\note_synchronizer.py", line 286, in _sync_linked_notebook
for chunk in l_notebook_chunks:
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\evernote_client_sync.py", line 83, in iter_linked_notebook_sync_chunks
chunk = ln_note_store.getLinkedNotebookSyncChunk(
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\evernote_client.py", line 131, in wrapper
return functools.partial(
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote_backup\evernote_client_util.py", line 28, in wrapper
return fun(*args, **kwargs)
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote\edam\notestore\NoteStore.py", line 2759, in getLinkedNotebookSyncChunk
return self.recv_getLinkedNotebookSyncChunk()
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\evernote\edam\notestore\NoteStore.py", line 2774, in recv_getLinkedNotebookSyncChunk
(fname, mtype, rseqid) = self._iprot.readMessageBegin()
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\thrift\protocol\TBinaryProtocol.py", line 145, in readMessageBegin
type = self.readByte()
File "c:\users\bsszds\appdata\local\programs\python\python38\lib\site-packages\thrift\protocol\TBinaryProtocol.py", line 201, in readByte
val, = unpack('!b', buff)
struct.error: unpack requires a buffer of 1 bytes

[Feature request]: Backup tags of a note

Suggestion

As far as I have searched the code, I couldn't find any indication that tags are taken care in any way, also the sqlite database doesn't show any indication of such.

Are there any plans to add tags of notes, as this meta information is very valuable to filter notes for?

Edit: To be more precise: The request is about a way to query all notes with specific tags without to read and decode the notes raw data first.

Suggestion: Add DB Index for Notes to Download

Currently, the sync step of getting the notes to download takes nearly 15s for my Evernote account of just over 15,000 notes. That same query returns almost instantly (<0.001s) after I manually added a SQLlite partial index to speed it up.

This is the specific query I was digging into:

     SELECT notes.guid,
        title,
        notebooks_linked.guid AS l_notebook
     FROM notes
     LEFT JOIN
         notebooks_linked USING (
             notebook_guid
         )
      WHERE raw_note IS NULL;

Query time: 14.35s to return the results (which was just a single matching row)

Added this index manually to the table:

      CREATE INDEX Idx_notestodl 
      ON notes (guid) WHERE raw_note IS NULL;

Query time: < 0.001s to return the same result.

For Evernote users with a large number of notes, this is a solid reduction in runtime so wanted to suggest the enhancement for your consideration.

[Bug]: init-db got error while --backend china

evernote-backup version

1.9.3

What OS are you using?

MacOS

OS Version / Linux distribution

14.2.1

Bug description

The evernote-backup was installed using brew install.
After running evernote-backup init-db --backend china, entering the email and password results in the program throwing an error directly.

Log excerpt

evernote-backup init-db --backend china
Logging in to Evernote...
Username or Email: [email protected]
Password: 
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli.py", line 305, in main
    cli()
  File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli.py", line 158, in init_db
    cli_app.init_db(
  File "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli_app.py", line 38, in init_db
    auth_token = get_auth_token(
                 ^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli_app_auth.py", line 56, in get_auth_token
    return evernote_login_password(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/cli_app_auth_password.py", line 56, in evernote_login_password
    auth_res = auth_client.login(auth_user, auth_password)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/evernote_client_auth.py", line 27, in login
    return self.user_store.authenticateLongSessionV2(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/evernote_client.py", line 138, in wrapper
    return target_method_retry(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/evernote_client_util.py", line 28, in wrapper
    return fun(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote_backup/evernote_client_classes.py", line 294, in authenticateLongSessionV2
    return self.recv_authenticateLongSession()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/evernote-backup/1.9.3/libexec/lib/python3.12/site-packages/evernote/edam/userstore/UserStore.py", line 779, in recv_authenticateLongSession
    raise result.userException
evernote.edam.error.ttypes.EDAMUserException: EDAMUserException(errorCode=8, parameter='consumerKey')

[Bug]: Can't input password

evernote-backup version

1.9.2

What OS are you using?

Windows

OS Version / Linux distribution

Windows 10

Python version

3.7.10

Bug description

After I execute evernote-backup init-db --backend china, then I can input Username or Email:, but I can't input password by keyborad or paste. Nothing happened when I kick my keyboard.
If I continue to kick Enter, it show Invalid password!.

Log excerpt

No response

[Feature request]: Option for export to overwrite output files instead of adding (1) to name

Suggestion

Manjaro/Arch x86_64, evernote-backup version 1.8.0.

We have a fairly large Evernote database (en_backup.db is 10Gb), and I wanted to back it up on a rolling basis, so I set up a timer on a headless Linux machine to do evernote-backup sync, evernote-backup export once weekly.

It initially worked well and it exported the whole database into .enex files, but over time it quickly filled the hard drive with Notebook (1).enex, Notebook (2).enex, Notebook (3).enex etc, all with the same size.

Would it be possible to have a command-line flag to make evernote-backup export overwrite old files as new ones with the same names are exported?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.