Plex plugin to to play various online streams (mostly Latvian).

escsm.py 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. ######################## BEGIN LICENSE BLOCK ########################
  2. # The Original Code is mozilla.org code.
  3. #
  4. # The Initial Developer of the Original Code is
  5. # Netscape Communications Corporation.
  6. # Portions created by the Initial Developer are Copyright (C) 1998
  7. # the Initial Developer. All Rights Reserved.
  8. #
  9. # Contributor(s):
  10. # Mark Pilgrim - port to Python
  11. #
  12. # This library is free software; you can redistribute it and/or
  13. # modify it under the terms of the GNU Lesser General Public
  14. # License as published by the Free Software Foundation; either
  15. # version 2.1 of the License, or (at your option) any later version.
  16. #
  17. # This library is distributed in the hope that it will be useful,
  18. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. # Lesser General Public License for more details.
  21. #
  22. # You should have received a copy of the GNU Lesser General Public
  23. # License along with this library; if not, write to the Free Software
  24. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  25. # 02110-1301 USA
  26. ######################### END LICENSE BLOCK #########################
  27. from .constants import eStart, eError, eItsMe
  28. HZ_cls = (
  29. 1,0,0,0,0,0,0,0, # 00 - 07
  30. 0,0,0,0,0,0,0,0, # 08 - 0f
  31. 0,0,0,0,0,0,0,0, # 10 - 17
  32. 0,0,0,1,0,0,0,0, # 18 - 1f
  33. 0,0,0,0,0,0,0,0, # 20 - 27
  34. 0,0,0,0,0,0,0,0, # 28 - 2f
  35. 0,0,0,0,0,0,0,0, # 30 - 37
  36. 0,0,0,0,0,0,0,0, # 38 - 3f
  37. 0,0,0,0,0,0,0,0, # 40 - 47
  38. 0,0,0,0,0,0,0,0, # 48 - 4f
  39. 0,0,0,0,0,0,0,0, # 50 - 57
  40. 0,0,0,0,0,0,0,0, # 58 - 5f
  41. 0,0,0,0,0,0,0,0, # 60 - 67
  42. 0,0,0,0,0,0,0,0, # 68 - 6f
  43. 0,0,0,0,0,0,0,0, # 70 - 77
  44. 0,0,0,4,0,5,2,0, # 78 - 7f
  45. 1,1,1,1,1,1,1,1, # 80 - 87
  46. 1,1,1,1,1,1,1,1, # 88 - 8f
  47. 1,1,1,1,1,1,1,1, # 90 - 97
  48. 1,1,1,1,1,1,1,1, # 98 - 9f
  49. 1,1,1,1,1,1,1,1, # a0 - a7
  50. 1,1,1,1,1,1,1,1, # a8 - af
  51. 1,1,1,1,1,1,1,1, # b0 - b7
  52. 1,1,1,1,1,1,1,1, # b8 - bf
  53. 1,1,1,1,1,1,1,1, # c0 - c7
  54. 1,1,1,1,1,1,1,1, # c8 - cf
  55. 1,1,1,1,1,1,1,1, # d0 - d7
  56. 1,1,1,1,1,1,1,1, # d8 - df
  57. 1,1,1,1,1,1,1,1, # e0 - e7
  58. 1,1,1,1,1,1,1,1, # e8 - ef
  59. 1,1,1,1,1,1,1,1, # f0 - f7
  60. 1,1,1,1,1,1,1,1, # f8 - ff
  61. )
  62. HZ_st = (
  63. eStart,eError, 3,eStart,eStart,eStart,eError,eError,# 00-07
  64. eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,# 08-0f
  65. eItsMe,eItsMe,eError,eError,eStart,eStart, 4,eError,# 10-17
  66. 5,eError, 6,eError, 5, 5, 4,eError,# 18-1f
  67. 4,eError, 4, 4, 4,eError, 4,eError,# 20-27
  68. 4,eItsMe,eStart,eStart,eStart,eStart,eStart,eStart,# 28-2f
  69. )
  70. HZCharLenTable = (0, 0, 0, 0, 0, 0)
  71. HZSMModel = {'classTable': HZ_cls,
  72. 'classFactor': 6,
  73. 'stateTable': HZ_st,
  74. 'charLenTable': HZCharLenTable,
  75. 'name': "HZ-GB-2312"}
  76. ISO2022CN_cls = (
  77. 2,0,0,0,0,0,0,0, # 00 - 07
  78. 0,0,0,0,0,0,0,0, # 08 - 0f
  79. 0,0,0,0,0,0,0,0, # 10 - 17
  80. 0,0,0,1,0,0,0,0, # 18 - 1f
  81. 0,0,0,0,0,0,0,0, # 20 - 27
  82. 0,3,0,0,0,0,0,0, # 28 - 2f
  83. 0,0,0,0,0,0,0,0, # 30 - 37
  84. 0,0,0,0,0,0,0,0, # 38 - 3f
  85. 0,0,0,4,0,0,0,0, # 40 - 47
  86. 0,0,0,0,0,0,0,0, # 48 - 4f
  87. 0,0,0,0,0,0,0,0, # 50 - 57
  88. 0,0,0,0,0,0,0,0, # 58 - 5f
  89. 0,0,0,0,0,0,0,0, # 60 - 67
  90. 0,0,0,0,0,0,0,0, # 68 - 6f
  91. 0,0,0,0,0,0,0,0, # 70 - 77
  92. 0,0,0,0,0,0,0,0, # 78 - 7f
  93. 2,2,2,2,2,2,2,2, # 80 - 87
  94. 2,2,2,2,2,2,2,2, # 88 - 8f
  95. 2,2,2,2,2,2,2,2, # 90 - 97
  96. 2,2,2,2,2,2,2,2, # 98 - 9f
  97. 2,2,2,2,2,2,2,2, # a0 - a7
  98. 2,2,2,2,2,2,2,2, # a8 - af
  99. 2,2,2,2,2,2,2,2, # b0 - b7
  100. 2,2,2,2,2,2,2,2, # b8 - bf
  101. 2,2,2,2,2,2,2,2, # c0 - c7
  102. 2,2,2,2,2,2,2,2, # c8 - cf
  103. 2,2,2,2,2,2,2,2, # d0 - d7
  104. 2,2,2,2,2,2,2,2, # d8 - df
  105. 2,2,2,2,2,2,2,2, # e0 - e7
  106. 2,2,2,2,2,2,2,2, # e8 - ef
  107. 2,2,2,2,2,2,2,2, # f0 - f7
  108. 2,2,2,2,2,2,2,2, # f8 - ff
  109. )
  110. ISO2022CN_st = (
  111. eStart, 3,eError,eStart,eStart,eStart,eStart,eStart,# 00-07
  112. eStart,eError,eError,eError,eError,eError,eError,eError,# 08-0f
  113. eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,# 10-17
  114. eItsMe,eItsMe,eItsMe,eError,eError,eError, 4,eError,# 18-1f
  115. eError,eError,eError,eItsMe,eError,eError,eError,eError,# 20-27
  116. 5, 6,eError,eError,eError,eError,eError,eError,# 28-2f
  117. eError,eError,eError,eItsMe,eError,eError,eError,eError,# 30-37
  118. eError,eError,eError,eError,eError,eItsMe,eError,eStart,# 38-3f
  119. )
  120. ISO2022CNCharLenTable = (0, 0, 0, 0, 0, 0, 0, 0, 0)
  121. ISO2022CNSMModel = {'classTable': ISO2022CN_cls,
  122. 'classFactor': 9,
  123. 'stateTable': ISO2022CN_st,
  124. 'charLenTable': ISO2022CNCharLenTable,
  125. 'name': "ISO-2022-CN"}
  126. ISO2022JP_cls = (
  127. 2,0,0,0,0,0,0,0, # 00 - 07
  128. 0,0,0,0,0,0,2,2, # 08 - 0f
  129. 0,0,0,0,0,0,0,0, # 10 - 17
  130. 0,0,0,1,0,0,0,0, # 18 - 1f
  131. 0,0,0,0,7,0,0,0, # 20 - 27
  132. 3,0,0,0,0,0,0,0, # 28 - 2f
  133. 0,0,0,0,0,0,0,0, # 30 - 37
  134. 0,0,0,0,0,0,0,0, # 38 - 3f
  135. 6,0,4,0,8,0,0,0, # 40 - 47
  136. 0,9,5,0,0,0,0,0, # 48 - 4f
  137. 0,0,0,0,0,0,0,0, # 50 - 57
  138. 0,0,0,0,0,0,0,0, # 58 - 5f
  139. 0,0,0,0,0,0,0,0, # 60 - 67
  140. 0,0,0,0,0,0,0,0, # 68 - 6f
  141. 0,0,0,0,0,0,0,0, # 70 - 77
  142. 0,0,0,0,0,0,0,0, # 78 - 7f
  143. 2,2,2,2,2,2,2,2, # 80 - 87
  144. 2,2,2,2,2,2,2,2, # 88 - 8f
  145. 2,2,2,2,2,2,2,2, # 90 - 97
  146. 2,2,2,2,2,2,2,2, # 98 - 9f
  147. 2,2,2,2,2,2,2,2, # a0 - a7
  148. 2,2,2,2,2,2,2,2, # a8 - af
  149. 2,2,2,2,2,2,2,2, # b0 - b7
  150. 2,2,2,2,2,2,2,2, # b8 - bf
  151. 2,2,2,2,2,2,2,2, # c0 - c7
  152. 2,2,2,2,2,2,2,2, # c8 - cf
  153. 2,2,2,2,2,2,2,2, # d0 - d7
  154. 2,2,2,2,2,2,2,2, # d8 - df
  155. 2,2,2,2,2,2,2,2, # e0 - e7
  156. 2,2,2,2,2,2,2,2, # e8 - ef
  157. 2,2,2,2,2,2,2,2, # f0 - f7
  158. 2,2,2,2,2,2,2,2, # f8 - ff
  159. )
  160. ISO2022JP_st = (
  161. eStart, 3,eError,eStart,eStart,eStart,eStart,eStart,# 00-07
  162. eStart,eStart,eError,eError,eError,eError,eError,eError,# 08-0f
  163. eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,# 10-17
  164. eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,# 18-1f
  165. eError, 5,eError,eError,eError, 4,eError,eError,# 20-27
  166. eError,eError,eError, 6,eItsMe,eError,eItsMe,eError,# 28-2f
  167. eError,eError,eError,eError,eError,eError,eItsMe,eItsMe,# 30-37
  168. eError,eError,eError,eItsMe,eError,eError,eError,eError,# 38-3f
  169. eError,eError,eError,eError,eItsMe,eError,eStart,eStart,# 40-47
  170. )
  171. ISO2022JPCharLenTable = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  172. ISO2022JPSMModel = {'classTable': ISO2022JP_cls,
  173. 'classFactor': 10,
  174. 'stateTable': ISO2022JP_st,
  175. 'charLenTable': ISO2022JPCharLenTable,
  176. 'name': "ISO-2022-JP"}
  177. ISO2022KR_cls = (
  178. 2,0,0,0,0,0,0,0, # 00 - 07
  179. 0,0,0,0,0,0,0,0, # 08 - 0f
  180. 0,0,0,0,0,0,0,0, # 10 - 17
  181. 0,0,0,1,0,0,0,0, # 18 - 1f
  182. 0,0,0,0,3,0,0,0, # 20 - 27
  183. 0,4,0,0,0,0,0,0, # 28 - 2f
  184. 0,0,0,0,0,0,0,0, # 30 - 37
  185. 0,0,0,0,0,0,0,0, # 38 - 3f
  186. 0,0,0,5,0,0,0,0, # 40 - 47
  187. 0,0,0,0,0,0,0,0, # 48 - 4f
  188. 0,0,0,0,0,0,0,0, # 50 - 57
  189. 0,0,0,0,0,0,0,0, # 58 - 5f
  190. 0,0,0,0,0,0,0,0, # 60 - 67
  191. 0,0,0,0,0,0,0,0, # 68 - 6f
  192. 0,0,0,0,0,0,0,0, # 70 - 77
  193. 0,0,0,0,0,0,0,0, # 78 - 7f
  194. 2,2,2,2,2,2,2,2, # 80 - 87
  195. 2,2,2,2,2,2,2,2, # 88 - 8f
  196. 2,2,2,2,2,2,2,2, # 90 - 97
  197. 2,2,2,2,2,2,2,2, # 98 - 9f
  198. 2,2,2,2,2,2,2,2, # a0 - a7
  199. 2,2,2,2,2,2,2,2, # a8 - af
  200. 2,2,2,2,2,2,2,2, # b0 - b7
  201. 2,2,2,2,2,2,2,2, # b8 - bf
  202. 2,2,2,2,2,2,2,2, # c0 - c7
  203. 2,2,2,2,2,2,2,2, # c8 - cf
  204. 2,2,2,2,2,2,2,2, # d0 - d7
  205. 2,2,2,2,2,2,2,2, # d8 - df
  206. 2,2,2,2,2,2,2,2, # e0 - e7
  207. 2,2,2,2,2,2,2,2, # e8 - ef
  208. 2,2,2,2,2,2,2,2, # f0 - f7
  209. 2,2,2,2,2,2,2,2, # f8 - ff
  210. )
  211. ISO2022KR_st = (
  212. eStart, 3,eError,eStart,eStart,eStart,eError,eError,# 00-07
  213. eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,# 08-0f
  214. eItsMe,eItsMe,eError,eError,eError, 4,eError,eError,# 10-17
  215. eError,eError,eError,eError, 5,eError,eError,eError,# 18-1f
  216. eError,eError,eError,eItsMe,eStart,eStart,eStart,eStart,# 20-27
  217. )
  218. ISO2022KRCharLenTable = (0, 0, 0, 0, 0, 0)
  219. ISO2022KRSMModel = {'classTable': ISO2022KR_cls,
  220. 'classFactor': 6,
  221. 'stateTable': ISO2022KR_st,
  222. 'charLenTable': ISO2022KRCharLenTable,
  223. 'name': "ISO-2022-KR"}
  224. # flake8: noqa