GithubHelp home page GithubHelp logo

permission error? about sub-to-audio HOT 2 CLOSED

reishikin avatar reishikin commented on June 14, 2024
permission error?

from sub-to-audio.

Comments (2)

bnsantoso avatar bnsantoso commented on June 14, 2024

It is due to a temporary file already being open when creating it and trying to open it again, resulting in a permission error. Since I use Linux, I do not encounter this bug, sorry for this mistake. To work around it, I disabled auto delete, closed the file, and deleted it manually when the operation is done.

edit the file ..\Python\Python311\Lib\site-packages\subtoaudio\subtoaudio.py or just reinstall the package from git

def subtitle(self, file_path:str):
    with tempfile.NamedTemporaryFile(suffix=".srt", delete=False) as temp_file:
      temp_filename = temp_file.name
      ffmpeg_command = f'ffmpeg -y -i "{file_path}" "{temp_filename}"'
      subprocess.run(ffmpeg_command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      temp_file.close()
      dictionary = self._extract_data_srt(temp_filename)
      os.unlink(temp_filename)
    return dictionary

if you encounter permission error again on audio section feel free to tell me

from sub-to-audio.

reishikin avatar reishikin commented on June 14, 2024

Thank you so much for your prompt response! The permission error is no longer an issue, which is great. However, I'm now facing new challenges with longer SRT files (specifically, ones that are 2 hours long) and SRT files in different languages. I'll post these additional issues for further assistance. Thanks again for your help!

from sub-to-audio.

Related Issues (17)

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.