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

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import base64
  2. def DecodeUppodTextHash( data ):
  3. hash = "0123456789WGXMHRUZID=NQVBLihbzaclmepsJxdftioYkngryTwuvihv7ec41D6GpBtXx3QJRiN5WwMf=ihngU08IuldVHosTmZz9kYL2bayE"
  4. data = DecodeUppod_tr(data, "r", "A")
  5. data = data.replace("\n", "")
  6. hash = hash.split('ih')
  7. if data.endswith('!'):
  8. data = data[:-1]
  9. taba = hash[3]
  10. tabb = hash[2]
  11. else:
  12. taba = hash[1]
  13. tabb = hash[0]
  14. i = 0;
  15. while i < len(taba):
  16. data = data.replace(tabb[i], "__" )
  17. data = data.replace(taba[i], tabb[i])
  18. data = data.replace("__" , taba[i])
  19. i += 1
  20. result = base64.b64decode(data)
  21. return result
  22. def DecodeUppod_tr(data, ch1, ch2):
  23. if data[:-1].endswith(ch1) and data[2]==ch2:
  24. srev = data[::-1] # revers string
  25. try:
  26. loc3 = int(float(srev[-2:]) / 2) # get number at end of string
  27. except ValueError:
  28. return data
  29. srev = srev[2:-3] # get string between ch1 and ch2
  30. if loc3 < len(srev):
  31. i = loc3
  32. while i < len(srev):
  33. srev = srev[:i] + srev[i+1:] # remove char at index i
  34. i += loc3
  35. data = srev + "!"
  36. return data
  37. print(DecodeUppodTextHash('XRHzQZe3yv7s2iJgQx687awzQWkvy1bvyv2350Jlf0ts2jAz2WtG5W5LfmJl5jQL502z5i5sfZtMDj23a0A0y0Uj2xkT5mcl5MUWfjcz2j5G5mElOmtGOm5n5mJYOitLyWD47j6GPk44yCl0fjb7'))