Giter Club home page Giter Club logo

srt_fix's People

Contributors

bindestriche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

srt_fix's Issues

windows11, KeyError: 'srt_fixPP'

python3 -m pip install -U https://github.com/bindestriche/srt_fix/archive/refs/heads/master.zip

C:\Users\dengz\Downloads\0pitch>yt-dlp --write-auto-sub --sub-lang 'en' --convert-subs=srt --restrict-filenames --no-check-certificates --use-postprocessor srt_fix https://www.youtube.com/watch?
v=jdEaYV5Kq98
Traceback (most recent call last):
File "yt_dlp_main_.py", line 17, in
File "yt_dlp_init_.py", line 1072, in main
File "yt_dlp_init_.py", line 970, in real_main
File "yt_dlp\YoutubeDL.py", line 789, in init
File "yt_dlp\postprocessor_init
.py", line 42, in get_postprocessor
KeyError: 'srt_fixPP'
[30484] Failed to execute script 'main' due to unhandled exception!

Link to .exe file not working

The README.md file for srt_fix has a section entitled "Installation" which states "Windows : Download the .exe from release".

Clicking on the hyperlink in the last word (i.e. "release") results in a "404 - page not found" error.

Issue with path names (on mac?)

I am trying to use this on my mac (running Sonoma 14.4.1) from the shell. This is what happens:

username@mac01337 files % python ~/scr/srt_fix-master/srt_fixer_cli.py "1.srt"
Traceback (most recent call last):
File "/Users/username/scr/srt_fix-master/srt_fixer_cli.py", line 84, in
main()
File "/Users/username/scr/srt_fix-master/srt_fixer_cli.py", line 73, in main
elif os.path.isdir(output_file):
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 42, in isdir
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Installation instructions for `srt_fixer_cli.py`

Your documentation is helpful and got me running on the srt_fix.py as well as the GUI. However the documentation regarding how and where to install srt_fixer_cli.py is a bit sparse. It assumes the user knows where to place the files and how to do so. There is no python install command for installing it, so I made the assumption that I should manually download the repo, and drop all the files within the already downloaded postprocessor (from the srt_fix install process).

This does work, however in the event I need to reinstall windows, I will need to remember to manually do this process again. It would be helpful if you added some lines to the Readme about how to install srt_fixer_cli.py via pip or such. Thank you

AttributeError: module 'os' has no attribute 'oath'. Did you mean: 'path'?

I've downloaded and ran the srt_fixer_cli.py on a subtitle file. I then get the error AttributeError: module 'os' has no attribute 'oath'. Did you mean: 'path'? referencing lines 72 and 74. I believe this may be a typo, the oath should be path. Once I changed both those oath to path, saved the file and ran the script again, it successfully converts the subtitle with no errors.

image

Bug: subtile timestamps are reversed.

Subs fixed with srt_fix_stdlib.exe have subtile timestamps are reversed. I.e.:
1
00:00:06,769 --> 00:00:04,610
how is the day treating you so far so

2
00:00:07,909 --> 00:00:06,779
good yeah go to the gym a little bit

i got this error

Microsoft Windows [Version 10.0.19044.2364]
(c) Microsoft Corporation. All rights reserved.

C:\yt-dlp>yt-dlp https://www.youtube.com/watch?v=fGl93wb5SKk
Error while importing module 'yt_dlp_plugins.postprocessor.srt_fix'
Traceback (most recent call last):
File "C:\Users\Khaled\AppData\Roaming\yt-dlp\plugins\srt_fix\yt_dlp_plugins\postprocessor\srt_fix.py", line 84, in SimpleSrt
def get_duration(parts: list[int, int, int, int]) -> timedelta:
TypeError: 'type' object is not subscriptable
Traceback (most recent call last):
File "yt_dlp_main_.py", line 17, in
File "yt_dlp_init_.py", line 967, in main
File "yt_dlp_init_.py", line 927, in real_main
File "yt_dlp\YoutubeDL.py", line 734, in init
File "yt_dlp\postprocessor_init
.py", line 42, in get_postprocessor
KeyError: 'srt_fixPP'
[15304] Failed to execute script 'main' due to unhandled exception!

C:\yt-dlp>

Download subtitles without video

You're probably already aware, but I noticed you created a ticket here regarding skipping the video download while allowing postprocessing to continue. I just wanted to bring to your attention that you got a reply on that thread months after your original post. I tested it out in my environment, and it does in fact work. There may be some tweaking necessary in the srt_fix invocation afterwards, but overall I think this would be a great addition to your script. At least as a fork for those who want to only download subtitles.

Errors when running srt_fix from yt-dlp (2024.04.09) on my mac

username@mac01337 workfolder % yt-dlp --write-auto-subs --sub-langs "en*" --use-postprocessor srt_fix "[URL TO YOUTUBE VIDEO]"
Traceback (most recent call last):
File "/opt/local/bin/yt-dlp", line 8, in
sys.exit(main())
^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/yt_dlp/init.py", line 1072, in main
_exit(*variadic(_real_main(argv)))
^^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/yt_dlp/init.py", line 970, in _real_main
with YoutubeDL(ydl_opts) as ydl:
^^^^^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/yt_dlp/YoutubeDL.py", line 789, in init
get_postprocessor(pp_def.pop('key'))(self, **pp_def),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/yt_dlp/postprocessor/init.py", line 42, in get_postprocessor
return globals()[key + 'PP']
~~~~~~~~~^^^^^^^^^^^^
KeyError: 'srt_fixPP'

Option to render the sub on 2 rows

Thank you for the work you put on this fix. I wanna suggest adding an option to have the sub on 2 rows. It's easier to pay attention when the subtitle is rendered like this.

[srt_fix] post-processed 'xxx.mp4' with {}

image

Hi, I'm using the latest version of yt-dlp, and my options are (through .conf file):
-P "%DOWNLOADS%" -o "%(title)s.%(ext)s" -S ext --write-auto-sub --sub-lang en --convert-subs=srt --use-postprocessor srt_fix
But no fixed.srt file generated after run.
Could you help find the problem? Thanks.

Can you support the clip function of yt-dlp?

yt-dlp https://youtu.be/p2c6ioGbXCs --download-sections "*1:26:46-1:43:56" -f 137+140 --merge-output-format mp4
yt-dlp -f 140 --download-sections "*4:30-5:30" https://youtu.be/p2c6ioGbXCs
yt-dlp -f 140 --download-sections "*00:04:30-00:05:10" https://youtu.be/p2c6ioGbXCs

the command above will only download the specific during of content. Can you add the "download-sections" to your code?
like, yt-dlp --write-subs --sub-langs en --convert-subs=srt --restrict-filenames --no-check-certificates --use-postprocessor srt_fix https://www.youtube.com/watch?v=EJ-DLRP8JUA -f 140 --download-sections "*00:04:30-00:06:30"

thanks

TypeError: 'type' object is not subscriptable

I get this error
when trying to run the python

Traceback (most recent call last):
File "./srt_fixer_gui.py", line 49, in
class SimpleSrt:
File "./srt_fixer_gui.py", line 80, in SimpleSrt
def get_duration(parts: list[int, int, int, int]) -> timedelta:
TypeError: 'type' object is not subscriptable

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.