GithubHelp home page GithubHelp logo

mdkpredator / degoo_drive Goto Github PK

View Code? Open in Web Editor NEW
52.0 6.0 16.0 136 KB

Mount a virtual drive with Degoo content

Dockerfile 0.36% Python 65.48% C 6.13% Cython 27.99% Shell 0.03%
degoo drive pyfuse3 degoo-drive plex mount virtual-drive vfs

degoo_drive's Introduction

Degoo Drive

Because Degoo does not provide a way to use their application as a virtual drive, like Google Drive, I have created a project to make this possible, thanks to pyfuse3 and Degoo CLI. This will not work on Windows, only available in unix environments

Requirements

  • pyfuse3 requires the libfuse3-dev and fuse3 libraries to run. These can be installed via apt install -y libfuse3-dev fuse3 (Available from Ubuntu 20.04)
  • Degoo CLI requires python 3.8 and dependencies included in requirements.txt
  • And this project requires both of the above

Dependencies

apt update
apt install -y --no-install-recommends git
apt install -y libfuse3-dev fuse3
apt install -y python3.8
apt install -y python3-pip
apt install -y pkg-config
apt install -y python3.8-dev

python3.8 -m pip install appdirs wget python-magic humanize humanfriendly python-dateutil requests clint requests_toolbelt pyfuse3 pyjwt

All in one:

apt update && apt install -y --no-install-recommends git libfuse3-dev fuse3 python3.8 python3-pip pkg-config && python3.8 -m pip install appdirs wget python-magic humanize humanfriendly python-dateutil requests clint requests_toolbelt pyfuse3

Installation

You must clone this repository git clone https://github.com/MDKPredator/degoo_drive. Ensure you have installed git: apt install git

Configuration

Run degoo_login to create the directory with the configuration to access Degoo. Normally it will be created in ~/.config/degoo. In this path you should have the following files:

  • default_properties.txt
  • schedule.json
  • credentials.json
  • keys.json
  • overlay4.txt

Edit file credentials.json to enter your credentials (email and password)

IMPORTANT: If you log in with Google (Sign in with Google button) this method does not work. You will have to change it to login with your email and a password.

Basic usage

First you must clone this project with git clone https://github.com/MDKPredator/degoo_drive. You can then mount your unit by running the command python3 fuse_degoo.py. By default, drive is mounted in /home/degoo

Options

The following options are available:

  • --mountpoint Path where drive will be mounted. Default is /home/degoo
  • --degoo-email Email to login in Degoo
  • --degoo-pass Password to login in Degoo
  • --degoo-refresh-token Used when token expires. Alternative if login fails
  • --degoo-path Degoo base path to mount the drive. Default is root /
  • --cache-size Size of downloaded chunk
  • --debug Displays logs
  • --debug-fuse Displays the filesystem logs
  • --allow-other Allows other users to access files
  • --refresh-interval Time, in minutes, that Degoo information is refreshed. Default is 10 minutes
  • --disable-refresh Disables the refresh
  • --flood-sleep-time Waiting time, in seconds, before resuming requests once the maximum has been reached
  • --flood-max-requests Maximum number of requests in the period
  • --flood-time-to-check Request control period, in minutes
  • --change-hostname Disable change domain for media files. Default is false
  • --mode How to read the content. Lazy (default) reads as browsing (recommended for large content). Eager to read all content the first time
  • --config-path Path to the configuration files. Default is ~/.config/degoo/
  • --plex-split-file (Experimental) Check if there are split files to cache the first part

Docker

This project includes a Dockerfile to mount the virtual drive. You will only need to modify the credentials.json file before creating the image:

  1. Clone this repository: git clone https://github.com/MDKPredator/degoo_drive
  2. Modify degoo_config/credentials.json
  3. Create the image docker build -t degoo_drive .
  4. Run container docker run -dit --privileged --name degoo degoo_drive

Examples

Here are some examples of how to pass arguments to the mounting drive

  • Run container with debug: docker run -dit --privileged --name degoo degoo_drive --debug
  • Run container bypassing login (token and refrehs token): docker run -dit --privileged --name degoo degoo_drive --debug --degoo-refresh-token myRefreshToken
  • Change default mountpoint: docker run -dit --privileged --name degoo degoo_drive --debug --mountpoint /degoo_drive

Degoo Drive and Plex

You can use the docker file (Dockerfile-plex) included in the project to mount the container with the latest version of plex, and the virtual drive. Just follow these steps:

  1. Modify the keys.json file to include RefreshToken
  2. Create the image: docker build -f Dockerfile-plex -t plex_degoo_drive .
  3. Create the volumes in host
  4. Create the container: docker create --name=plex --net=host --memory="2gb" --privileged --cap-add SYS_ADMIN --device /dev/fuse -e VERSION=latest -e PUID=1001 -e PGID=1001 -e TZ=Europe/Madrid -v /path/to/volume/plex/config:/config -v /path/to/volume/plex/tvshows:/data/tvshows -v /path/to/volume/plex/movies:/data/movies -v /path/to/volume/plex/transcode:/transcode plex_degoo_drive
  5. Go to http://localhost:32400/web/index.html

Login bypass

If login fails with a 429 Too Many Requests, or similar, you can bypass it by using directly refreshToken provided by Degoo once logged in. To do so, go to https://app.degoo.com/login and open the developer tools to see this data.

Degoo login

Disclaimer

Uploading files to Degoo (cp and mv commands) does not work 100% of the time, so it is recommended to use the cp command to avoid losing files. In case the upload is unsuccessful, if you have enabled the logs, you will see the following message: WARN: file [name_of_file.ext] has not been uploaded successfully

degoo_drive's People

Contributors

cultusmechanicus avatar diyism avatar mdkpredator avatar preethaml7 avatar rgb5100 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

degoo_drive's Issues

Login Issue (New to This)

Hi, I am super new to Linux. I am running under Ubuntu Server on a raspberry pi. I have entered the correct token and refresh token keys in the keys.json file. I get this error when executing fuse_degoo.py.

ubuntu@ubuntu:~/degoo_drive$ sudo python3 fuse_degoo.py
Traceback (most recent call last):
File "fuse_degoo.py", line 861, in
main()
File "fuse_degoo.py", line 827, in main
operations.load_degoo_content()
File "fuse_degoo.py", line 701, in load_degoo_content
degoo_tree_content = degoo.tree_cache(mode=self._mode)
File "/home/ubuntu/degoo_drive/degoo/init.py", line 2032, in tree_cache
tree(dir_id, show_times, _done, mode=mode)
File "/home/ubuntu/degoo_drive/degoo/init.py", line 1988, in tree
kids = get_children(dir_id)
File "/home/ubuntu/degoo_drive/degoo/init.py", line 1452, in get_children
CACHE_CONTENTS[dir_id] = api.getFileChildren5(dir_id)
File "/home/ubuntu/degoo_drive/degoo/init.py", line 744, in getFileChildren5
"Token": self._get_token(),
File "/home/ubuntu/degoo_drive/degoo/init.py", line 449, in _get_token
if self.KEYS["Token"] and self.KEYS["RefreshToken"]:
KeyError: 'Token'

I appreciate in help in resolving this.

Thanks.

429 Client Error: Too Many Requests for url: https://rest-api.degoo.com/login

Login give me an error:

Traceback (most recent call last):
  File "/degoo_drive/fuse_degoo.py", line 851, in <module>
    main()
  File "/degoo_drive/fuse_degoo.py", line 817, in main
    operations.load_degoo_content()
  File "/degoo_drive/fuse_degoo.py", line 721, in load_degoo_content
    degoo_tree_content = degoo.tree_cache(mode=self._mode)
  File "/degoo_drive/degoo/__init__.py", line 2069, in tree_cache
    tree(dir_id, show_times, _done, mode=mode)
  File "/degoo_drive/degoo/__init__.py", line 2025, in tree
    kids = get_children(dir_id)
  File "/degoo_drive/degoo/__init__.py", line 1467, in get_children
    __CACHE_CONTENTS__[dir_id] = api.getFileChildren3(dir_id)
  File "/degoo_drive/degoo/__init__.py", line 762, in getFileChildren3
    "Token": self._get_token(),
  File "/degoo_drive/degoo/__init__.py", line 478, in _get_token
    login()
  File "/degoo_drive/degoo/__init__.py", line 308, in login
    response.raise_for_status()
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://rest-api.degoo.com/login

But not in the browser if I try just after or before issue I have.

Please help

Not start

I just dockerised and I had this issue:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/jwt/api_jws.py", line 190, in _load
    signing_input, crypto_segment = jwt.rsplit(b".", 1)
ValueError: not enough values to unpack (expected 2, got 1)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/degoo_drive/fuse_degoo.py", line 882, in <module>
    main()
  File "/degoo_drive/fuse_degoo.py", line 848, in main
    operations.load_degoo_content()
  File "/degoo_drive/fuse_degoo.py", line 722, in load_degoo_content
    degoo_tree_content = degoo.tree_cache(mode=self._mode)
  File "/degoo_drive/degoo/__init__.py", line 2017, in tree_cache
    tree(dir_id, show_times, _done, mode=mode)
  File "/degoo_drive/degoo/__init__.py", line 1973, in tree
    kids = get_children(dir_id)
  File "/degoo_drive/degoo/__init__.py", line 1439, in get_children
    __CACHE_CONTENTS__[dir_id] = api.getFileChildren3(dir_id)
  File "/degoo_drive/degoo/__init__.py", line 736, in getFileChildren3
    "Token": self._get_token(),
  File "/degoo_drive/degoo/__init__.py", line 450, in _get_token
    deserialized = jwt.decode(self.KEYS["Token"], options={"verify_signature": False, "verify_aud": False})
  File "/usr/local/lib/python3.8/site-packages/jwt/api_jwt.py", line 119, in decode
    decoded = self.decode_complete(jwt, key, algorithms, options, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/jwt/api_jwt.py", line 90, in decode_complete
    decoded = api_jws.decode_complete(
  File "/usr/local/lib/python3.8/site-packages/jwt/api_jws.py", line 149, in decode_complete
    payload, signing_input, header, signature = self._load(jwt)
  File "/usr/local/lib/python3.8/site-packages/jwt/api_jws.py", line 193, in _load
    raise DecodeError("Not enough segments") from err
jwt.exceptions.DecodeError: Not enough segments

Can't login

Hey guys, so I have installed and configured everything and for some reason Im not able to login.
When I do the command python3 degoo_login it always says Login Failed. I have checked the credencials and even changed my password and still wont work.

Failed to establish a new connection & Max retries exceeded with url

Hi MDKPredator i'm again,

download the newer version of repository to fix the "Signature expired" has worked. It refreshes now successfully the Token, but at uploading large files i have the next issue. Can you please look? Thanks :)

`Token expired. Refreshing
Token expired. Refreshing ] 8589877248/108805317157 - 06:02:48
Exception in thread Thread-1: ] 22709927936/108805317157 - 05:07:37
Traceback (most recent call last):
File "/home/hashlo/.local/lib/python3.9/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/home/hashlo/.local/lib/python3.9/site-packages/urllib3/util/connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.9/socket.py", line 954, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/hashlo/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/home/hashlo/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/home/hashlo/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "/home/hashlo/.local/lib/python3.9/site-packages/urllib3/connection.py", line 353, in connect
conn = self._new_conn()
File "/home/hashlo/.local/lib/python3.9/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f264efc9d00>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/home/hashlo/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/home/hashlo/.local/lib/python3.9/site-packages/urllib3/util/retry.py", line 573, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='production-appsync.degoo.com', port=443): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f264efc9d00>: Failed to establish a new connection: [Errno -2] Name or service not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/home/hashlo/Degoo/fuse_degoo.py", line 689, in refresh_degoo_content
self.load_degoo_content()
File "/home/hashlo/Degoo/fuse_degoo.py", line 696, in load_degoo_content
degoo_tree_content = degoo.tree_cache(mode=self._mode)
File "/home/hashlo/Degoo/degoo/init.py", line 2023, in tree_cache
tree(dir_id, show_times, _done, mode=mode)
File "/home/hashlo/Degoo/degoo/init.py", line 1979, in tree
kids = get_children(dir_id)
File "/home/hashlo/Degoo/degoo/init.py", line 1445, in get_children
CACHE_CONTENTS[dir_id] = api.getFileChildren3(dir_id)
File "/home/hashlo/Degoo/degoo/init.py", line 753, in getFileChildren3
response = requests.post(URL_API, headers=header, data=json.dumps(request))
File "/usr/lib/python3/dist-packages/requests/api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='production-appsync.degoo.com', port=443): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f264efc9d00>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Token expired. Refreshing########] 108805317157/108805317157 - 00:00:00

`

The license

What is the license of degoo_drive, please?

Fuse error on sync file (unique: 12, error: -38 (Function not implemented))

Project now is working with a workaround passing my RefreshToken, but I still have a problem.

I create a container with this docker-compose:


services:
  degoo-drive:
    container_name: deego-drive
    build:
      context: .
      dockerfile: Dockerfile
    privileged: true # needed
    volumes:
       - ./degoo:/degoo_drive/degoo
       - ~/Downloads/DEGOO:/home/degoo
    restart: unless-stopped

I go into container and this is the log when I try to go inside the Folder in sync:

(with command ls I can see degoo folder and files, but in the mount directory I have nothing)

2022-01-09 21:28:11.381 MainThread: [__main__] Root Degoo path:     /
2022-01-09 21:28:11.381 MainThread: [__main__] Refresh interval:    600 seconds
2022-01-09 21:28:11.381 MainThread: [__main__] Flood control:       Disabled
2022-01-09 21:28:11.381 MainThread: [__main__] Change hostname:     Disabled
2022-01-09 21:28:11.381 MainThread: [__main__] Mode:                lazy
2022-01-09 21:28:11.381 MainThread: [__main__] Reading Degoo content from directory /
2022-01-09 21:28:11.384 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): production-appsync.degoo.com:443
2022-01-09 21:28:11.793 MainThread: [urllib3.connectionpool] https://production-appsync.degoo.com:443 "POST /graphql HTTP/1.1" 200 None
2022-01-09 21:28:11.796 MainThread: [__main__] _add_path for 0, /
2022-01-09 21:28:11.796 MainThread: [__main__] _add_path for 16684031581, /iPhone
2022-01-09 21:28:11.797 MainThread: [__main__] _add_path for 16279572734, /Web
2022-01-09 21:28:11.797 MainThread: [__main__] Mounting...
2022-01-09 21:28:11.806 MainThread: [pyfuse3] Initializing pyfuse3
2022-01-09 21:28:11.806 MainThread: [pyfuse3] Calling fuse_session_new
FUSE library version: 3.10.3
2022-01-09 21:28:11.806 MainThread: [pyfuse3] Calling fuse_session_mount
2022-01-09 21:28:11.808 MainThread: [__main__] Entering main loop..
2022-01-09 21:28:11.811 MainThread: [pyfuse3] pyfuse-02: No tasks waiting, starting another worker (now 2 total).
unique: 2, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.32
flags=0x03fffffb
max_readahead=0x00020000
   INIT: 7.31
   flags=0x0041b039
   max_readahead=0x00020000
   max_write=0x00100000
   max_background=0
   congestion_threshold=0
   time_gran=1
   unique: 2, success, outsize: 80
unique: 4, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 10
   unique: 4, success, outsize: 120
unique: 6, opcode: OPENDIR (27), nodeid: 1, insize: 48, pid: 18
   unique: 6, success, outsize: 32
unique: 8, opcode: READDIRPLUS (44), nodeid: 1, insize: 80, pid: 18
2022-01-09 21:28:40.686 MainThread: [__main__] reading /
2022-01-09 21:28:40.687 MainThread: [__main__] _add_path for 16279572734, /Web
2022-01-09 21:28:40.687 MainThread: [__main__] _add_path for 16684031581, /iPhone
   unique: 8, success, outsize: 336
unique: 10, opcode: READDIRPLUS (44), nodeid: 1, insize: 80, pid: 18
2022-01-09 21:28:40.687 MainThread: [__main__] reading /
   unique: 10, success, outsize: 16
unique: 12, opcode: RELEASEDIR (29), nodeid: 1, insize: 64, pid: 0
   unique: 12, error: -38 (Function not implemented), outsize: 16

Can't mount

Hello, I would like to use my 516.16GB from Degoo on Linux and I came across this repository. I tried to mount it but the mount fails.
Command:
python3 fuse_degoo.py --mountpoint /home/user/degoo --degoo-email ************************* --debug --debug-fuse --degoo-pass ****************************************************************************************************

Logs:
2022-06-29 15:45:56.785 MainThread: [main] ##### Initializating Degoo drive #####
2022-06-29 15:45:56.785 MainThread: [main] Local mount point: /home/user/degoo
2022-06-29 15:45:56.786 MainThread: [main] Cache size: 15728640 kb
2022-06-29 15:45:56.786 MainThread: [main] Degoo email: *************************
2022-06-29 15:45:56.786 MainThread: [main] Degoo pass: ****************************************************************************************************
2022-06-29 15:45:56.786 MainThread: [main] Root Degoo path: /
2022-06-29 15:45:56.786 MainThread: [main] Refresh interval: 600 seconds
2022-06-29 15:45:56.786 MainThread: [main] Flood control: Disabled
2022-06-29 15:45:56.786 MainThread: [main] Change hostname: Disabled
2022-06-29 15:45:56.786 MainThread: [main] Search split files: Disabled
2022-06-29 15:45:56.786 MainThread: [main] Mode: lazy
2022-06-29 15:45:56.786 MainThread: [main] Reading Degoo content from directory /
Token and/or refresh token does not found. Login with Degoo
2022-06-29 15:45:56.789 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): rest-api.degoo.com:443
2022-06-29 15:45:56.854 MainThread: [urllib3.connectionpool] https://rest-api.degoo.com:443 "POST /login HTTP/1.1" 429 0
Token expired. Refreshing
2022-06-29 15:45:56.857 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): rest-api.degoo.com:443
2022-06-29 15:45:56.898 MainThread: [urllib3.connectionpool] https://rest-api.degoo.com:443 "POST /access-token HTTP/1.1" 429 None
2022-06-29 15:45:56.905 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): production-appsync.degoo.com:443
2022-06-29 15:45:57.105 MainThread: [urllib3.connectionpool] https://production-appsync.degoo.com:443 "POST /graphql HTTP/1.1" 401 129
Traceback (most recent call last):
File "/home/user/Downloads/degoo_drive/fuse_degoo.py", line 959, in
main()
File "/home/user/Downloads/degoo_drive/fuse_degoo.py", line 919, in main
operations.load_degoo_content()
File "/home/user/Downloads/degoo_drive/fuse_degoo.py", line 789, in load_degoo_content
degoo_tree_content = degoo.tree_cache(mode=self._mode)
File "/home/user/Downloads/degoo_drive/degoo/init.py", line 2032, in tree_cache
tree(dir_id, show_times, _done, mode=mode)
File "/home/user/Downloads/degoo_drive/degoo/init.py", line 1988, in tree
kids = get_children(dir_id)
File "/home/user/Downloads/degoo_drive/degoo/init.py", line 1452, in get_children
CACHE_CONTENTS[dir_id] = api.getFileChildren5(dir_id)
File "/home/user/Downloads/degoo_drive/degoo/init.py", line 831, in getFileChildren5
raise DegooError(f"getFileChildren5 failed with: {response}")
degoo.DegooError: getFileChildren5 failed with: <Response [401]>

OverflowError: Python int too large to convert to C int

When I do:

$ cp a.txt /home/degoo/Web/a.txt
cp: failed to close '/home/degoo/Web/a.txt': Software caused connection abort

The errors show:

$ python3 fuse_degoo.py --debug --debug-fuse
Unexpected error:  <class 'OverflowError'>
2022-10-16 00:29:11.898 MainThread: [pyfuse3] Calling fuse_session_unmount
2022-10-16 00:29:11.910 MainThread: [pyfuse3] Calling fuse_session_destroy
Traceback (most recent call last):
  File "/home/malcolm/Downloads/test/degoo/degoo_drive/fuse_degoo.py", line 967, in <module>
    main()
  File "/home/malcolm/Downloads/test/degoo/degoo_drive/fuse_degoo.py", line 951, in main
    trio.run(pyfuse3.main)
  File "/home/malcolm/.local/lib/python3.9/site-packages/trio/_core/_run.py", line 1946, in run
    raise runner.main_task_outcome.error
  File "/home/malcolm/.local/lib/python3.9/site-packages/_pyfuse3.py", line 43, in wrapper
    await fn(*args, **kwargs)
  File "src/pyfuse3.pyx", line 781, in main
    _notify_queue.put(None)
  File "/home/malcolm/.local/lib/python3.9/site-packages/trio/_core/_run.py", line 813, in __aexit__
    raise combined_error_from_nursery
  File "/home/malcolm/.local/lib/python3.9/site-packages/_pyfuse3.py", line 43, in wrapper
    await fn(*args, **kwargs)
  File "src/internal.pxi", line 272, in _session_loop
    await py_retval
  File "src/handlers.pxi", line 467, in fuse_write_buf_async
    len_ = await operations.write(c.fh, c.off, buf)
  File "/home/malcolm/Downloads/test/degoo/degoo_drive/fuse_degoo.py", line 542, in write
    os.lseek(fd, offset, os.SEEK_SET)
OverflowError: Python int too large to convert to C int

I've try to print the input params:

    async def write(self, fd, offset, buf):
        log.debug('========[%s, %s, %s]', fd, offset, buf)
        os.lseek(fd, offset, os.SEEK_SET)

the log shows:
2022-10-16 00:29:11.896 MainThread: [main] ========[18486899113, 0, b'jack\n']

Fail to copy files to and from Degoo volume

I created docker container according to instructions using docker-compose.yml (at the root of cloned repository degoo_drive folder):

version: '3'

services:
  degoo-drive:
    build: .
    command: --debug --debug-fuse
    container_name: degoo-drive
    privileged: true
    volumes:
      - ${DEGOO_MOUNT}:/source_dir
      - ./degoo_config:/root/.config/degoo
    restart: always
    network_mode: host

Login didn't work using credentials.json but I modified Token and RefreshToken in keys.json with values from logging in with browser (Edge).

Init:

2022-11-14 12:14:53.132 MainThread: [__main__] Mode:                lazy
2022-11-14 12:14:53.132 MainThread: [__main__] Reading Degoo content from directory /
2022-11-14 12:14:53.136 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): production-appsync.degoo.com:443
2022-11-14 12:14:53.673 MainThread: [urllib3.connectionpool] https://production-appsync.degoo.com:443 "POST /graphql HTTP/1.1" 200 None
2022-11-14 12:14:53.676 MainThread: [__main__] _add_path for 0, /
2022-11-14 12:14:53.676 MainThread: [__main__] _add_path for 15884293431, /Web
2022-11-14 12:14:53.676 MainThread: [__main__] Mounting...
2022-11-14 12:14:53.688 MainThread: [pyfuse3] Initializing pyfuse3
2022-11-14 12:14:53.688 MainThread: [pyfuse3] Calling fuse_session_new
FUSE library version: 3.10.3
2022-11-14 12:14:53.688 MainThread: [pyfuse3] Calling fuse_session_mount
2022-11-14 12:14:53.689 MainThread: [__main__] Entering main loop..
2022-11-14 12:14:53.691 MainThread: [pyfuse3] pyfuse-02: No tasks waiting, starting another worker (now 2 total).
unique: 2, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.34
flags=0x33fffffb
max_readahead=0x00020000
   INIT: 7.31
   flags=0x0041b039
   max_readahead=0x00020000
   max_write=0x00100000
   max_background=0
   congestion_threshold=0
   time_gran=1
   unique: 2, success, outsize: 80
unique: 4, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 8
   unique: 4, success, outsize: 120
unique: 6, opcode: OPENDIR (27), nodeid: 1, insize: 48, pid: 8
   unique: 6, success, outsize: 32
unique: 8, opcode: READDIRPLUS (44), nodeid: 1, insize: 80, pid: 8
2022-11-14 12:15:14.449 MainThread: [__main__] reading /
2022-11-14 12:15:14.449 MainThread: [__main__] _add_path for 15884293431, /Web
   unique: 8, success, outsize: 360
unique: 10, opcode: READDIRPLUS (44), nodeid: 1, insize: 80, pid: 8
2022-11-14 12:15:14.450 MainThread: [__main__] reading /
   unique: 10, success, outsize: 16
unique: 12, opcode: RELEASEDIR (29), nodeid: 1, insize: 64, pid: 0
   unique: 12, error: -38 (Function not implemented), outsize: 16
unique: 14, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 8
   unique: 14, success, outsize: 120
unique: 16, opcode: OPENDIR (27), nodeid: 15884293431, insize: 48, pid: 8
   unique: 16, success, outsize: 32
unique: 18, opcode: READDIRPLUS (44), nodeid: 15884293431, insize: 80, pid: 8

Trying to copy file from Degoo drive to local filesystem:

cp /home/degoo/Web/kansi.pdf /source_dir/

Empty file (size 0) kansi.pdf file is created at target path.

2022-11-14 12:15:15.388 MainThread: [__main__] reading /Web
2022-11-14 12:15:15.391 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): production-appsync.degoo.com:443
2022-11-14 12:15:15.971 MainThread: [urllib3.connectionpool] https://production-appsync.degoo.com:443 "POST /graphql HTTP/1.1" 200 None
2022-11-14 12:15:15.974 MainThread: [__main__] _add_path for 18778209180, /Web/kansi.pdf
2022-11-14 12:15:15.975 MainThread: [__main__] _add_path for 18778209180, /Web/kansi.pdf
   unique: 18, success, outsize: 184
unique: 20, opcode: READDIRPLUS (44), nodeid: 15884293431, insize: 80, pid: 8
2022-11-14 12:15:15.975 MainThread: [__main__] reading /Web
   unique: 20, success, outsize: 16
unique: 22, opcode: RELEASEDIR (29), nodeid: 15884293431, insize: 64, pid: 0
   unique: 22, error: -38 (Function not implemented), outsize: 16
unique: 24, opcode: GETATTR (3), nodeid: 15884293431, insize: 56, pid: 8
   unique: 24, success, outsize: 120
unique: 26, opcode: OPEN (14), nodeid: 18778209180, insize: 48, pid: 16
   unique: 26, success, outsize: 32
unique: 28, opcode: READ (15), nodeid: 18778209180, insize: 80, pid: 16
   unique: 28, error: -2 (No such file or directory), outsize: 16
unique: 30, opcode: READ (15), nodeid: 18778209180, insize: 80, pid: 16
   unique: 30, error: -2 (No such file or directory), outsize: 16
unique: 32, opcode: FLUSH (25), nodeid: 18778209180, insize: 64, pid: 16
   unique: 32, error: -38 (Function not implemented), outsize: 16
unique: 34, opcode: RELEASE (18), nodeid: 18778209180, insize: 64, pid: 0
2022-11-14 12:15:19.661 MainThread: [__main__] Releasing file kansi.pdf
   unique: 34, success, outsize: 16
unique: 36, opcode: OPENDIR (27), nodeid: 1, insize: 48, pid: 8
   unique: 36, success, outsize: 32
unique: 38, opcode: READDIRPLUS (44), nodeid: 1, insize: 80, pid: 8

Trying to copy file from local filesystem to Degoo drive:

cp /source_dir/degoo_token_refresh_token.png /home/degoo/Web/

No file is created at Degoo web drive.

2022-11-14 12:15:37.290 MainThread: [__main__] reading /
2022-11-14 12:15:37.290 MainThread: [__main__] _add_path for 15884293431, /Web
   unique: 38, success, outsize: 360
unique: 40, opcode: READDIRPLUS (44), nodeid: 1, insize: 80, pid: 8
2022-11-14 12:15:37.290 MainThread: [__main__] reading /
   unique: 40, success, outsize: 16
unique: 42, opcode: RELEASEDIR (29), nodeid: 1, insize: 64, pid: 0
   unique: 42, error: -38 (Function not implemented), outsize: 16
unique: 44, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 8
   unique: 44, success, outsize: 120
unique: 46, opcode: LOOKUP (1), nodeid: 15884293431, insize: 70, pid: 17
2022-11-14 12:15:38.699 MainThread: [__main__] lookup for degoo_token_refresh_token.png in 15884293431
   unique: 46, error: -2 (No such file or directory), outsize: 16
unique: 48, opcode: LOOKUP (1), nodeid: 15884293431, insize: 70, pid: 17
2022-11-14 12:15:38.700 MainThread: [__main__] lookup for degoo_token_refresh_token.png in 15884293431
   unique: 48, error: -2 (No such file or directory), outsize: 16
unique: 50, opcode: CREATE (35), nodeid: 15884293431, insize: 86, pid: 17
2022-11-14 12:15:38.700 MainThread: [__main__] _add_path for 3295235, /tmp/degoo/degoo_token_refresh_token.png
   unique: 50, success, outsize: 160
unique: 52, opcode: GETATTR (3), nodeid: 3295235, insize: 56, pid: 17
   unique: 52, success, outsize: 120
unique: 54, opcode: GETATTR (3), nodeid: 3295235, insize: 56, pid: 17
   unique: 54, success, outsize: 120
unique: 56, opcode: WRITE (16), nodeid: 3295235, insize: 9073, pid: 17
   unique: 56, success, outsize: 24
unique: 58, opcode: RELEASE (18), nodeid: 3295235, insize: 64, pid: 0
   unique: 58, success, outsize: 16

I can create new folders and delete folders and uploaded (via web-UI) files but file download/upload doesn't work.
Any help would be appreciated!

No token issued from degoo, only refresh token

I noticed degoo currently does not issue a token but only RefreshToken is sent in response after successful login in dev tools. I have tested it passing the old invalid token with the updated Refresh Token and I am able to log in and access files with the latest code. As this parameter is no longer required, please look into it and remove it.

Signature has expired on Ubuntu

Hi,

i have the problem that the keys(Token and RefreshToken) , which i got manually from Developer Tools of Chrome at Login, expires and its not refreshing the signature. My Machine is Ubuntu.

Here is the Issue:
Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "/home/hashlo/Degoo/fuse_degoo.py", line 715, in refresh_degoo_content self.load_degoo_content() File "/home/hashlo/Degoo/fuse_degoo.py", line 722, in load_degoo_content degoo_tree_content = degoo.tree_cache(mode=self._mode) File "/home/hashlo/Degoo/degoo/__init__.py", line 2017, in tree_cache tree(dir_id, show_times, _done, mode=mode) File "/home/hashlo/Degoo/degoo/__init__.py", line 1973, in tree kids = get_children(dir_id) File "/home/hashlo/Degoo/degoo/__init__.py", line 1439, in get_children __CACHE_CONTENTS__[dir_id] = api.getFileChildren3(dir_id) File "/home/hashlo/Degoo/degoo/__init__.py", line 736, in getFileChildren3 "Token": self._get_token(), File "/home/hashlo/Degoo/degoo/__init__.py", line 450, in _get_token deserialized = jwt.decode(self.KEYS["Token"], options={"verify_signature": False, "verify_aud": False}) File "/usr/lib/python3/dist-packages/jwt/api_jwt.py", line 104, in decode self._validate_claims(payload, merged_options, **kwargs) File "/usr/lib/python3/dist-packages/jwt/api_jwt.py", line 134, in _validate_claims self._validate_exp(payload, now, leeway) File "/usr/lib/python3/dist-packages/jwt/api_jwt.py", line 175, in _validate_exp raise ExpiredSignatureError('Signature has expired') jwt.exceptions.ExpiredSignatureError: Signature has expired Unexpected error: <class 'jwt.exceptions.ExpiredSignatureError'>:00:00 Traceback (most recent call last): File "/home/hashlo/Degoo/fuse_degoo.py", line 882, in <module> main() File "/home/hashlo/Degoo/fuse_degoo.py", line 869, in main trio.run(pyfuse3.main) File "/usr/local/lib/python3.9/dist-packages/trio/_core/_run.py", line 1946, in run raise runner.main_task_outcome.error File "/usr/local/lib/python3.9/dist-packages/_pyfuse3.py", line 43, in wrapper await fn(*args, **kwargs) File "src/pyfuse3.pyx", line 781, in main _notify_queue.put(None) File "/usr/local/lib/python3.9/dist-packages/trio/_core/_run.py", line 813, in __aexit__ raise combined_error_from_nursery File "/usr/local/lib/python3.9/dist-packages/_pyfuse3.py", line 43, in wrapper await fn(*args, **kwargs) File "src/internal.pxi", line 272, in _session_loop await py_retval File "src/handlers.pxi", line 467, in fuse_write_buf_async len_ = await operations.write(c.fh, c.off, buf) File "/home/hashlo/Degoo/fuse_degoo.py", line 534, in write degoo_id, path, URL = degoo.put(source_file, target_path) File "/home/hashlo/Degoo/degoo/__init__.py", line 1934, in put return put_file(local_path, remote_folder, verbose, if_changed, dry_run, schedule) File "/home/hashlo/Degoo/degoo/__init__.py", line 1841, in put_file degoo_id = api.setUploadFile3(os.path.basename(local_file), dir_id, Size, Checksum) File "/home/hashlo/Degoo/degoo/__init__.py", line 949, in setUploadFile3 "Token": self._get_token(), File "/home/hashlo/Degoo/degoo/__init__.py", line 450, in _get_token deserialized = jwt.decode(self.KEYS["Token"], options={"verify_signature": False, "verify_aud": False}) File "/usr/lib/python3/dist-packages/jwt/api_jwt.py", line 104, in decode self._validate_claims(payload, merged_options, **kwargs) File "/usr/lib/python3/dist-packages/jwt/api_jwt.py", line 134, in _validate_claims self._validate_exp(payload, now, leeway) File "/usr/lib/python3/dist-packages/jwt/api_jwt.py", line 175, in _validate_exp raise ExpiredSignatureError('Signature has expired') jwt.exceptions.ExpiredSignatureError: Signature has expired

i tried your implementation on ubuntu in windows (wsl). There was the refreshing of Token successful and i did the same manually way with the Token as on my native Ubuntu Machine.

Aaa one thing i remember is, that i did install on my wsl following packages because your 'All in One Installation Line' fails at beginning:
python3-venv build-essential python3-dev libpython3-dev

Can you tell me whats the problem maybe here ?

[Bug] Can't read a.txt file

I've uploaded a.txt file into the degoo web ui, the content of a.txt is only 4 characters: jack.
Then I run:
$ python3 fuse_degoo.py
and in a new terminal window I can list the a.txt file:

$ ls -al /home/degoo/Web
total 1
-rw-rw-r-- 1 malcolm malcolm 5 Sep 13 00:53 a.txt

but while I do:

$ cat /home/degoo/Web/a.txt
cat: /home/degoo/Web/a.txt: Transport endpoint is not connected
cat: /home/degoo/Web/a.txt: Transport endpoint is not connected

the first terminal window will show:

$ python3 fuse_degoo.py
Unexpected error:  <class 'requests.exceptions.MissingSchema'>
Traceback (most recent call last):
  File "/home/malcolm/Downloads/test/degoo/degoo_drive/fuse_degoo.py", line 956, in <module>
    main()
  File "/home/malcolm/Downloads/test/degoo/degoo_drive/fuse_degoo.py", line 940, in main
    trio.run(pyfuse3.main)
  File "/home/malcolm/.local/lib/python3.9/site-packages/trio/_core/_run.py", line 1946, in run
    raise runner.main_task_outcome.error
  File "/home/malcolm/.local/lib/python3.9/site-packages/_pyfuse3.py", line 43, in wrapper
    await fn(*args, **kwargs)
  File "src/pyfuse3.pyx", line 781, in main
    _notify_queue.put(None)
  File "/home/malcolm/.local/lib/python3.9/site-packages/trio/_core/_run.py", line 813, in __aexit__
    raise combined_error_from_nursery
  File "/home/malcolm/.local/lib/python3.9/site-packages/_pyfuse3.py", line 43, in wrapper
    await fn(*args, **kwargs)
  File "src/internal.pxi", line 272, in _session_loop
    await py_retval
  File "src/handlers.pxi", line 413, in fuse_read_async
    buf = await operations.read(c.fh, c.off, c.size)
  File "/home/malcolm/Downloads/test/degoo/degoo_drive/fuse_degoo.py", line 430, in read
    self._cache_file(path_file, first_file_part, degoo_file_size)
  File "/home/malcolm/Downloads/test/degoo/degoo_drive/fuse_degoo.py", line 669, in _cache_file
    response = requests.get(url, stream=is_media, headers={
  File "/usr/lib/python3/dist-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 516, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 449, in prepare_request
    p.prepare(
  File "/usr/lib/python3/dist-packages/requests/models.py", line 314, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 388, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'jack\n': No schema supplied. Perhaps you meant http://jack

What's wrong here? The last error is saying: requests.exceptions.MissingSchema: Invalid URL 'jack\n':

unable to build docker image.

Im getting the following error when trying to build docker.

do all the per-requistes need to be install on the docker host?

i thought they were all in the docker image

root@vu18:/home/user# git clone https://github.com/MDKPredator/degoo_drive
Cloning into 'degoo_drive'...
remote: Enumerating objects: 197, done.
remote: Counting objects: 100% (42/42), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 197 (delta 25), reused 29 (delta 22), pack-reused 155
Receiving objects: 100% (197/197), 119.18 KiB | 3.61 MiB/s, done.
Resolving deltas: 100% (95/95), done.
root@vu18:/home/user# cp credentials.json degoo_drive/degoo_config/
root@vu18:/home/user# cp keys.json degoo_drive/degoo_config/
root@vu18:/home/user# cd degoo_drive/
root@vu18:/home/user/degoo_drive# docker build -t degoo_drive .
Sending build context to Docker daemon  464.9kB
Step 1/14 : FROM python:3.8
 ---> d114ab2cf5bc
Step 2/14 : RUN apt-get update     && apt-get install -y --no-install-recommends git     && apt-get install -y pkg-config     && apt-get install -y libfuse3-dev fuse3
 ---> Running in 5542757f4c04
Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8906 kB]
Get:5 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [4732 B]
Get:6 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [57.2 kB]
Fetched 9219 kB in 3s (3539 kB/s)
Reading package lists...
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
The command '/bin/sh -c apt-get update     && apt-get install -y --no-install-recommends git     && apt-get install -y pkg-config     && apt-get install -y libfuse3-dev fuse3' returned a non-zero code: 100

any suggestions

no README.rst

$ python3 setup.py 
Traceback (most recent call last):
  File "setup.py", line 275, in <module>
    main()
  File "setup.py", line 71, in main
    with open(os.path.join(basedir, 'README.rst'), 'r') as fh:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/src/degoo_drive/README.rst'

Sync File or Copy not work anymore?

Hi MDKPredator,

i want to copy via 'cp' or 'rsync' even tried 'pv' a test file. I know that was working in past but now it doesnt. Do you know why ?

Input:
cp /mnt/c/Users/HaShLo/Desktop/tweet_data.csv /home/degoo/Web/test.csv

Output:
`
2022-04-13 12:17:46.327 MainThread: [main] _add_path for 0, /

2022-04-13 12:17:46.327 MainThread: [main] _add_path for 17298707813, /DESKTOP-2QJNG0T

2022-04-13 12:17:46.327 MainThread: [main] _add_path for 17104176302, /Web

2022-04-13 12:17:46.327 MainThread: [main] _add_path for 17298757125, /Xiaomi Mi 10 Pro

2022-04-13 12:17:46.327 MainThread: [main] Mounting...

2022-04-13 12:17:46.330 MainThread: [pyfuse3] Initializing pyfuse3

2022-04-13 12:17:46.330 MainThread: [pyfuse3] Calling fuse_session_new

FUSE library version: 3.9.0

2022-04-13 12:17:46.330 MainThread: [pyfuse3] Calling fuse_session_mount

2022-04-13 12:17:46.333 MainThread: [main] Entering main loop..
2022-04-13 12:17:46.335 MainThread: [pyfuse3] pyfuse-02: No tasks waiting, starting another worker (now 2 total).
unique: 2, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.32
flags=0x03fffffb
max_readahead=0x00020000
INIT: 7.31
flags=0x0041b039
max_readahead=0x00020000
max_write=0x00100000
max_background=0
congestion_threshold=0
time_gran=1
unique: 2, success, outsize: 80
unique: 4, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 281
unique: 4, success, outsize: 120
unique: 6, opcode: LOOKUP (1), nodeid: 1, insize: 44, pid: 281
2022-04-13 12:17:56.931 MainThread: [main] lookup for Web in 1
unique: 6, success, outsize: 144
unique: 8, opcode: LOOKUP (1), nodeid: 17104176302, insize: 55, pid: 281
2022-04-13 12:17:56.937 MainThread: [main] lookup for tweet_data.csv in 17104176302
unique: 8, error: -2 (No such file or directory), outsize: 16
unique: 10, opcode: LOOKUP (1), nodeid: 17104176302, insize: 55, pid: 281
2022-04-13 12:17:56.943 MainThread: [main] lookup for tweet_data.csv in 17104176302
unique: 10, error: -2 (No such file or directory), outsize: 16
unique: 12, opcode: CREATE (35), nodeid: 17104176302, insize: 71, pid: 281
2022-04-13 12:17:56.944 MainThread: [main] _add_path for 80896, /tmp/tweet_data.csv
unique: 12, success, outsize: 160
unique: 14, opcode: GETATTR (3), nodeid: 80896, insize: 56, pid: 281
unique: 14, success, outsize: 120
unique: 16, opcode: GETATTR (3), nodeid: 80896, insize: 56, pid: 281
unique: 16, success, outsize: 120
unique: 18, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 18, success, outsize: 24
unique: 20, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 20, success, outsize: 24
unique: 22, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 22, success, outsize: 24
unique: 24, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 24, success, outsize: 24
unique: 26, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 26, success, outsize: 24
unique: 28, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 28, success, outsize: 24
unique: 30, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 30, success, outsize: 24
unique: 32, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 32, success, outsize: 24
unique: 34, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 34, success, outsize: 24
unique: 36, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 36, success, outsize: 24
unique: 38, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 38, success, outsize: 24
unique: 40, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 40, success, outsize: 24
unique: 42, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 42, success, outsize: 24
unique: 44, opcode: WRITE (16), nodeid: 80896, insize: 131152, pid: 281
unique: 44, success, outsize: 24
unique: 46, opcode: WRITE (16), nodeid: 80896, insize: 865, pid: 281
2022-04-13 12:17:56.978 MainThread: [main] Uploading file [tweet_data.csv] to Degoo path [/Web]
2022-04-13 12:17:56.985 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): production-appsync.degoo.com:443
2022-04-13 12:17:57.448 MainThread: [urllib3.connectionpool] https://production-appsync.degoo.com:443 "POST /graphql HTTP/1.1" 200 None
2022-04-13 12:17:57.450 MainThread: [main] ERROR uploading file [tweet_data.csv]: getBucketWriteAuth4 failed with: Already exist!
unique: 46, success, outsize: 24
unique: 48, opcode: FLUSH (25), nodeid: 80896, insize: 64, pid: 281
unique: 48, error: -38 (Function not implemented), outsize: 16
unique: 50, opcode: RELEASE (18), nodeid: 80896, insize: 64, pid: 0
unique: 50, success, outsize: 16
`

Use adaptive read sizes towards Degoo API

Hi :)
Thanks for creating this.
Is there a way to make the requests to the Degoo API use larger read sizes - or make it more adaptive according to the available throughput? Each time, it makes requests of exactly 262144 bytes, adding a lot of overhead for the individual requests (and actually making the transfer slow).
This is for non-media files.

unique: 94, opcode: READ (15), nodeid: 17013236854, insize: 80, pid: 17
2022-02-08 21:03:38.790 MainThread: [__main__] Hello 6029312 262144
2022-02-08 21:03:38.791 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): c.degoo.media:443
2022-02-08 21:03:40.375 MainThread: [urllib3.connectionpool] https://c.degoo.media:443 "GET /degoo-production-large-file-us-east1.degoo.me/a/b/sh/xxxx&use-cf-cache=true HTTP/1.1" 206 262144
   unique: 94, success, outsize: 262160
unique: 96, opcode: READ (15), nodeid: 17013236854, insize: 80, pid: 17
2022-02-08 21:03:40.384 MainThread: [__main__] Hello 6291456 262144
2022-02-08 21:03:40.386 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): c.degoo.media:443
2022-02-08 21:03:40.840 MainThread: [urllib3.connectionpool] https://c.degoo.media:443 "GET /degoo-production-large-file-us-east1.degoo.me/a/b/sh/xxxx&use-cf-cache=true HTTP/1.1" 206 262144

Keep waiting after comman

Hey MDKPredator,
First of all, I would like to thank you for this project.

I have been trying to get this to working but no luck so far. I was able to use the token request.
After I use fuse_degoo.py, it just keeps on waiting. No progress.

Any suggestions/debugging

/home/degoo doesn't exist after deploying with docker

I deployed this app with docker and I did not get any error message. After cloning, building the image and starting the container it returned back the id of the container, but there is no "degoo" directory in "/home/".

Docker application fails with error even when authenticating using tokens

2022-06-18 03:28:13.802 MainThread: [__main__] ##### Initializating Degoo drive #####
2022-06-18 03:28:13.802 MainThread: [__main__] Local mount point:   /home/degoo
2022-06-18 03:28:13.802 MainThread: [__main__] Cache size:          15728640 kb
2022-06-18 03:28:13.802 MainThread: [__main__] Root Degoo path:     /
2022-06-18 03:28:13.802 MainThread: [__main__] Refresh interval:    600 seconds
2022-06-18 03:28:13.802 MainThread: [__main__] Flood control:       Disabled
2022-06-18 03:28:13.802 MainThread: [__main__] Change hostname:     Disabled
2022-06-18 03:28:13.803 MainThread: [__main__] Search split files:  Disabled
2022-06-18 03:28:13.803 MainThread: [__main__] Mode:                lazy
2022-06-18 03:28:13.803 MainThread: [__main__] Reading Degoo content from directory /
2022-06-18 03:28:13.806 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): production-appsync.degoo.com:443
2022-06-18 03:28:14.078 MainThread: [urllib3.connectionpool] https://production-appsync.degoo.com:443 "POST /graphql HTTP/1.1" 200 None
2022-06-18 03:28:14.080 MainThread: [__main__] _add_path for 0, /
Traceback (most recent call last):
  File "/degoo_drive/fuse_degoo.py", line 959, in <module>
    main()
  File "/degoo_drive/fuse_degoo.py", line 919, in main
    operations.load_degoo_content()
  File "/degoo_drive/fuse_degoo.py", line 794, in load_degoo_content
    self._refresh_path()
  File "/degoo_drive/fuse_degoo.py", line 740, in _refresh_path
    attr = self._get_degoo_attrs(degoo_element['FilePath'])
  File "/degoo_drive/fuse_degoo.py", line 243, in _get_degoo_attrs
    entry.st_ctime_ns = int(element['LastModificationTime']) * 1e9
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Hello, I have built the docker image from the provided instructions by cloning the repository. And I have tried running the application via docker un args providing login and refresh token and also by editing the keys.json file before building my docker image. In both cases, the app crashes and stops with the above error! can you please look into this?

Also, I wanted to reach out in case you needed any help in maintaining the documentation/building docker images and publishing them. I could help! I am interested in this project and have some experience building docker images.

Feature request - Docker-compose image

It would be good to have a docker compose image available so that all we have to do add our mounts to the credentials.json and keys.json and then have the degoo mount in the container mounted to the host.

https://stackoverflow.com/questions/59159241/how-to-map-a-docker-containers-directory-to-the-host-with-docker-compose

I for one dont want to run plex and degoo in the same container i want every thing to be as modular as possible and this will help with that.

I have done some testing and can get it all working except being able to get the degoo mount in the container back to the host.

copying, deleting files

follow on from #12

i have this running in a docker container on ubuntu 20.

i entered the credentials and keys into the relevant files. i can see all files that are in the degoo storage.

if i copy a tiny txt file using cp. the command completes but the file is not in the degoo dir after running ls. I also dont see the file in the webui.

Screenshot 2023-08-15 at 2 50 50 p m

I seen the disclaimer about cp/mv but i dont see any failures in the logs.

where are the logs stored on the container for this as i grepped through /var/log/* but dont see them and i dont see the warn logs when run docker logs --since=1h degoo

docker logs --since=5m degoo | grep -i test-cmd
2023-08-15 13:50:34.873 MainThread: [__main__] lookup for test-cmd.txt in 19804776267
2023-08-15 13:50:34.874 MainThread: [__main__] lookup for test-cmd.txt in 19804776267
2023-08-15 13:50:34.878 MainThread: [__main__] _add_path for 783826, /tmp/degoo/test-cmd.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.