Code Monkey home page Code Monkey logo

uds's Introduction

๐ŸŒŒ UDS : Unlimited Drive Storage

Store files in Google Docs without counting against your quota.

sorry @ the guys from google internal forums who are looking at this

Development on a web-based JS version has started here.

Note: After June 1st 2021, starting June 1, 2021, Google will count Docs, Sheets, Slides, Drawings, Forms and Jamboard files against the user's storage quota.

Features

  • Upload files to Google Drive without using storage space
  • Download any stored files to your computer

Logic

  • Google Docs take up 0 bytes of quota in your Google Drive
  • Split up binary files into Google Docs, with base64 encoded text
  • Size of the encoded file is always larger than the original. Base64 encodes binary data to a ratio of about 4:3.
  • A single google doc can store about a million characters. This is around 710KB of base64 encoded data.
  • Some experiments with multi-threading the uploads, but there was no significant performance increase.

Setup & Authentication

  1. Clone the Repository and setup the requirements pip3 install -r requirements.txt
  2. Head to Google's API page and enable the Drive API
  3. Download the configuration file as 'client_secret.json' to the UDS directory
  4. Run python3 uds.py or ./uds.py for initial set up

UDS Core

Upload

> ./uds.py --push Ubuntu.Desktop.16.04.iso
Ubuntu.Desktop.16.04.iso will required 543 Docs to store.
Created parent folder with ID 1fc6JGpX6vUWiwflL1jBxM1YpuMHFAms8
Successfully Uploaded Ubuntu.Desktop.16.04.iso: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ] 100%
[Layout]
./uds.py --push argument

argument: Path_to_file+file_name

List

> ./uds.py --list
Name                      Size   Encoded    ID
------------------------  -----  ---------  ---------------------------------  
Ubuntu.Desktop.16.04.iso  810 MB  1.1 GB    1fc6JGpX6vUWiwflL1jBxM1YpuMHFAms8
Ubuntu.Desktop.18.10.iso  1.1 GB  1.3 GB    1RzzVfN9goHMTkM1Hf1FUWUVS_2R3GK7D

Also supports searching with a query!

> ./uds.py --list "18"
Name                      Size   Encoded    ID
------------------------  -----  ---------  ---------------------------------  
Ubuntu.Desktop.18.10.iso  1.1 GB  1.3 GB    1RzzVfN9goHMTkM1Hf1FUWUVS_2R3GK7D
[Layout]
./uds.py --list

arguments: query

Download

> ./uds.py --pull 1fc6JGpX6vUWiwflL1jBxM1YpuMHFAms8
Downloaded Ubuntu.Desktop.16.04.iso: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ] 100%
[Layout]
./uds.py --pull argument

argument: id_of_file

Delete

> ./uds.py --delete 1fc6JGpX6vUWiwflL1jBxM1YpuMHFAms8
Deleted 1fc6JGpX6vUWiwflL1jBxM1YpuMHFAms8
[Layout]
./uds.py --delete argument

argument: id_of_file

Alpha Extensions

Grab

> ./uds.py --grab test.7z
Update Successful!
Downloaded test.7z: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ] 100%
[Layout]
./uds.py --grab argument

argument: name_of_file

Erase

>./uds.py --erase test2.7z
Update Successful!
Deleted test2.7z
[Layout]
./uds.py --erase argument

argument: name_of_file

Update

> ./uds.py --update

Name       Encoded   Size 
---------  --------  -----
file_name  1.1 GB    810 MB 

"User.txt"
Name       Encoded   Size 
---------  --------  -----
file_name  1.1 GB    810 MB 

"data.txt"
{
   "file0": "1fc6JGpX6vUWiwflL1jBxM1YpuMHFAms8"
   "file2": "1fc6JGpX6vUWiwflL1jBxM1YpuMHFAms9"
}
[Layout]
./uds.py --update

arguments: None

Bulk Extensions

Bunch

> ./uds.py --bunch test
test.7z.1 will require 1337 Docs to store.
Created parent folder with ID 1fc6JGpX6vUWiwflL1jBxM1YpuMHFAm12
Successfully Uploaded test.7z.1: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ] 100%
test.7z.2 will require 1337 Docs to store.
Created parent folder with ID 1fc6JGpX6vUWiwflL1jBxM1YpuQQFAm12
Successfully Uploaded test.7z.2: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ] 100%
test.7z.3 will require 600 Docs to store.
Created parent folder with ID 1fc6JGpX6vTOiwflL1jBxM1YpuQQFAm12
Successfully Uploaded test.7z.3: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ] 100%
[Layout]
./uds.py --bunch argument[1] argument[2]

argument[1]: name_in_files, or wildcard "?" without quotes
argument[2]: directory, default is current directory of UDS

Batch

> ./uds.py --batch file_name
Update Successful!
Downloaded file_name.7z.1: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ] 100%
Downloaded file_name.7z.2: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ] 100%
Downloaded file_name.7z.3: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ] 100%
[Layout]
./uds.py --batch argument

arguments: name_in_files, or wildcard "?" without quotes

Wipe

> ./uds.py --wipe file
Update Successful!
Deleted file.7z.1
Deleted file.7z.2
Deleted file.7z.3
[Layout]
./uds.py --wipe argument

arguments: name_in_files, or wildcard "?" without quotes

Only Compatible with Python 3.

uds's People

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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uds's Issues

table of User.txt

Without wcwidth , table of my User.txt couldn't be aligned correctly.

Before installing wcwidth :
image

After :
image

Base64 Conversion

Is there any alternative base64 encoder?

I have a 12Core 18GB ECC RAM server(Scalable to 256GB). I have access to it for 1 month. I am trying to upload a 120 GB backup data to my own personal Gmail account. The upload process is very slow.
Is there a fix?

Uploading Folders

I was going to expand off of this issue but I'm not entirely sure what it meant. One idea I had was giving the ability to upload a folder that would go through and upload all files within that folder. Below I added an image where say I am wanting to upload Folder1 that has 3 files and a folder underneath it. In that same picture I have also the layout of how it could look on the actual google drive. So for File1, on GD, the file would be a folder and the bytes that make that file would be google docs like you have for single file uploads. When you download it, it would recreate that same folder structure. Note that the words in Blue are folders and red is either the file or a google doc. Let me know what you think.

image

Also, I am thinking of creating a gui using Tkinter to build off of what you have made, would you be fine if I did such thing?

Where are the files located in drive? Storing files in folders? Sharing files? Working offline?

I managed to upload my first file using the tool, but when I check the drive web interface, it doesn't show any files anywhere except the recent section.

Is there a way to view/organise the files in the drive into folders? So each group of files making up a file can be in it's own folder, so it can be shared?

Does UDS have a function to work with a shared folder to download & convert a file from the google docs back to the original?

Alternatively if someone downloaded all of the base64 files, can UDS be put to work on the files to convert it back into the original file offline?

I know it's a bunch of different questions, just what's coming to mind. You're definitely onto something here.

Mount as a drive?

So I've just stumbled on this and I'm wondering if you've considered adding a feature to mount the google docs filesystem as a drive? I understand this would be difficult for performance reasons as well as the significant amount of work that would be required to implement such a feature but I'm curious to see if you've considered anything like this.

audio

On small think. Is possible to store audio file with password/gpg?
For example I put my all soundfile and can listen in any place.

player audio and password are critical.

"Unlimited"?

Hi,
How is it going to be unlimited?
I think, google docs are still being counted in the 15GB space that a user get?

Increase Upload Speed

Would it be possible to increase the upload and download speeds that can be obtained when using this project? I have noticed that download speeds are better than upload speeds, but are still rather slow.

Can't run initial setup

Traceback (most recent call last):
File "uds.py", line 533, in
main()
File "uds.py", line 426, in main
uds = UDS()
File "uds.py", line 50, in init
self.api = GoogleAPI()
File "/Users/pantuts/Apps/uds/API.py", line 31, in init
self.reauth()
File "/Users/pantuts/Apps/uds/API.py", line 37, in reauth
creds = store.get()
File "/Users/pantuts/Library/Python/3.7/lib/python/site-packages/oauth2client/client.py", line 407, in get
return self.locked_get()
File "/Users/pantuts/Library/Python/3.7/lib/python/site-packages/oauth2client/file.py", line 54, in locked_get
credentials = client.Credentials.new_from_json(content)
File "/Users/pantuts/Library/Python/3.7/lib/python/site-packages/oauth2client/client.py", line 302, in new_from_json
module_name = data['_module']
KeyError: '_module'

Delete shows help list without deleting

Attempted to delete a file from UDS drive, however, instead of deleting the file with its ID spelled correctly, it instead listed the help menu, as though I just typed in "python uds.py" without any arguments.

After looking at the code it appears that "delete" was never implemented. It's in the file but there is no menu option (however there is a "convert" menu option instead but it does something totally different).

Not a UDS File

I have been making a secondary script to pull, push and delete files. It seemed to work alright but I encountered an error. When falling back to the normal UDS the same error still occurred. I uploaded the files using a simple script (all it did was call "python3 uds.py push file_to_push". The upload completed successfully and since it was a test file, it was very small. Upon running "delete" in the script "script.py delete file_name" it was meant to delete the file by pulling the id from a library, calling "python3 uds.py delete file_id". After running both the script and the normal uds it stated the file was not a UDS file and could not delete it.

This would mean that UDS can push a file but be unable to interact with it afterwards... what could be the issue?

tqdm arguments issue

Everything installed and initialized correctly, however, when I try to push a file I get an error that appears to be stemming from tqdm not recognizing the position argument. Not sure if this is an issue with the version of tqdm I'm using (2.2.3).

is it possible to store the uds file inside the google itself?

acording to your code,if i understand ir right,it need an file to say how the script will build the uploaded file,it is possible to just put this info inside the google spreadsheet and just access this when it runs? like,the file have to be inside the specific google drive location and have specific name,and then using this logic is just necessary to redownload the configuration json and the repository,so it will be avaliable easier when you is not in your own machine

googleapiclient :: missing module

Traceback (most recent call last):
File "uds.py", line 3, in
from googleapiclient.discovery import build
ModuleNotFoundError: No module named 'googleapiclient'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in
import apt
File "/usr/lib/python3/dist-packages/apt/init.py", line 23, in
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
File "uds.py", line 3, in
from googleapiclient.discovery import build
ModuleNotFoundError: No module named 'googleapiclient'

Tried every trick in the books, even in your past issues and any stack overflow answers to similar issues to no avail. :/

Replace oauth2client with google-auth

Is your feature request related to a problem? Please describe.
oauth2client is deprecated. We should use its long-term replacement: https://github.com/googleapis/google-auth-library-python. Also this might fix #12

Describe the solution you'd like
https://developers.google.com/drive/api/v3/quickstart/python describes how https://github.com/googleapis/google-auth-library-python-oauthlib can replace oauth2client.

Describe alternatives you've considered
We can utilize having the credential file path be set via an environment variable via service_account.Credentials.from_service_account_file, or have the credential json string loaded explicitly via service_account.Credentials.from_service_account_info.

https://google-auth.readthedocs.io/en/latest/user-guide.html#service-account-private-key-files

Additional context
https://google-auth.readthedocs.io/en/latest/oauth2client-deprecation.html

This issue mostly affects how to migrate api.py. If we look at google_auth_oauthlib, for instance, credentials.invalid has been replaced by credentials.valid, client.flow_from_clientsecrets() is replaced by InstalledAppFlow.from_client_secrets_file(), tools.run_flow() is somewhat replaced by tools.run_console() and tools.run_local_server().

Encryption and chunk file read

Hi, i think that this is a very smart idea, I have some possible enhancements for you:

  1. reading and computing file in chunks
  2. adding AES encryption (in CBC mode)

To be more specific I would read the file in blocks long as the size of a page, then I would encrypt the block and upload it on Google documents (as a page)

A very simple example:

with open(path, 'rb') as f:
    for chunk in iter(lambda: f.read(4096), b''):
        enc = encrypt_fx (chunk)
        upload_page_fx (enc)

Let me know what you think.

Invalid Syntax Line 219

At first I had a error "Syntax Error: Non-ASCII Character '/ex2' in file uds.py on line 183, but no encoding declared".

I added # -*- coding: utf-8 -*- to the top and that fixed that error.

The second error I am having is "File "uds.py", line 219 path = f"{get_downloads_folder()}/{metadata['name']}"^.

I attached screen shots.

First error : https://imgur.com/MFmWwvP

Second error : https://imgur.com/CQXrc4T

win10 error

when i run python uds.py ,error :
$ python uds.py
Traceback (most recent call last):
File "uds.py", line 533, in
main()
File "uds.py", line 426, in main
uds = UDS()
File "uds.py", line 50, in init
self.api = GoogleAPI()
File "D:\develop\running\workspace_python\uds\API.py", line 31, in init
self.reauth()
File "D:\develop\running\workspace_python\uds\API.py", line 37, in reauth
creds = store.get()
File "C:\Users\linyu\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client\client.py", line 407, in get
return self.locked_get()
File "C:\Users\linyu\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client\file.py", line 54, in locked_get
credentials = client.Credentials.new_from_json(content)
File "C:\Users\linyu\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client\client.py", line 302, in new_from_json
module_name = data['_module']
KeyError: '_module'

Questions

Hello i have fews question:

  • where do you read docs are not count in quota?
  • how many upload size could you hope in 1 day? 500go?

KeyError: '_module'

$ python uds.py list
Traceback (most recent call last):
  File "uds.py", line 397, in <module>
    main()
  File "uds.py", line 352, in main
    creds = store.get()
  File "C:\Program Files\Python36\lib\site-packages\oauth2client\client.py", line 407, in get
    return self.locked_get()
  File "C:\Program Files\Python36\lib\site-packages\oauth2client\file.py", line 54, in locked_get
    credentials = client.Credentials.new_from_json(content)
  File "C:\Program Files\Python36\lib\site-packages\oauth2client\client.py", line 302, in new_from_json
    module_name = data['_module']
KeyError: '_module'

installed all modules with 'pip install -r requirements.txt'
python 3.6

i generated a credentials.json from the linked google api page and downloaded it to the uds directory. this gave me an error so i renamed it to client_secrets.json like the readme suggests. am i doing something wrong? or it looks like oauth2client has problems? maybe i generated my credentials files wrong since it doesnt contain '_module'?
pls help

[BUG]uploaded but no uds found

proxychains python3 uds.py --push api.py

100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 1/1 [00:05<00:00, 5.75s/chunks] 00%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 750k/750k [00:05<00:00, 130kB/s]

proxychians python3 uds.py -l query

No UDS files found.
no further error message

Using on mac, invalid syntax error, line 226

I've successfully installed all the things I need to from requirements.txt, I've made sure the Python version I'm running allows for "f" lines (it's 3.7.1), but I'm still getting a syntax error:

File "uds.py", line 226
path = f"{get_downloads_folder()}/{metadata['name']}"

Any help would be appreciated.

[BUG] can not push a file

Describe the bug
After authorization, I start push a file but end with an "Key error : '_module' ".

To Reproduce
Steps to reproduce the behavior:

  1. Go to uds folder, run cmd
  2. Run python uds.py push C:\Users\captain\Downloads\ebook.zip

Expected behavior
At first, I guess it may lose some packages during installation, so I manually install these according to the โ€œrequirement.txtโ€ file, However same results fail me again.

Screenshots
If applicable, add screenshots to help explain your problem.
image

System Information
Python Version: 3.7.3
OS: Windows 7
Anything that may help : use with proxy

Multi File Support

It would be really useful if a user could add a star (much like linux) to select all files in a dir :)
Just a suggestion

error with line 16 (import urllib.request)

Have installed the requirements prior to running uds.py, when I do, I'm met with the following error (on ubuntu 18.04).

File "uds.py", line 16, in <module> import urllib.request ImportError: No mobule named request

Considering I'm the first to post this, I'm assuming there must be something I've missed installing. I've gone through and installed python-urllib3 aswell as python3-urllib3 (which reports as up to date, so assuming it's two different names for the same thing).

Any suggestions on what to try next?

Pull bug?

After pushing files smaller than 4KB ,
I want to pull these files to check if they were corrupted or not.
And I found that there was bug when pulling files smaller than approximately 4KB. (original size)

Here are the error messages :
Failed to verify hash ,
Downloaded file had hash %s compared to original %s ('e3b0c4429', '99d00379f')

By the way, all the files larger than 4KB I pulled didn't have the hash problem.

GUI around the tool

Beautiful idea! I'm not sure how long this will last, but do you think it's worth building a GUI around your cli? It will include the flow of authorising with google drive and then have a tray icon with folder watching like the dropbox app :)

I'm thinking of making a start on this. What do you think?

File "uds.py", line 545, in <module>

was working just fine then this happened tried deleting everything and re download the program and tried different google account
E:\download\uds-master>python uds.py
Traceback (most recent call last):
File "uds.py", line 545, in
main()
File "uds.py", line 438, in main
uds = UDS()
File "uds.py", line 49, in init
self.api = GoogleAPI()
File "E:\download\uds-master\API.py", line 31, in init
self.reauth()
File "E:\download\uds-master\API.py", line 37, in reauth
creds = store.get()
File "C:\Users\pc\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client\client.py", line 407, in get
return self.locked_get()
File "C:\Users\pc\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client\file.py", line 54, in locked_get
credentials = client.Credentials.new_from_json(content)
File "C:\Users\pc\AppData\Local\Programs\Python\Python37\lib\site-packages\oauth2client\client.py", line 302, in new_from_json
module_name = data['_module']
KeyError: '_module'

Issue running initial setup

Hello,

I am having an issue running the following command: python uds.py

I have made sure to install the requirements and have imported my credentials as the requested filename.. Am I missing something?

Here is my error:

File "uds.py", line 60
    print("", end='')
                 ^
SyntaxError: invalid syntax

Delete not working?

My internet connection died in the middle of uploading, so the file did not get uploaded properly, but I can still see it when i run uds.py list. So i then run uds.py delete [file_id], but it just returns the uds.py help menu, and when i run list again, the file is still there.

Could anyone help me understand wether there's anything I am doing wrong?

Undefined names in Encoder.py

Undefined names have the potential to raise NameError at runtime.

flake8 testing of https://github.com/stewartmcgown/uds on Python 3.7.1

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./Encoder.py:6:15: F821 undefined name 'default_backend'
    backend = default_backend()
              ^
./Encoder.py:9:14: F821 undefined name 'Cipher'
    cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=backend)
             ^
./Encoder.py:9:21: F821 undefined name 'algorithms'
    cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=backend)
                    ^
./Encoder.py:9:42: F821 undefined name 'modes'
    cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=backend)
                                         ^
./Encoder.py:15:17: F821 undefined name 'cipher'
    decryptor = cipher.decryptor()
                ^
./Encoder.py:16:22: F821 undefined name 'ct'
    decryptor.update(ct) + decryptor.finalize()
                     ^
6     F821 undefined name 'default_backend'
6

[BUG] Google Login?

Describe the bug
Downloaded client_secret.json, it is showing me some Google Login Screen..

Expected behavior
It is uploading files when using push but instead it is asking for credentials.json and uds.py is showing me the screen below.

System Information
Python Version 3.5.3, OS Debian 9.9

image

Add a working folder structure

In order to keep the files more organised, it would make sense to have files organised by folder remotely. The lister should be able to browse remote directories and return IDs to be downloaded.

Chunk Part Folders
{ type: "udsFile", size: int }

Chunk Part
{ type: "udsChunkPart", part: int }

Use Google Photos

I don't know how much more efficient this may be, but if you choose to upload your Photos not in their original size, Google Photos offers you to store them without taking space from your quota.

There are many different ways this can be used, be it uploading extra tiny 1x1px images with tons of meta-data, or using QR code like encoding.

Just my 2ยข ๐Ÿ™

[BUG] ValueError: mmap length is too long

Describe the bug
uds.py fails to upload a 3GB .tar

To Reproduce
Steps to reproduce the behavior:

  1. Run python3 uds.py push /mnt/sda/archive.tar
  2. Observe this error:
 python3 uds.py push /mnt/sda/archive.tar 
Traceback (most recent call last):
  File "uds.py", line 545, in <module>
    main()
  File "uds.py", line 466, in main
    uds.do_chunked_upload(file_path)
  File "uds.py", line 194, in do_chunked_upload
    self.upload_chunked_part(chunk)
  File "uds.py", line 138, in upload_chunked_part
    mm = mmap.mmap(fd.fileno(), 0, access=mmap.ACCESS_READ)
ValueError: mmap length is too large

Expected behavior
uds.py uploads the archive

Screenshots

[none, because... it's a cli program]

System Information

pi@danpi:~ $ python3 --version
Python 3.5.3
pi@danpi:~ $ uname --all
Linux danpi 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux

Missing variables in uds.py

from lines 212 and 216 of uds py:

    try:
        p = service.properties().insert(
            fileId=id, body=body).execute()
        return p
    except error:
        print('An error occurred: %s' % error)

both service (I think) and error do not exist in the block's scope

Typo in readme file

Under UDS Core/Upload, you have psuh instead of push. See below.

Upload

python uds.py push Ubuntu.Desktop.16.04.iso
Ubuntu.Desktop.16.04.iso will required 543 Docs to store.
Created parent folder with ID 1fc6JGpX6vUWiwflL1jBxM1YpuMHFAms8
Successfully Uploaded Ubuntu.Desktop.16.04.iso: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ] 100%
[Layout]
python uds.py psuh argument

argument: Path_to_file+file_name

Thoughts

Why base64 and doc when we could embed images inside any document?
How about fuse to make things easier?

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.