Update workflows/publish_pypi.yml
[manga-dl.git] / manga_py / crypt / mangarock_com.py
blobe96ab7d7c42a81db51d7a70726b7886424c9e724
1 from .base_lib import BaseLib
4 class MangaRockComCrypt(BaseLib):
5 def decrypt(self, string):
6 if isinstance(string, str):
7 string = string.encode()
8 n = len(string) + 7
10 tmp = self.pack_auto([82, 73, 70, 70])
12 tmp += self.pack_auto([
13 n & 0xff,
14 (n >> 8) & 0xff,
15 (n >> 16) & 0xff,
16 (n >> 24) & 0xff,
19 tmp += self.pack_auto([87, 69, 66, 80, 86, 80, 56])
20 for i in range(len(string)):
21 tmp += self.pack('1B', string[i] ^ 101)
22 return tmp