song_upload.js 498 B

1234567891011121314151617181920212223
  1. const { cloud, login_cellphone } = require('../main')
  2. const fs = require('fs')
  3. const path = require('path')
  4. async function main() {
  5. const result = await login_cellphone({
  6. phone: '手机号',
  7. password: '密码',
  8. })
  9. const filePath = './test.mp3'
  10. try {
  11. await cloud({
  12. songFile: {
  13. name: path.basename(filePath),
  14. data: fs.readFileSync(filePath),
  15. },
  16. cookie: result.body.cookie,
  17. })
  18. } catch (error) {
  19. console.log(error, 'error')
  20. }
  21. }
  22. main()