MeemeeLab / node-anime-viewer

Nodejs implementation of ani-cli.
Other
27 stars 6 forks source link

All episode selections seem to return null or undefined #49

Closed ghost closed 2 years ago

ghost commented 2 years ago

Version

1.2.0 +

Platform

5.13.0-30-generic #33-Ubuntu SMP Fri Feb 4 17:03:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Module

Most likely anime.js

What steps will reproduce the bug?

Search any anime, then try selecting an episode. It will crash with a TypeError.

How often does it reproduce? Is there a required condition?

There is no instance where it does not happen from what I have seen.

What is the expected behavior?

Episode should not be null/undefined.

What do you see instead?

Crash output image: https://file.garden/YK55Rqs3-AHC5Tk9/Images/crash.png

Text:

/home/fireboltaa/node-anime-viewer/node_modules/crypto-js/cipher-core.js:728
                    var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
                                                                                         ^

TypeError: Cannot read properties of undefined (reading 'ciphertext')
    at Object.decrypt (/home/fireboltaa/node-anime-viewer/node_modules/crypto-js/cipher-core.js:728:83)
    at Object.decrypt (/home/fireboltaa/node-anime-viewer/node_modules/crypto-js/cipher-core.js:205:59)
    at generateEncryptAjaxParameters (file:///home/fireboltaa/node-anime-viewer/src/modules/anime.js:47:50)
    at AnimeEpisode.getAvailableVideos (file:///home/fireboltaa/node-anime-viewer/src/modules/anime.js:150:24)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async file:///home/fireboltaa/node-anime-viewer/src/index.js:104:34

Additional information

Through some testing, I believe that the problem is somewhere along the line, null is returned. Before the error sent, I had received an almost identical error, but with .toString() instead of ciphertext.

The error was remedied by using String(value6) as oppose to value6.toString(). Because String() will just return null for a null value, while .toString() will result in a TypeError, I believe that some value is null.

I don't know what exactly as I don't know any JavaScript myself, and because of that I am not able to investigate further.

MeemeeLab commented 2 years ago

Thanks for report, I'm investigating this issue.

MeemeeLab commented 2 years ago

Also, I'm sorry for late reply.

MeemeeLab commented 2 years ago

This should fixed now. Thanks to bugs in the gogoanime, I successfully managed to deobfuscate the code!