rclone icon indicating copy to clipboard operation
rclone copied to clipboard

Yandex Disk speed cap fixes

Open Evengard opened this issue 11 months ago • 5 comments

What is the purpose of this change?

  1. It fixes the speed cap of Yandex.Disk
  2. It allows for a device-type authorization flow (used when no browser available)

Now, this was an "exploratory PR", because I was initially having the wrong assumption about from where the speed cap actually comes from, hence why I implemented the device-type authorization flow first. I still kept it, as it should help people on systems without browsers to authenticate more easily...

It looks like the method how Yandex.Disk is actually limiting the speed is... The User-Agent. Yep, simple as that. When I sniffed the actual used UserAgent and tried to use it, miraculously, the speed limit was gone. So here we are, I just copied it from the official latest client, adjusted a bit and it Just Works ©. I still made sure that it is still possible to override it.

Was the change discussed in an issue or in the forum before?

This is a widely known problem. Found a thread here: https://forum.rclone.org/t/slow-upload-speed-yandex-disk/31943

Checklist

  • [X] I have read the contribution guidelines.
  • [ ] I have added tests for all changes in this PR if appropriate.
  • [X] I have added documentation for the changes if appropriate.
  • [X] All commit messages are in house style.
  • [X] I'm done, this Pull Request is ready for review :-)

Evengard avatar Mar 04 '24 01:03 Evengard

@devnoname120 You might be interested

Evengard avatar Mar 04 '24 01:03 Evengard

Anyone?... @ncw ?

Evengard avatar Mar 27 '24 20:03 Evengard

@Evengard sorry for the delay reviewing.

Do you think you could split this into two PRs? One for the speed improving user agent and one for the device-type authorization.

They both look useful. The User Agent changes will be easy to merge, but I think the oauth stuff will require some thought (eg will with work with other backends, is it part of the standard, how can we stop it reading from stdin as part of the config flow etc).

ncw avatar Apr 02 '24 11:04 ncw

Man, I thought the policy "split your PRs" would be kept at the workplace 😁 Yeah, I can try to split them during the weekends, sorry about that, was exploring stuff. Do you want this one to be closed and open two new ones?

Evengard avatar Apr 02 '24 21:04 Evengard

Good day.

Is there any news on whether this fix will be merged or not?

Cheers

zeretrelle avatar Aug 26 '24 19:08 zeretrelle

We have merged a user agent fix in af9f8ce so this PR can concentrate on the device auth flow.

Can you rebase it sand or close this one and open a new pr just with the device auth flow @Evengard if you still want to get it merged.

ncw avatar Aug 29 '24 17:08 ncw