-
Notifications
You must be signed in to change notification settings - Fork 551
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
nbviewer can't render files in Google Drive #427
Comments
Well, that link doesn't resolve to a notebook, but rather a download page. That's not going to work. Pulling the URL that actually gets generated from the download (actually annoying to get, as it is all javascripty, but at least stable) yields: And feeding that into the front page of nbviewer, we get the nbviewer URL: we are getting a 403: forbidden from the upstream provider. Checking this with curl: curl "https://doc-00-ag-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/l058tmm4stdqdjhe1hs0t564snj08ahm/1426680000000/09083926091300078733/*/0B30Cah_MN0i0TlZfRlBXLWgxbE0?e=download" Shows the URL will actually reply, but just not to nbviewer.ipython.org. So basically, we would either need:
The provider option seems like a good idea, along with #371 (gitlab), #302 (webgit), and #402 (stash/bitbucket). I've included this in #428! |
Google Drive has worked for me in the past using the web host feature: You just need to extract the document id from the sharing link and use this address instead: Example: your sharing link https://drive.google.com/open?id=0BxSDFsdFDFTVU For some reason however, this doesn't work any more. I'm getting the error "Error reading JSON notebook" . I think the notebook I tested should work (works in ipython), but I'll try again with another one soon. |
None of those links appear to work, asking me to authenticate: try it in a Additionally, even if we did allow this, we would get throttled... one HN API-level integration is really the only path that makes any sense in the On Mon, Jul 27, 2015 at 1:00 PM dominikandreas [email protected]
|
Those links were just an example (i made up the id). The webpage hosting feature of google drive should work though, it's made for static file serving. If nbviewer would catch the doc id from the sharing link and use the www.googledrive.com/host/[doc id] link instead, it shouldn't be a problem. On the other hand, API-level integration is probably still the better way to go |
Tricky! I guess i was being too sneaky before. here's the original julia notebook uploaded to my drive and set to share with world... preliminary effort suggests that setting it to the equivalent of a secret gist (i.e. no auth required, but not searchable) has no effect. We could do something like this knock-off of the dropbox "provider": # ./providers/gdrive/handlers.py
def uri_rewrites(rewrites=[]):
return rewrites + [
(r'^https://drive.google.com/file/d/([^/]*)/.*$',
u'/urls/googledrive.com/host/{1}'),
(r'^https://drive.google.com/open?id=([^&]*)$',
u'/urls/googledrive.com/host/{1}'
] Those two url patterns come through different techniques, both user accessible, but are different enough to not fit in one pattern. I can guarantee that relative file links won't work: drive barely has directories as it is, but if people thought even this level of integration was useful, I wouldn't be against adding it... |
I agree that we should use stable API. As an occasional user of Google Drive, I noticed that Google constantly changes its interface to improve user experience. |
Is there any update on this one? We have google drive at work and I want to share notebooks inside the organization using a in-house hosted nbviewer.... It doesn't work at the moment. |
Glad to here you are able to use nbviewer internally! We're always interested in feedback from other operators :) I'm actually in the same boat: it would be lovely to share our private stuff on a local nbviewer. For non-public drive content, one would have to build out a full API provider, with the server having its own API key able to see everything your google drive organization. The initial hack proposed would have just gotten the globally-viewable stuff. Unfortunately, features that won't be used on nbviewer.*.org are likely not going to end up getting prioritized, but we do have an extension mechanism for providers that would allow an exension, i.e. |
Nbviewer failed to render a valid Julia notebook:
https://drive.google.com/file/d/0B30Cah_MN0i0TlZfRlBXLWgxbE0/view?usp=sharing
stored in Google Driver.
The text was updated successfully, but these errors were encountered: