Closed kylefoley76 closed 3 years ago
I didn't really need the file to be converted into srt. I just needed to convert it into something that a human could read. So I came up with a different code. I'm no longer interested in this problem but of course you're welcome to solve it if you like.
Hi @kylefoley76 thanks for reporting. I created a branch with the sample you provided https://github.com/isaacbernat/netflix-to-srt/compare/issue-27 . The conversion worked fine. Did you manage to get it to work? I am running the script directly with python3
but it seems you are using PyCharm instead? Thanks.
PS: if you found the repo useful please give it a star.
No, I wasn't able to get it to work using your code. I came up with a code that basically just used beautiful soup, but that did not convert it to an srt file. I just need something that I could read. Also, I did try it with python3 and got the same bug.
@kylefoley76 I was trying to reproduce the error. I see the line mentioned in your snippet with codecs.open("{}/{}.srt".format(a.ouput, fn), 'wb', "utf-8") as f:
corresponds to https://github.com/isaacbernat/netflix-to-srt/blob/596491c3701f3b0d0d34c05e532703bdf636eac6/to_srt.py#L155 . But there is a typo since it says ouput
instead of output
. Are you using the latest master? I think fixing the typo should work, otherwise try pulling the latest version.
Anyway I am glad you were able to solve your problem (beautiful soup is quite handy). I'll close the issue. Feel free to reopen if problem persists.
I'm getting the following error message. The file I'm using is attached, I had to save it as a text edit file since github cannot handle XML files. I put the file in the same directory as to_srt.py. download.txt