yi-hack-v5 icon indicating copy to clipboard operation
yi-hack-v5 copied to clipboard

[Feature Request] Nextcloud / GDrive / Rsync Upload.

Open Minims opened this issue 3 years ago • 23 comments

Hi,

First I would like to thank you for this v5 ! It's really cool.

I saw I can already use FTP to upload videos on a server, but is it possible to add at least one a this option ?

  • Google Drive Upload : like this for example : https://github.com/roleoroleo/yi-hack-Allwinner.gdrive
  • NextCloud Upload, via Webdav
  • Or simply rsync to a server with speed limiting.

This seems more secure to me than FTP. rsync would be the best for me I think.

Thanks !

Minims avatar May 28 '21 15:05 Minims

The google drive upload option would be amazing if possible!

silly-questions avatar Jun 06 '21 19:06 silly-questions

I might look into it later this month.

alienatedsec avatar Jun 11 '21 12:06 alienatedsec

@alienatedsec just having the rsync binary would be very appreciated. Thanks for this hack

borodiliz avatar Jul 26 '21 09:07 borodiliz

please include this service xiaomi_gdrive

nelutzu777 avatar Oct 27 '22 09:10 nelutzu777

Hi, Any news on the GDrive update? Thanks!!!

n1ckh3ll avatar Mar 01 '23 10:03 n1ckh3ll

Hi,

I just replaced all calls to ftpput in ftppush.sh with calls to curl via the Nextcloud WebDAV interface.

It reuses the variables from the FTP configuration.

Only problem is that the curl binary distributed with yi-hack-v5 does not support https.

/home/yi-hack-v5 # curl --version
curl 7.86.0-DEV (arm-hisiv300-linux-gnu) libcurl/7.86.0-DEV
Release-Date: [unreleased]
Protocols: dict file ftp gopher http imap mqtt pop3 rtsp smtp telnet tftp 
Features: alt-svc AsynchDNS IPv6 Largefile UnixSockets

Nextcloud_WebDAV.patch

outermedia-cbo avatar Mar 22 '23 14:03 outermedia-cbo

@outermedia-cbo I can include the library supporting https (I think I got that ready somewhere) or you could test with this version https://github.com/roleoroleo/yi-hack-utils/blob/main/v5/curl.tgz for now

alienatedsec avatar Mar 22 '23 14:03 alienatedsec

It needs more:

/tmp # ./curl --version
./curl: can't load library 'libssl.so.1.1'

So I added https://github.com/roleoroleo/yi-hack-utils/blob/main/v5/libopenssl.tgz

The certificates are out of date or not present:

curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Anyway curl -k https://github.com works. That is good enough for now.

Thank you!

outermedia-cbo avatar Mar 22 '23 14:03 outermedia-cbo

Hi. I insist on this option and I will explain why. I have 4 YIcam. I created 4 Gdrive accounts and in each one a folder named Cam1, Cam2, Cam3, Cam4. Each IPcam records on the account/folder. Now I SHARE those 4 folders to my basic account. So I have access from my phone/PC to all the recordings, and Google automatically sorts them chronologically. The free and convenient method, easy to configure... I used this for years until Google made an update with Auth2.0 Error 401 @outermedia-cbo @alienatedsec @roleoroleo @porunov @avengermsoft @denven Thank you for your time

nelutzu777 avatar Apr 25 '23 14:04 nelutzu777

Hi. I insist on this option and I will explain why. I have 4 YIcam. I created 4 Gdrive accounts and in each one a folder named Cam1, Cam2, Cam3, Cam4. Each IPcam records on the account/folder. Now I SHARE those 4 folders to my basic account. So I have access from my phone/PC to all the recordings, and Google automatically sorts them chronologically. The free and convenient method, easy to configure... I used this for years until Google made an update with Auth2.0 Error 401 @outermedia-cbo @alienatedsec @roleoroleo @porunov @avengermsoft @denven Thank you for your time

Hi, @nelutzu777, I noticed you mentioned me twice to maintain gdrive code.

  • which gdrive uploader repo program are you using,
  • have you tried yi-hack-MStar.gdrive?
  • and what are the camera folders and video file names like, since I only have one Yi camera used which has the following recorded file structure? are they the same as the following?

image

and if you are a onedrive user, you can also try yihack-onedrive-uploader which I am recently maintaining and works well.

denven avatar Apr 26 '23 06:04 denven

Hi. I insist on this option and I will explain why. I have 4 YIcam. I created 4 Gdrive accounts and in each one a folder named Cam1, Cam2, Cam3, Cam4. Each IPcam records on the account/folder. Now I SHARE those 4 folders to my basic account. So I have access from my phone/PC to all the recordings, and Google automatically sorts them chronologically. The free and convenient method, easy to configure... I used this for years until Google made an update with Auth2.0 Error 401 @outermedia-cbo @alienatedsec @roleoroleo @porunov @avengermsoft @denven Thank you for your time

Hi, @nelutzu777, I noticed you mentioned me twice to maintain gdrive code.

  • which gdrive uploader repo program are you using,
  • have you tried yi-hack-MStar.gdrive?
  • and what are the camera folders and video file names like, since I only have one Yi camera used which has the following recorded file structure? are they the same as the following?

image

and if you are a onedrive user, you can also try yihack-onedrive-uploader which I am recently maintaining and works well.

I have 4 IPcams of this model: Yi 1080p Home | rootfs_y20 | home_y20 I use TheCrypt0/yi-hack-v4 in tandem avengermsoft/xiaomi_gdrive And everything worked perfectly until the moment when GOOGLE made changes with "Google OAuth2 changes of OOB causes drive API authorization failure". I tried all gdrive_loader on github and none of them work. The authorization code does not work. @avengernsoft gdrive_loader works, but only for a few days and I get an invalid token error and it needs to be updated once every few days.

nelutzu777 avatar Apr 26 '23 07:04 nelutzu777

Hi. I insist on this option and I will explain why. I have 4 YIcam. I created 4 Gdrive accounts and in each one a folder named Cam1, Cam2, Cam3, Cam4. Each IPcam records on the account/folder. Now I SHARE those 4 folders to my basic account. So I have access from my phone/PC to all the recordings, and Google automatically sorts them chronologically. The free and convenient method, easy to configure... I used this for years until Google made an update with Auth2.0 Error 401 @outermedia-cbo @alienatedsec @roleoroleo @porunov @avengermsoft @denven Thank you for your time

Hi, @nelutzu777, I noticed you mentioned me twice to maintain gdrive code.

  • which gdrive uploader repo program are you using,
  • have you tried yi-hack-MStar.gdrive?
  • and what are the camera folders and video file names like, since I only have one Yi camera used which has the following recorded file structure? are they the same as the following?

image

and if you are a onedrive user, you can also try yihack-onedrive-uploader which I am recently maintaining and works well.

4y 3y 2y 1y

I apologize for mentioning YIhack V4 a lot, but I would like to switch to YIhack V5 + GDrive_Loarer

nelutzu777 avatar Apr 26 '23 07:04 nelutzu777

@denven /home/yi-hack-v5 # cd /tmp/sd/ /tmp/sd # sh yi-hack/gdrive/GDriveConf Configuration is started. Wait for several seconds. Enter your Client ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com Enter your Client secret: xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxx-RX

Put this link into your browser: https://accounts.google.com/o/oauth2/v2/auth?scope=https://www.googleapis.com/auth/drive&state=state&redirect_uri=http://127.0.0.1&response_type=code&client_id=00000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&access_type=offline

Copy and paste your code here: 4/0AVHEtk5X-eXXXXXXXXXXXHbsi1UGQdF5D1ZS2kXXXXXXXXXXXXXXXXXn4N6WxJPMT03eh7I7l-g /tmp/sd/yi-hack/bin/./curl: line 1: syntax error: unexpected word (expecting ")") grep: /tmp/sd/yi-hack/gdrive/conf/response: No such file or directory grep: /tmp/sd/yi-hack/gdrive/conf/response: No such file or directory Your code was expired or it is not correct. Please refresh a link in your browser and enter a new valid code:

nelutzu777 avatar Apr 26 '23 09:04 nelutzu777

@denven /home/yi-hack-v5 # cd /tmp/sd/ /tmp/sd # sh yi-hack/gdrive/GDriveConf Configuration is started. Wait for several seconds. Enter your Client ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com Enter your Client secret: xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxx-RX

Put this link into your browser: https://accounts.google.com/o/oauth2/v2/auth?scope=https://www.googleapis.com/auth/drive&state=state&redirect_uri=http://127.0.0.1&response_type=code&client_id=00000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&access_type=offline

Copy and paste your code here: 4/0AVHEtk5X-eXXXXXXXXXXXHbsi1UGQdF5D1ZS2kXXXXXXXXXXXXXXXXXn4N6WxJPMT03eh7I7l-g /tmp/sd/yi-hack/bin/./curl: line 1: syntax error: unexpected word (expecting ")") grep: /tmp/sd/yi-hack/gdrive/conf/response: No such file or directory grep: /tmp/sd/yi-hack/gdrive/conf/response: No such file or directory Your code was expired or it is not correct. Please refresh a link in your browser and enter a new valid code:

please check https://github.com/roleoroleo/yi-hack-MStar.gdrive/issues/14#issuecomment-1529491682

denven avatar May 01 '23 09:05 denven

https://github.com/roleoroleo/yi-hack-utils/

Hi, @roleoroleo i'm trying to use this binary but segmentation fault happen on Yi Home 47US, can you provide a guide to build module from scracth or provide curl binary that support https in Yi Home 47US. I'm on my way to create script for uploading recorded video to telegram.

raffifu avatar Jun 01 '23 13:06 raffifu

segmentation fault happen on Yi Home 47US

@raffifu A screenshot or more details like which firmware is used could be beneficial

alienatedsec avatar Jun 01 '23 13:06 alienatedsec

segmentation fault happen on Yi Home 47US

@raffifu A screenshot or more details like which firmware is used could be beneficial

Step to reproduce

  1. Download https://github.com/roleoroleo/yi-hack-utils/blob/main/v5/curl.tgz
  2. Extract and copy libcurl.so* to /tmp/sd/yi-hack-v5/lib
  3. Copy curl binary to /tmp/sd/tmp
  4. Run get the error as screenshot below

Screenshot

image

Firmware: yi_home_0.3.7 Device: Yi Home 47US

raffifu avatar Jun 01 '23 13:06 raffifu

Sorry for the late reply. Did you copy libopenssl libraries to /tmp/sd/yi-hack-v5/lib ? Please pay attention to the symbolic links. FAT32 doesn't support synlinks, so you have to copy the library 3 times with 3 names: *.so *so.X and *.so.X.Y

roleoroleo avatar Jan 24 '24 18:01 roleoroleo

@roleoroleo FYI, to avoid the curl issue, probably getting a standalone curl program whose version is compitable with the hardware architecture is better than the one which has dependencies on the libs, and set the curl path into global env. I ran into the simmilar issues in the past, and I am using this curl version, not sure if it is compatible with yi-hack-v5

denven avatar Jan 26 '24 09:01 denven

@denven it is all about how the app was built - it requires libs as those could be shared with other apps, which is to reduce the file size of such apps.

alienatedsec avatar Jan 26 '24 09:01 alienatedsec

@denven it is all about how the app was built - it requires libs as those could be shared with other apps, which is to reduce the file size of such apps.

true, this makes sense.

so the thing is raffifu copied a builtin curl into sd card and ran into an error, and roleoroleo has already given the reason and answer.

if this is the case, I think my suggestion is also optional solution with less pain for the few popular used apps, worry-free about the size and dependencies on the sd card.

denven avatar Jan 27 '24 21:01 denven

if this is the case, I think my suggestion is also optional solution with less pain for the few popular used apps, worry-free about the size and dependencies on the sd card.

@denven That would be another issue as those devices have limited memory and CPU - loading apps with built-in libs is to load them to RAM, which is more concerning than almost unlimited SD storage.

alienatedsec avatar Jan 27 '24 21:01 alienatedsec