Git Product home page Git Product logo

Comments (3)

blissland avatar blissland commented on May 24, 2024 1

I just submitted a pull request which fixes this renameSync problem. I believe this might also be the root cause of many of the problems reported when running alltomp3 on Windows.

from alltomp3.

gurachan avatar gurachan commented on May 24, 2024

nvm i use socket io server .. btw everything is ok only this function throws error

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: EPERM: operation not permitted, rename './mp3/temp/9e8b58518f.mp3.cover.resized.jpg' -> './mp3/temp/9e8b58518f.mp3.cover.jpg'

i really don't know how to use that "downloadAndTagSingleURL" properly ..

 alltomp3.tempFolder = './mp3/temp/';
    const dl = alltomp3.downloadAndTagSingleURL(url, './mp3/', undefined, undefined, false, 1);
    dl.on('download', function(infos) {
        process.stdout.write(infos.progress + '%\n');
    });
    dl.on('download-end', function() {
        console.log('', 'Download end');
    });
    dl.on('convert', function(infos) {
        process.stdout.write('Converting: ' + infos.progress + '%\n');
    });
    dl.on('convert-end', function() {
        console.log('', 'Convert end');
    });
    dl.on('infos', function(infos) {
        console.log('New infos received: ', infos);
    });

on my temp folder theres mp3 and 2 image 9e8b58518f.mp3.cover.resized.jpg and ./mp3/temp/9e8b58518f.mp3.cover.jpg

and the script wants to rename './mp3/temp/9e8b58518f.mp3.cover.resized.jpg' -> './mp3/temp/9e8b58518f.mp3.cover.jpg'

but this is already exist ./mp3/temp/9e8b58518f.mp3.cover.jpg

i tried delete but delete not working on windows bash xD i mean unlinksync

so i rename it fs.renameSync(coverPath,coverPath + '.old'); this works but if i remove this
it throws error

(node:769) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: EPERM: operation not permitted, rename './mp3/temp/9e8b58518f.mp3.cover.resized.jpg' -> './mp3/temp/9e8b58518f.mp3.cover.jpg'
(node:769) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

but i really sure that renameSync will override the file if exist xD for some reason it throws error

from alltomp3.

NTag avatar NTag commented on May 24, 2024

You can just use alltomp3.downloadAndTagSingleURL(url, './mp3/').

For the EPERM error, you are right, renameSync should work and erase an existing file. The problem comes from Windows and may have two possible causes:

  • If you have an antivirus, it may interfere, try to deactivate it;
  • Close any program or explorer Windows using files in the temp/ folder.

Try also to remove all files in the temp/ folder and try again.

Good luck!

from alltomp3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.