OpenWebif mod to create link to CIFS server instead of streaming recordings (movies)

There is 1 reply in this Thread which was already clicked 2,131 times. The last Post () by TH3-J0K3R.

  • I have an Alien 2 with no internal HDD, so I use an NFS/CIFS server as an HDD replacement. The OpenWebif function to stream recordings (movies) works ok with this configuration, but all files are sent over the net from the NFS/CIFS server to the stb then back out again as a stream. Not a big load on the stb, but since it is connected via WIFI, it is a load on my (sometimes busy) network that I would rather avoid. So I made some mods to OpenWebif to create a .m3u file with a direct link to the NFS/CIFS server instead of an http link to the streaming port of the stb. ( from: http://<stb ip>:8002/hdd/movie/<filename> to: \\<cifs server>\<share>\<path>\<filename>)


    I made changes to three files,


    /usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/plugin.py


    /usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/models/stream.py


    /usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/views/ajax/movies.tmpl

    Diff
    --- ../openwebif.source/plugin/controllers/views/ajax/movies.tmpl     2015-02-10 14:44:34.000000000 +0100
    +++ controllers/views/ajax/movies.tmpl 2015-06-04 03:32:32.055974249 +0200
    @@ -42,6 +42,7 @@
                                                    <a href="#" onclick="jumper8003('$quote($movie.filename)');" title="$tstrings['stream'] ($tstrings['transcoded']): $movie.eventname"><div class="ow_i ow_i_stream2"></div></a>
                                                    #else
                                                    <a target="_blank" href='/web/ts.m3u?file=$quote($movie.filename)' title="$tstrings['stream'] $movie.eventname"><div class="ow_i ow_i_stream1"></div></a>
    +                                               <a target="_blank" href='/web/ts.m3u?cifs=yes&file=$quote($movie.filename)' title="$tstrings['just_play'] $movie.eventname"><div class="ow_i ow_i_stream2"></div></a>
                                                    #end if
                                                    <br><br>
                                                    #set $w = $movie.lastseen



    Attached are the two .py files if you do not have the original .py files in your image.



    Steps if your image has the original .py files :


    (Assuming a basedir of /usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/)


    1. Copy the existing plugin.py file to something like plugin.py.orig
    2. Copy the existing controllers/models/stream.py file to something like controllers/models/stream.py.orig
    3. Edit the .py files and make the changes listed above
    4. Rename the existing plugin.pyo file to something like plugin.pyo.orig
    5. Rename the existing controllers/models/stream.pyo file to something like controllers/models/stream.pyo.orig
    6. Copy the existing movies.tmpl file to something like movies.tmpl.orig
    7. Edit the existing movies.tmpl and make the changes listed above
    8. Restart enigma2 and the new .pyo files will be created
    9. Go to plugins -> OpenWebif and there should be two new options at the bottom to enter your CIFS server info.
    For Server, either enter your server's name or IP address (with no slashes)
    For Sharename, enter the name of the share on the server (with no slashes)
    10. Open the OpenWebif in your browser, select movies and there should be a new icon for CIFS.



    Steps if your image does not have the original .py files :


    (Assuming a basedir of /usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/)


    1. Copy the downloaded plugin.py file to plugin.py
    2. Copy the downloaded stream.py file to controllers/models/stream.py
    3. Rename the existing plugin.pyo file to something like plugin.pyo.orig
    4. Rename the existing controllers/models/stream.pyo file to something like controllers/models/stream.pyo.orig
    5. Copy the existing controllers/views/ajax/movies.tmpl file to something like controllers/views/ajax/movies.tmpl.orig
    6. Edit the existing movies.tmpl and make the changes listed above
    7. Restart enigma2 and new .pyo files will be created
    8. Go to plugins -> OpenWebif and there should be two new options at the bottom to enter your CIFS server info.
    For Server, either enter your server's name or IP address (with no slashes)
    For Sharename, enter the name of the share on the server (with no slashes)
    9. Open the OpenWebif in your browser, select movies and there should be a new icon for CIFS.


    If something goes wrong, you can always remove any newly created .pyo files and rename the .orig files to .pyo and replace the modded movies.tmpl with the saved .orig file.


    NOTE! I did this on a box without a transcoding option, so I "stole" the icon/placement of the transcoding option to use for my mod. If your box has transcoding, some further mods would need to be made....

  • thanx ive bookmarked this for later :)

    PM for support 0nly with a Link to Y0ur
    P05t w1Th Wat5 up 0r 155u3 thaT5
    B33N ....... P05T3D


    0D3R PATCH3D 3H ;)
    much <3 th0ugh in d0 a5 Ab0v3
    1n Wh3n 533N r3plY n PM n 58PP0rt G1v3n ;)



    "I'm against Piracey so please DONT ATTACK SHIPS"
    :p

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!