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

Large Attachements #5

Open
jatk opened this issue May 25, 2020 · 4 comments
Open

Large Attachements #5

jatk opened this issue May 25, 2020 · 4 comments

Comments

@jatk
Copy link

jatk commented May 25, 2020

This is a great resource that I wish Microsoft would build into OneNote. I've been trying to get this to work but have been struggling with large file attachments running into this error

'Request timed out, probably due to a large attachment. Skipping.'

Any suggestion on how to get around this error in notebooks with larger attachments?

@danmou
Copy link
Owner

danmou commented May 25, 2020

Does this happen for a lot of your attachments? Otherwise you can simply copy over those attachments manually. The script should download everything else just fine. I'm afraid there's not much to do about the error unless Microsoft has a different API for downloading large files (I haven't looked at it in a long time).

@jatk
Copy link
Author

jatk commented May 26, 2020

Yeah I tried with a few different notebooks with different sized attachments and multiple had this occur. Is there a way to have it skip attachments that are too large? it currently hangs and then fails to download the remaining sections/pages of the notebook

@danmou
Copy link
Owner

danmou commented May 26, 2020

That's weird, skipping them should be the default behavior. Can you post the output you're getting?

@jatk
Copy link
Author

jatk commented May 26, 2020

Traceback (most recent call last):
  File "/home/jatk/anaconda3/envs/myenv/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/jatk/anaconda3/envs/myenv/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/home/jatk/anaconda3/envs/myenv/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/jatk/anaconda3/envs/myenv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/jatk/anaconda3/envs/myenv/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/jatk/anaconda3/envs/myenv/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/jatk/anaconda3/envs/myenv/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/jatk/anaconda3/envs/myenv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/jatk/anaconda3/envs/myenv/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/jatk/anaconda3/envs/myenv/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/mnt/c/Users/Josh/OneDrive/Rice/Notebook/OneNote Backup/onenote_export/onenote_export.py", line 236, in main_logic
    download_notebooks(graph_client, app.config['output_path'], app.config['select_path'], indent=0)
  File "/mnt/c/Users/Josh/OneDrive/Rice/Notebook/OneNote Backup/onenote_export/onenote_export.py", line 175, in download_notebooks
    download_sections(graph_client, sections, path / nb_name, select, indent=indent + 1)
  File "/mnt/c/Users/Josh/OneDrive/Rice/Notebook/OneNote Backup/onenote_export/onenote_export.py", line 194, in download_sections
    pages = get_json(graph_client, sec['pagesUrl'] + '?pagelevel=true')
  File "/mnt/c/Users/Josh/OneDrive/Rice/Notebook/OneNote Backup/onenote_export/onenote_export.py", line 60, in get_json
    resp = get(graph_client, next_page, params=params, indent=indent).json()
AttributeError: 'NoneType' object has no attribute 'json'
127.0.0.1 - - [26/May/2020 10:31:16] "GET /getToken?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [26/May/2020 10:31:16] "GET /getToken?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [26/May/2020 10:31:16] "GET /getToken?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [26/May/2020 10:31:16] "GET /getToken?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [26/May/2020 10:31:17] "GET /getToken?__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -

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

No branches or pull requests

2 participants