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

File skipping with (-d) isn't working and reuploads the file #101

Closed
Anon-Exploiter opened this issue Aug 10, 2020 · 20 comments
Closed

File skipping with (-d) isn't working and reuploads the file #101

Anon-Exploiter opened this issue Aug 10, 2020 · 20 comments

Comments

@Anon-Exploiter
Copy link

Hi,

Thanks for the awesome script, wasn't able to find shared drive uploading functionality in many overrated scripts.

I just noticed that -d is supposed to skip the file if it is uploaded already but that doesn't happen (I'm sure that's the intended functionality), the script creates a new file regardless of the file existing and this will happen as many times as we execute the command.

Here are some screenshots to help explain the issue.

Uploading:

image

POC:

image


Environment:

OS: Ubuntu 18.04 LTS
Uploading to: Google Shared Drive

Let me know if further information is required to reproduce the issue.

@Anon-Exploiter
Copy link
Author

Another file with some data in it (in case there is any check of size of files):

image

@Akianonymus
Copy link
Collaborator

Akianonymus commented Aug 11, 2020

Weird, it works just fine here

❯  gupload -p 1 -V -v -R 5 test -d -c test                 
================[ Workspace Folder: test ]=================
------------ ********************************* ------------

===================[ Given Input: FILE ]===================
=============[ Upload Method: Skip Existing ]==============

======================[ test | 0 B ]=======================
----------------------[ Uploading.. ]----------------------
  % Total     % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:-  0     0    0     0    0     0      0      0 --:--:-- --:-100   117  100   117    0     0    105      0  0:00:01  0:00:01 --:--:--   105
=================[ test | 0 B | Uploaded ]=================
-----------------------[ DriveLink ]-----------------------
                           ^ ^ ^
https://drive.google.com/open?id=*******

========= Time Elapsed: 0 minute(s) and 4 seconds =========

~
❯  gupload -p 1 -V -v -R 5 test -d -c test
================[ Workspace Folder: test ]=================
------------ ******************************** ------------

===================[ Given Input: FILE ]===================
=============[ Upload Method: Skip Existing ]==============

=================[ test already exists. ]==================
-----------------------[ DriveLink ]-----------------------
                           ^ ^ ^
https://drive.google.com/open?id=********

========= Time Elapsed: 0 minute(s) and 1 seconds ========

One more thing, that your DriveLink is not showing after upload and it's not doing the pretty logging ( as in the above log ).

Anyway, run below commands and give me the log1 and log2 file
( upload in some paste site or gist )

printf "" >> test123test
gupload test123test -o -D &> log1
gupload test123test -d -D &> log2

for i in log1 log2; do
    values="$(grep -oE "(CLIENT_ID|CLIENT_SECRET|REFRESH_TOKEN|ACCESS_TOKEN|ROOT_FOLDER|WORKSPACE_FOLDER_ID)=.*" "${i}")"
    eval "${values}"

    for j in CLIENT_ID CLIENT_SECRET REFRESH_TOKEN ACCESS_TOKEN ROOT_FOLDER WORKSPACE_FOLDER_ID; do
         string="$(eval printf "%s" \"\$"${j}"\")"
        sed "s|${string}|"*****"|g" -i "${i}"
    done
done

@Anon-Exploiter
Copy link
Author

Yeah, I noticed the pretty-printing isn't happening either. Here are the log files

Log1: https://del.dog/raw/ivuyriphai
Log2: https://del.dog/raw/bawifogohu

It again uploaded both files on shared google drive.

image

@Akianonymus
Copy link
Collaborator

Yeah, I noticed the pretty-printing isn't happening either. Here are the log files

Log1: https://del.dog/raw/ivuyriphai
Log2: https://del.dog/raw/bawifogohu

It again uploaded both files on shared google drive.

image

So, it is not able to search files, probably because of team drive

i pushed some fixes, run below command to pull the fixes and try again

curl --compressed -s https://raw.githubusercontent.com/labbots/google-drive-upload/master/install.sh | sh -s -- -B wip

@Anon-Exploiter
Copy link
Author

Hi,

Reinstalled using the above command and it is still the same. Here are some POCs regarding that:

Reinstallation (after updating once):

image

Uploading:

image

On Gdrive:

image

@Anon-Exploiter
Copy link
Author

@Akianonymus maybe the commits weren't pushed?

The file shows it was updated 2 days ago (from the master branch):

image

@Anon-Exploiter
Copy link
Author

Also, the last commit was 8 hours ago:

image

@Akianonymus
Copy link
Collaborator

curl --compressed -s https://raw.githubusercontent.com/labbots/google-drive-upload/master/install.sh | sh -s -- -B wip

If you look closely, -B flag is used, which fetches the installation from branch, in this case, will be wip ( i pushed the changes to wip branch ).

anyway, try again, i forgot to push a local change.

@Akianonymus
Copy link
Collaborator

Also, provide the logs again if it doesn't work.

@Anon-Exploiter
Copy link
Author

My bad, I just looked at the first part.

Here's the logs, the issue is still not fixed:

Log1: https://del.dog/raw/pestucyfoh
Log2: https://del.dog/raw/afuthester

@Akianonymus
Copy link
Collaborator

@Anon-Exploiter Update and try again, should be working this time ( i tested my self on a team drive ).

@Anon-Exploiter
Copy link
Author

Anon-Exploiter commented Aug 11, 2020

@Akianonymus, it's still the same, here are the logs.

Log1: https://del.dog/raw/odubighucr
Log2: https://del.dog/raw/mehestuned

POC:

image

@Akianonymus
Copy link
Collaborator

Akianonymus commented Aug 11, 2020

@Anon-Exploiter Hmm, alright, i wonder why it's still same.

Tell me exactly how you did the initial setup. Specifically the details related to the team drive stuff and root dir setup.

This is what i did.

I just created a shared drive, made a folder, and used it as root folder. -d flag was not working, but after the fix i applied, it started.

( are you on telegram ? conversation would be much easier there, no push though, here is fine too, just this bug is bugging me 😂 and i wanna fix it fast )

@Anon-Exploiter
Copy link
Author

@Akianonymus hahaha, yeah sure. Same here, I almost consumed 500GB+ upload depending on the skip flag 😅

I'm on discord: Umar_0x01#0079

Let me try the latest commit you've done as well.

Also, I can give you contributor access to my shared drive for testing xD Let's continue it in discord.

@Anon-Exploiter
Copy link
Author

Also, for the initial installation, I used the one-liner from here:
https://github.com/labbots/google-drive-upload#basic-method

I've created a Ubuntu 18.04 LTS instance on AWS and am testing on that since. Details:

~$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

@Anon-Exploiter
Copy link
Author

Here's the .googledriveconf global configuration.

image

@Akianonymus
Copy link
Collaborator

@Anon-Exploiter Check discord.

@Anon-Exploiter
Copy link
Author

Done, added.

@Akianonymus
Copy link
Collaborator

A new release is created: https://github.com/labbots/google-drive-upload/releases/tag/v3.3.1

@Anon-Exploiter
Copy link
Author

Thanks for the support, works fine now! 🕺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants