📜 ⬆️ ⬇️

Connect SkyDrive in Linux

SkyDrive & Ubuntu

Good day.

I want to draw your attention to a couple of scripts for working with SkyDrive in Linux. The scripts are written in Python and most likely will work on any * NIX system, and not only * NIX. The first provides the ability to work with the account in the command line, the second, the module for FUSE, allows you to connect the contents of SkyDrive to the file system. The project is almost never mentioned. I myself stumbled upon it by chance, after I could not connect SkyDrive using undocumented WebDAV. And I began to look for another way to connect, assuming that, since SkyDrive has an API, then someone should use it.

')
Author Michael (?) Kazantsev does not want to advertise the project, so I decided to do it for him. Everything worked for me in Ubuntu 13.04, whether it will work for you, I don't know. In any case, there are few alternatives and it makes sense to try.

Install and configure python-skydrive


Implementing SkyDrive REST API v5.0 in Python. The script allows you to use the command line to work with your SkyDrive account. The project is located on GitHub at https://github.com/mk-fg/python-skydrive (mirror on python.org ). The script is available in the Python package catalog (PyPI). The author of the script recommends using pip for installation, we will use its advice:
sudo apt-get install python-pip sudo pip install 'python-skydrive[standalone]' 

The package has PyYAML dependencies, and as far as I understand it should be installed automatically, but not installed. Therefore:
 sudo pip install pyyaml ( : sudo apt-get install python-yaml) 

Create a ~ / .lcrc file in the home directory, as follows:
 client: id: xxxxxxxx secret: xxxxxxxxxx 

Values ​​for id and secret need to be obtained by registering the application in DevCenter . We register a new application, for example, Python-Skydrive, at the bottom of the page, select the mobile client application, save it. A list of connected applications can be found here: https://account.live.com/consent/Manage .

To access your account, OAuth authorization is used. For authorization, run the command line:
 skydrive-cli auth 

You will need to click on the generated link and allow the application access, redirect to another page, copy its address and paste into the command line to complete the authorization.

Done, the list of available skydrive-cli --help (your KO).

Connect SkyDrive to the file system


This will require another script, you can download it at https://github.com/mk-fg/skydrive-fuse-fs . It will be necessary to download skydrivefs and copy it to the directory for executable files (in the example /usr/local/sbin/ was shown, I followed the example). Mark the file as executable. You will also need to install the fusepy module:
 sudo pip install fusepy 

(or just copy the bundled fuse.py to the same directory as skydrivefs)
Checking:
 sudo mkdir /media/skydrive && sudo skydrivefs /media/skydrive 

A new skydrive should appear in the mounted drives.

It remains to automate the connection process, opens / etc / fstab for editing and add:
 skydrivefs /media/skydrive fuse.skydrivefs user,rw,noauto 0 0 

After the reboot, you can access your SkyDrive simply by clicking on the disk icon.

Technical details, code ... available on the links. Inquiring minds will find many ways to access SkyDrive from the command line in action. The rest will be more convenient to use SkyDrive as a file system.

Thank you for your attention, I hope this article will be useful to you.

Source: https://habr.com/ru/post/179213/


All Articles