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();
@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