Giter VIP home page Giter VIP logo

Comments (7)

byroot avatar byroot commented on June 16, 2024

Using the srt command or the library ?

from pysrt.

tjavier82 avatar tjavier82 commented on June 16, 2024

library

from pysrt.

byroot avatar byroot commented on June 16, 2024

I'm sorry but I'm not able to reproduce. Can you show me a code sample that behave like that please ?

from pysrt.

tjavier82 avatar tjavier82 commented on June 16, 2024

$ pip freeze
pysrt==0.4.3
[...]
$ python
Python 2.7.2 (default, Jul 11 2012, 22:02:57)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from pysrt import SubRipFile
subs = SubRipFile.open ('Breaking_Bad_-5x08-_TBA.HDTV.asap.en.srt')
subs.shift(-1)
subs.save('out.srt',encoding='utf-8')
exit()

$ head out.srt
1
00:00:00,000 --> 00:00:00,000
Previously on AMC's
Breaking Bad...

2
00:00:00,000 --> 00:00:00,000
Sooner or later
someone is gonna flip.

from pysrt.

byroot avatar byroot commented on June 16, 2024

Ok it's a bit difficult to see but the shift method signature is:

 shift(hours=0, minutes=0, seconds=0, milliseconds=0)

So you ask to shift 1 hour back.
Try this

subs.shift(seconds=-1)

from pysrt.

tjavier82 avatar tjavier82 commented on June 16, 2024

You're rigth!

Thanks!

from pysrt.

byroot avatar byroot commented on June 16, 2024

You're welcome. It's my bad, I've never took the time to write a proper documentation.

from pysrt.

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.