Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transcribe local files #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sloganking
Copy link

Fixed #25 . Just pass a directory path where you previously passed YouTube URLs, and the CLI will transcribe it. For now the output file name is the same as the entire directory. I leave naming the file to just the name of the video file as an exercise for later.

@what-the-diff
Copy link

what-the-diff bot commented Nov 9, 2022

  • Added validators to requirements.txt
  • Changed the way get_audio() works, now it can accept URLs or audio paths as input and returns a dictionary with titles (or file names) as keys and their corresponding path/URLs as values
  • Fixed an indentation error in main() function that caused errors when running yt-whisper from command line

@iwasthesword
Copy link

iwasthesword commented Nov 18, 2022

I support this PR, awesome feature to have.
A few changes I had to made to get it working for me (fork with the changes):

  • Revert this change as it was giving me error ModuleNotFoundError: No module named 'utils'
  • Manually install validators pip install validators

Other than this it's working nicely, thank you

@sloganking
Copy link
Author

@iwasthesword

Revert this change as it was giving me error ModuleNotFoundError: No module named 'utils'

  • The reverted change is the only commit in this PR. Did you need to put a . in front of utils? It was in the original project, but it caused crashing for me. I'm not sure why. Are you running this program via running python ./yt_whisper/cli.py or something else?

  • This PR added validators to requirments.txt, so pip install -r requirements.txt (which is in the installation steps) should install it.

@iwasthesword
Copy link

  • The reverted change is the only commit in this PR. Did you need to put a . in front of utils? It was in the original project, but it caused crashing for me. I'm not sure why. Are you running this program via running python ./yt_whisper/cli.py or something else?

I'm using as instructed in the README, install via github then yt_whisper

  • This PR added validators to requirments.txt, so pip install -r requirements.txt (which is in the installation steps) should install it.

I think you need to add it to setup.py as well. This worked for me without having to install it manually.

@sloganking
Copy link
Author

@iwasthesword

I'm using as instructed in the README, install via github then yt_whisper

Then that installs whatever version @m1guelpf has released on pip. Not what is in this unmerged pull request.

@iwasthesword
Copy link

Then that installs whatever version @m1guelpf has released on pip. Not what is in this unmerged pull request.

No, I used the same logic but targeted your repo and branch instead:
pip install git+https://github.com/sloganking/yt-whisper.git@transcribe-local-files

@@ -62,7 +81,7 @@ def main():

print("Saved SRT to", os.path.abspath(srt_path))


# Downlaods youtube videos and returns their paths

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*Downloads YouTube

@deadcoder0904
Copy link

@sloganking i got this error while trying pip install git+https://github.com/sloganking/yt-whisper.git@transcribe-local-files:

Discarding git+https://github.com/openai/whisper.git@main#egg=whisper: Requested openai-whisper from git+https://github.com/openai/whisper.git@main#egg=whisper (from yt-whisper==1.0) has inconsistent name: expected 'whisper', but metadata has 'openai-whisper'
Collecting yt-dlp
  Using cached yt_dlp-2023.1.6-py2.py3-none-any.whl (2.8 MB)
ERROR: Could not find a version that satisfies the requirement whisper (unavailable) (from yt-whisper) (from versions: 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.9, 0.9.10, 0.9.11, 0.9.12, 0.9.13, 0.9.14, 0.9.15, 0.9.16, 1.0.0, 1.0.1, 1.0.2, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9, 1.1.10)
ERROR: No matching distribution found for whisper (unavailable)

couldn't get it to install for some reason but would love to have local file support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to run on local files?
4 participants