Skip to content

Instantly share code, notes, and snippets.

@arashpath
Forked from martin0258/README.md
Last active February 21, 2022 17:35
Show Gist options
  • Save arashpath/95075231f28a8787e9f77160ce47f2be to your computer and use it in GitHub Desktop.
Save arashpath/95075231f28a8787e9f77160ce47f2be to your computer and use it in GitHub Desktop.
Mi Cloud Batch Download Recordings and Gallery

Problem

Bulk Download of Recordings and Gallery items

Solution

Write a simple script

How to use the script

  1. Login to mi cloud https://i.mi.com
  2. Navigate to https://us.i.mi.com/#record or https://us.i.mi.com/v1#gallery
  3. In web browser (Chrome) press F12 to open Chrome developer tool
  4. Navigate to Console
  5. Select the Record/Gallary frame
  6. Paste all the code and press Enter
  7. Click Allow if browser asks for the permission of download multiple file
  8. Wait until all the files are downloaded

Usage

/* Usage steps:
1. Login to mi cloud https://i.mi.com
2. Navigate to https://us.i.mi.com/#record or https://us.i.mi.com/v1#gallery
3. In web browser (Chrome) press F12 to open Chrome developer tool
4. Navigate to Console
5. Select the Record frame
6. Paste all the code and press Enter
7. Click Allow if browser asks for the permission of download multiple file
8. Wait until all the files are downloaded
*/
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function batchdownload() {
var $checkboxes = $("#record_detail_all").find(".checkbox");
var $downloadbtn = $("#record_all_toolbar").find(".download");
var $deselectbtn = $("#record_all_toolbar").find(".unselect");
for(var i = 0; i < $checkboxes.length; i++) {
$checkboxes[i].click();
await sleep(1000);
$downloadbtn.click();
await sleep(3000);
$deselectbtn.click();
await sleep(1000);
}
}
batchdownload();
@jdottone
Copy link

Sorry my bad english.
I have a problem running this script.
Promise {: undefined}
How can I solve it?
Thank you very much.

@GlitchedCod
Copy link

TypeError: Cannot read property 'find' of null at batchdownload
Thanks for help.

@arashpath
Copy link
Author

Sorry my bad english.
I have a problem running this script.
Promise {: undefined}
How can I solve it?
Thank you very much.

Hi, Sorry for delayed reply.
when are you getting error ? while downloading recording or gallery

@arashpath
Copy link
Author

TypeError: Cannot read property 'find' of null at batchdownload
Thanks for help.

Just Checked by downloading recordings its working.
Please ensure

  1. Select record frame after clicking on console.
  2. Allow Multiple downloads if pop up comes.

@GlitchedCod
Copy link

TypeError: Cannot read property 'find' of null at batchdownload
Thanks for help.

Just Checked by downloading recordings its working.
Please ensure

  1. Select record frame after clicking on console.
  2. Allow Multiple downloads if pop up comes.

Sorry but I have done that on the wrong page but now I can't go to the v1 page, I'm always put on the https://i.mi.com/#/ page when the page loading. Thanks for the answer :)

@gaernik
Copy link

gaernik commented Jan 5, 2020

does this still work? I am having trouble selecting gallery frame, I guess I have the same problem as him

TypeError: Cannot read property 'find' of null at batchdownload
Thanks for help.

Just Checked by downloading recordings its working.
Please ensure

  1. Select record frame after clicking on console.
  2. Allow Multiple downloads if pop up comes.

Sorry but I have done that on the wrong page but now I can't go to the v1 page, I'm always put on the https://i.mi.com/#/ page when the page loading. Thanks for the answer :)

@GlitchedCod
Copy link

does this still work? I am having trouble selecting gallery frame, I guess I have the same problem as him

TypeError: Cannot read property 'find' of null at batchdownload
Thanks for help.

Just Checked by downloading recordings its working.
Please ensure

  1. Select record frame after clicking on console.
  2. Allow Multiple downloads if pop up comes.

Sorry but I have done that on the wrong page but now I can't go to the v1 page, I'm always put on the https://i.mi.com/#/ page when the page loading. Thanks for the answer :)

Hi ! Just in case you need to do that i recommande to you the official Xiaomi software to dowload pictures directly to you computer. Much easier and you can tale all your picture in once : https://i.mi.com/mi-lab.htm?locale=en#3 https://webcazine.com/16616/qa-how-to-download-photos-from-mi-cloud-using-mi-cloud-photo-manager/

@dzintarssmilga
Copy link

All works fine, little bit slowly, but works! Right now downloading 3k voice records :D

@itantry
Copy link

itantry commented Mar 9, 2020

All works fine, little bit slowly, but works! Right now downloading 3k voice records :D

I Tried it and It's working. Sir, I can't thank you enough. You saved me a lot of time and effort. Thanks again

@ruckenwind
Copy link

Cannot succeed it. "Promise {: undefined}"

@Macakovski
Copy link

Hello friends! Despite this is an amazing solution for our batch download issue, a guy at Mi Forum found out another great option: https://c.mi.com/thread-2674598-1-0.html

@sivke19
Copy link

sivke19 commented Apr 26, 2020

Hi guys,
can anyone help me with batch downloading records? I have the same problem as some guys here when pasting script to Console. "Promise {: undefined}"
First of all, I can't navigate to "https://us.i.mi.com/#record" only "https://us.i.mi.com/v1#record" (I don't know if this is a problem).
When I navigate to "https://us.i.mi.com/v1#record" and then to developer tool and console I paste code hit enter and get Promise {: undefined}.
What I am doing wrong? Maybe some of my Crome settings blocking it?
I appreciate your help.

@roundwagon
Copy link

hi guys. helpless lady needs a help ;) tried to bulk download gallery with the script. after i ran it it says:

Promise {: undefined}

what can I do?

@Macakovski
Copy link

hi guys. helpless lady needs a help ;) tried to bulk download gallery with the script. after i ran it it says:

Promise {: undefined}

what can I do?

Please refer to my comment above.

@Macakovski
Copy link

Hi guys,
can anyone help me with batch downloading records? I have the same problem as some guys here when pasting script to Console. "Promise {: undefined}"
First of all, I can't navigate to "https://us.i.mi.com/#record" only "https://us.i.mi.com/v1#record" (I don't know if this is a problem).
When I navigate to "https://us.i.mi.com/v1#record" and then to developer tool and console I paste code hit enter and get Promise {: undefined}.
What I am doing wrong? Maybe some of my Crome settings blocking it?
I appreciate your help.

Please refer to my comment above.

@Saiful1122
Copy link

Saiful1122 commented Aug 19, 2020

Need Help for download recordings

Untitled

@Saiful1122
Copy link

All works fine, little bit slowly, but works! Right now downloading 3k voice records :D

Could you pls share the snap of how you able to do this !

@Saiful1122
Copy link

Need Help for download recordings

Untitled

I got salutation.
Actual code should be :

/* Usage steps:

  1. Login to mi cloud https://i.mi.com
  2. Navigate to https://us.i.mi.com/#record
  3. In web browser (Chrome) press F12 to open Chrome developer tool
  4. Navigate to Console
  5. Paste all the code below and press Enter
  6. Wait until all the files are downloaded
    */
    function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
    }
    async function batchdownload() {
    var $checkboxes = $("#record_detail_all").find(".checkbox");
    var $downloadbtn = $("#record_all_toolbar").find(".download");
    var $deselectbtn = $("#record_all_toolbar").find(".unselect");

for(var i = 0; i < $checkboxes.length; i++) {
$checkboxes[i].click();
await sleep(1000);
$downloadbtn.click();
await sleep(3000);
$deselectbtn.click();
await sleep(1000);
}
}
batchdownload();

@UserNameSalunke
Copy link

Thank You For Saving My Time & Effort.
THANKS A LOT ...!!!

@BalajiTechs
Copy link

You are a genius dude. Saved my day. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment