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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. @echo off
  2. :--- Pull content submodule ---
  3. rem cd content
  4. rem git checkout .
  5. rem git pull
  6. rem cd ..
  7. :=== Parameters ===
  8. :--- Extract version number ---
  9. python get_version.py PlayStream.py >version.txt
  10. cat version.txt
  11. rem pause
  12. set /p ver=<version.txt
  13. echo Version: %ver%
  14. pause
  15. :--- Set variables ---
  16. set prog=PlayStream
  17. set pack_name=enigma2-plugin-extensions-playstream
  18. set desc=Play online streams from various sources, mostly Latvian
  19. set ext_dir=usr\lib\enigma2\python\Plugins\Extensions\
  20. set ext_dir2=/usr/lib/enigma2/python/Plugins/Extensions/
  21. set script_dir=usr\script\
  22. set ipk_dir=ipkg\
  23. set release_dir=release\
  24. set feed_dir=q:\web\feed\
  25. set AR=\MinGW\bin\ar.exe
  26. set TAR=\MinGW\msys\1.0\bin\tar.exe
  27. :=== Create data files ===
  28. if exist %ipk_dir% rm -r -f %ipk_dir%
  29. mkdir %ipk_dir%
  30. for %%f in (
  31. readme.md
  32. changelog.md
  33. __init__.py
  34. plugin.py
  35. plugin_locale.py
  36. plugin.png
  37. skin.xml
  38. %prog%.py
  39. %prog%.png
  40. key_menu.png
  41. key_exit.png
  42. VideoDownload.py
  43. enigma2_api.py
  44. content\__init__.py
  45. content\ContentSources.py
  46. content\Downloader.py
  47. content\resolver.py
  48. content\util.py
  49. content\icon.gif
  50. content\run.py
  51. content\playstreamproxy.py
  52. content\offline.mp4
  53. content\demjson.py
  54. content\sources\__init__.py
  55. content\sources\SourceBase.py
  56. content\sources\cinemalive.py
  57. content\sources\config.py
  58. content\sources\euronews.py
  59. content\sources\filmix.py
  60. content\sources\filmon.py
  61. content\sources\iplayer.py
  62. content\sources\kinofilmnet.py
  63. content\sources\movieplace.py
  64. content\sources\ltc.py
  65. content\sources\mtgplay.py
  66. content\sources\play24.py
  67. content\sources\replay.py
  68. content\sources\lmt.py
  69. content\sources\serialguru.py
  70. content\sources\tvdom.py
  71. content\sources\ustvnow.py
  72. content\sources\viaplay.py
  73. content\sources\YouTubeVideoUrl.py
  74. content\sources\jsinterp.py
  75. content\sources\swfinterp.py
  76. content\sources\streams.cfg
  77. content\resolvers\__init__.py
  78. content\resolvers\aadecode.py
  79. content\resolvers\hqqresolver.py
  80. content\resolvers\openload3.py
  81. content\resolvers\hdgo.py
  82. content\resolvers\kapnob.py
  83. content\resolvers\kodik.py
  84. content\resolvers\cloudsany.py
  85. content\resolvers\youtuberesolver.py
  86. locale\*.*
  87. ) do echo f | xcopy /y /q %%f %ipk_dir%data\%ext_dir%%prog%\%%f
  88. xcopy /y /q content\picons\* %ipk_dir%data\%ext_dir%%prog%\picons\
  89. xcopy /y /q playstreamproxy %ipk_dir%data\etc\init.d\
  90. :=== control file ===
  91. mkdir %ipk_dir%CONTROL\
  92. rem xcopy /v /d /y control %ipk_dir%CONTROL\
  93. echo 2.0 >%ipk_dir%debian-binary
  94. (
  95. echo Version: %ver%
  96. echo Package: %pack_name%
  97. echo Description: %desc%
  98. echo Architecture: all
  99. echo Section:
  100. echo Priority: optional
  101. echo Maintainer: ivars777@gmail.com
  102. echo Homepage:
  103. echo Depends: python-json,python-twisted-web,python-simplejson,python-html,python-zlib,python-requests
  104. echo Source:
  105. ) >%ipk_dir%CONTROL\control
  106. dos2unix %ipk_dir%CONTROL\control
  107. :=== preinst file ===
  108. (
  109. echo #!/bin/sh
  110. echo if [ -d %ext_dir2%%prog%/sources ]; then
  111. echo rm -rf %ext_dir2%%prog%/*.pyo ^> /dev/null 2^>^&1
  112. echo rm -rf %ext_dir2%%prog%/resolvers ^> /dev/null 2^>^&1
  113. echo mkdir %ext_dir2%%prog%/content
  114. echo mkdir %ext_dir2%%prog%/content/sources
  115. echo mv %ext_dir2%%prog%/sources/streams.cfg %ext_dir2%%prog%/content/sources/streams.cfg.old
  116. echo mv %ext_dir2%%prog%/sources/*.cfg %ext_dir2%%prog%/content/sources/
  117. echo rm -rf %ext_dir2%%prog%/sources ^> /dev/null 2^>^&1
  118. echo fi
  119. echo if [ -e /etc/init.d/playstreamproxy ]; then
  120. echo rm /etc/init.d/playstreamproxy ^> /dev/null 2^>^&1
  121. echo fi
  122. echo exit 0
  123. ) >%ipk_dir%CONTROL\preinst
  124. dos2unix %ipk_dir%CONTROL\preinst
  125. :=== postinst file ===
  126. (
  127. echo #!/bin/sh
  128. echo chmod +x /etc/init.d/playstreamproxy
  129. echo ln -s /etc/init.d/playstreamproxy /etc/rc4.d/S50playstreamproxy
  130. echo ln -s /etc/init.d/playstreamproxy /etc/rc3.d/S50playstreamproxy
  131. echo ln -s /etc/init.d/playstreamproxy /usr/bin/playstreamproxy
  132. echo rm -rf %ext_dir2%%prog%/*.pyo ^> /dev/null 2^>^&1
  133. echo rm -rf %ext_dir2%%prog%/content/sources/*.pyo ^> /dev/null 2^>^&1
  134. echo rm -rf %ext_dir2%%prog%/content/resolvers/*.pyo ^> /dev/null 2^>^&1
  135. echo exit 0
  136. ) >%ipk_dir%CONTROL\postinst
  137. dos2unix %ipk_dir%CONTROL\postinst
  138. :=== postrm file ===
  139. (
  140. echo #!/bin/sh
  141. rem echo if [ -e /etc/rc4.d/S50playstreamproxy ]; then
  142. echo rm /etc/rc4.d/S50playstreamproxy ^> /dev/null 2^>^&1
  143. rem echo fi
  144. echo #!/bin/sh
  145. rem echo if [ -e /etc/rc3.d/S50playstreamproxy ]; then
  146. echo rm /etc/rc3.d/S50playstreamproxy ^> /dev/null 2^>^&1
  147. rem echo fi
  148. rem echo if [ -e /usr/bin/playstreamproxyy ]; then
  149. echo rm /usr/bin/playstreamproxy ^> /dev/null 2^>^&1
  150. rem echo fi
  151. echo if [ -e /etc/init.d/playstreamproxy ]; then
  152. echo rm /etc/init.d/playstreamproxy ^> /dev/null 2^>^&1
  153. echo fi
  154. echo exit 0
  155. ) >%ipk_dir%CONTROL\postrm
  156. dos2unix %ipk_dir%CONTROL\postrm
  157. :=== conffiles file ===
  158. (
  159. echo %ext_dir2%%prog%/content/sources/streams.cfg
  160. ) >%ipk_dir%CONTROL\conffiles
  161. dos2unix %ipk_dir%CONTROL\conffiles
  162. :=== create ipk file ===
  163. if not exist %release_dir% mkdir %release_dir%
  164. %TAR% -C ipkg\data --mode=777 -czf ipkg\data.tar.gz .
  165. %TAR% -C ipkg\CONTROL --mode=777 -czf ipkg\control.tar.gz .
  166. if exist %release_dir%%pack_name%_%ver%.ipk del %release_dir%%pack_name%_%ver%.ipk
  167. %AR% -r %release_dir%%pack_name%_%ver% ipkg\debian-binary ipkg\data.tar.gz ipkg\control.tar.gz
  168. @echo on
  169. mv %release_dir%%pack_name%_%ver% %release_dir%%pack_name%_%ver%.ipk
  170. git add %release_dir%%pack_name%_%ver%.ipk
  171. :=== Commit/push and copy to feed if message given ===
  172. if not ()==(%1%) (
  173. git commit -m "%1%"
  174. git tag -d "%ver%"
  175. git tag "%ver%"
  176. git push origin master
  177. copy %release_dir%%pack_name%_%ver%.ipk %feed_dir%%pack_name%_%ver%.ipk
  178. pushd %feed_dir%
  179. python c:\Python27\Scripts\opkg-make-index . >Packages
  180. dos2unix Packages
  181. gzip -f -k Packages
  182. popd
  183. )