抓到一堆磁链,手动加入下载很麻烦… 于是做了个简单的脚本。
(() => {
async function request (object) {
return new Promise((resolve, reject) => {
transmission.remote.sendRequest(object, resolve);
});
}
async function addMagnets(urls) {
for(let i = 0; i < urls.length; i++) {
const url = urls[i];
console.info('add %d/%d: %O', i + 1, urls.length, await request({
method: 'torrent-add',
arguments: {
'paused': false,
'download-dir': $("#download-dir").val(),
'filename': url
}
}));
}
}
addMagnets(`
此处填入地址,一行一个 (填入时删除此行)
`.split('\n').map(n => n.trim()).filter(n => n));
})()
读 Stuck? Switch to“Play Mode” 有感。
摘抄:
… Instead of trying to get things right, I should put myself in“Play Mode”. From his email:
In“Play,”just write or work on something you want… At the end, if you like what you’ve done, bring it in… If you don’t, discard it… It’s okay if nothing comes from it.
… 继续阅读 »