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