Skip to content

Instantly share code, notes, and snippets.

@martin0258
Last active June 11, 2023 15:11
Show Gist options
  • Save martin0258/e97754b9260da9aa9c2475666f44b473 to your computer and use it in GitHub Desktop.
Save martin0258/e97754b9260da9aa9c2475666f44b473 to your computer and use it in GitHub Desktop.
Mi Cloud Batch Download Recordings - 小米云服务下載全部录音

Problem

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
  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 允許 if browser asks for the permission of 下載多個檔案
  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
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();
@TheJoyWalker
Copy link

had to change change selectors for latest version

var $checkboxes = $("em[class*='checkbox']");
var $downloadbtn = $("div[class='button fl-l download']");
var $deselectbtn = $("div[class='button fl-r unselect']");

@hari2018
Copy link

it works the way like the above video demonstration.,
same for english version too.
it works

@arashpath
Copy link

Hey martin can you please provide English version too. That would be too helpful. Thanks

https://gist.github.com/arashpath/95075231f28a8787e9f77160ce47f2be
just a fork ;). also included script to download gallery items.

@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?

@Red007Master
Copy link

Red007Master commented Mar 28, 2021

So $checkboxes.length don't work
Working code on 29.03.2021

function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function batchdownload() {
var $checkboxes = $("em[class*='checkbox']");
var $downloadbtn = $("div[class='button fl-l download']");
var $deselectbtn = $("div[class='button fl-r unselect']");

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

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