Coder Social home page Coder Social logo

Comments (6)

keredson avatar keredson commented on May 27, 2024

it doesn't insist on it being utf-8. i use pycaption's detect_format() tool. sadly perfect encoding detection is impossible. (see https://stackoverflow.com/questions/436220/determine-the-encoding-of-text-in-python)

from gnomecast.

keredson avatar keredson commented on May 27, 2024

actually, looking at my own code, possible i might have a bug insisting on utf-8. can you post a subtitle file (that's not working) i can confirm w/?

from gnomecast.

kparal avatar kparal commented on May 27, 2024

Sure, download for example this one:
https://www.opensubtitles.org/cs/subtitles/4673665/the-big-bang-theory-the-date-night-variable-cs

You'll see empty rectangles instead of some characters (other characters are swapped with a completely different ones from a different alphabet, but I understand those are much harder to spot for a foreigner). The correct encoding is windows 1250 (cp1250). For example gedit's open dialog allows for selecting encoding, so that you can compare correct and incorrect rendering.

from gnomecast.

deimidis avatar deimidis commented on May 27, 2024

I have a similar problem, and there's no option to not add subtitles (or don't check for it). I think this movie has encoded subtitles, and I have this error on console: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 2031: invalid continuation byte

Gnomecast continue searching for subtitles and Play button is always grey

from gnomecast.

keredson avatar keredson commented on May 27, 2024

i've witnessed that as well @deimidis. needs better error handling for sure.

from gnomecast.

esmin avatar esmin commented on May 27, 2024

Warning: I know very basic python(3)
I think the simplest solution would be:
inputSubtitles.decode('codec').encode('utf8') and process further - as vtt must be utf8 this will also solve UnicodeDecodeError issues
where codec can be chosen from drop menu of builtin codecs
https://docs.python.org/3.7/library/codecs.html#standard-encodings

This is basically what VLC and other video players have, instead of trying codec autodetect.
Btw, kudos for great app

from gnomecast.

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.