-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add 'Tetris Metadata Subtitles Extractor', modules, & CLI menu. #13
base: master
Are you sure you want to change the base?
Conversation
…extraction' mode.
…mp to file on either 'ctrl-c' keyboard interrupt or at the end after video is entirely read.
…s Extractor'. Also begin adding modules & a CLI menu for easier use.
…. Add 'finally' block always show 'early loop exit warning' on all exceptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just gonna do something similar but saw this PR which is anyway way better than I could've done
Hi @JupeOwl ! Welcome! 👋😄 So great to see a new face here in Yobi World! 😀 Haha, thanks for the kind words! I know some Python, but tbh, there's probably 90% of the standard library that I don't know. Python is so incredibly powerful and can do so much! I'd chatted with Yobi about a month ago in his Discord and in the end we didn't pursue a CLI menu (for good reasons!) but this was still a fun side-project that I'd enjoyed hacking together. I didn't go farther with this at the time, but my thinking was that:
(Btw, if you're curious: I actually ended up writing about my PR/'ideas-for-next-steps' here: https://community.codenewbie.org/r002/2-python-opencv-classic-tetris-monthly-summary-tool-mar-12-2021-nep) In general, please contribute and make a PR though! Yobi is awesome and Yobi's CTM Summary Tool is awesome! 🎉🌟✨ Seriously though, the world needs more open-source! Open-source is the way! 🚀🚀🚀 |
0) Exit | ||
|
||
$> """ | ||
choice: int = input(prompt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
choice: int = input(prompt) | |
choice: str = input(prompt) |
Also the program will crash if the input is not a number or out of bounds.
Maybe:
choice_str: str = input(prompt)
choice : Optional(int) = None
try:
choice = int(choice_str)
except ValueError:
pass
print()
# dict.get(input, default)
options[int.get(choice, -1)]()
Where -1
would be a 'Command not found' message, similar to unimplemented
A bit ugly, but better than a crash
In the spirit of implementing dubious features that no one specifically requested but I personally find interesting 😅, here's a PR that implements #8, begins adding modules (single monolithic
generate.py
function, be gone!! 👋), and also adds a basic CLI menu for easier navigation.In Summary:
Windows.PowerShell.2021-03-14.16-19-46.mp4
Notes:
python -m main.runner
..mp4
extension and be housed in.\input\
..srt
files will be placed in.\output\
ctrl-c
on your keyboard will exit the main processing loop but not the app.Pictures:
So, for example-- put your input video
(*.mp4)
files here that you wish to process:And after running the subtitles generator, your
.srt
will appear here:Your generated
.srt
should look like this:Using an app like VLC, add the subtitle; it should look like this: