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

Use Guzzle stream to download files from GDrive #21732

Merged
merged 1 commit into from
Jan 18, 2016

Conversation

PVince81
Copy link
Contributor

The API library does not support streaming and always reads the full
file into memory.

This workaround copies the signed headers to a Guzzle request and
returns the response as stream.

Inspired by @icewind1991's approach for DAV: #18653

Before: (the download takes a while to start due to temp storage)

  % curl "http://root:admin@localhost/owncloud/remote.php/webdav/gdrive/direct%20upload/BigBuckBunny_320x180.mp4" -o test_master.mp4
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 61.6M  100 61.6M    0     0   352k      0  0:02:59  0:02:59 --:--:-- 16.6M

After:

  % curl "http://root:admin@localhost/owncloud/remote.php/webdav/gdrive/direct%20upload/BigBuckBunny_320x180.mp4" -o test.mp4
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 61.6M  100 61.6M    0     0   712k      0  0:01:28  0:01:28 --:--:--  785k

Fixes the download part of #21357

Please review @icewind1991 @Xenopathic

The API library does not support streaming and always reads the full
file into memory.

This workaround copies the signed headers to a Guzzle request and
returns the response as stream.
@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @Xenopathic, @MTGap and @icewind1991 to be potential reviewers

@PVince81 PVince81 added this to the 9.0-current milestone Jan 14, 2016
@karlitschek
Copy link
Contributor

nice 👍

@PVince81
Copy link
Contributor Author

@MorrisJobke

@icewind1991
Copy link
Contributor

Looks good 👍

@PVince81
Copy link
Contributor Author

@karlitschek backport to 8.2.2 at least ?

@karlitschek
Copy link
Contributor

backport is fine if this is fully tested. 👍

@PVince81
Copy link
Contributor Author

@davitol mind doing another test for this PR ? The only test needed is downloading, see original post. Maybe spice it up a bit with encryption and shares 😄

DeepDiver1975 added a commit that referenced this pull request Jan 18, 2016
Use Guzzle stream to download files from GDrive
@DeepDiver1975 DeepDiver1975 merged commit a32f8aa into master Jan 18, 2016
@DeepDiver1975 DeepDiver1975 deleted the gdrive-stream-download branch January 18, 2016 13:16
@PVince81
Copy link
Contributor Author

stable8.2: #21825

@lock
Copy link

lock bot commented Aug 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants