caseyfw / nhldl

A shell script for downloading NHL.tv streams.
MIT License
23 stars 4 forks source link

Open SSL issue on MacOS Sierra #3

Open lunatix66 opened 7 years ago

lunatix66 commented 7 years ago

Hello,

thanks for this perfect script, I really needed it because I am in Europe and can't watch the games live. With your script, I can bring them anywhere!

Everything was working perfect until I decided to go on the new MacOs version, Sierra, and then, it seems like there is an issue with open ssl, here is the error message: "error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-64/src/crypto/evp/evp_enc.c:330:"

I tried to update open ssl, but still the same error Do you have any idea of how to help?

Regards lunatix

caseyfw commented 7 years ago

No idea sorry - I'll check with a workmate who runs MacOS Sierra tomorrow. :-)

caseyfw commented 7 years ago

Hmmm. Does this happen for every stream segment, or just the occasional one?

Now that I think about it, I seem to get this issue too. It appears to happen when a stream segment doesn't download properly, which causes decrypting it to fail because it's malformed. The script automatically rejects these segments and tries to download them again. Here you can see it failing to download segment 1042 a few times before succeeding and moving onto 1043:

>>> Downloading stream segment: 01/57/18.ts [1041/1895]
>>> Done.
>>> Decrypting segment.
>>> Done.
>>> Downloading stream segment: 01/57/23.ts [1042/1895]
>>> Done.
>>> Decrypting segment.
bad decrypt
140104502474400:error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length:evp_enc.c:51
8:
>>> Done.
>>> Downloading stream segment: 01/57/23.ts [1042/1895]
>>> Done.
>>> Decrypting segment.
bad decrypt
139830576735904:error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length:evp_enc.c:51
8:
>>> Done.
>>> Downloading stream segment: 01/57/23.ts [1042/1895]
>>> Done.
>>> Decrypting segment.
bad decrypt
140484709656224:error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length:evp_enc.c:51
8:
>>> Done.
>>> Downloading stream segment: 01/57/23.ts [1042/1895]
>>> Done.
>>> Decrypting segment.
>>> Done.
>>> Downloading stream segment: 01/57/28.ts [1043/1895]
>>> Done.

I should probably make the script say "Failed downloading segment, trying again..." or something.

That said, if this is happening for EVERY segment, it's likely your cookies.txt are incorrect, or the script has failed to download the keys that are used to decrypt the video segments.

lunatix66 commented 7 years ago

Yes, it happens on every segment. I try on different games, even those I know was working before. I tried with the keys, the cookies.txt file... nothing. So, as I really wanted this to work because I use almost every day, I went back to the previous OS X (El Capitan) and everything is working fine again. Same games, same keys... So, it seems that this is really Sierra related.