Best way for script to do web request and system commands

Discussion in 'Support Area' started by asimov-solensan, Jan 27, 2019.

  1. asimov-solensan

    asimov-solensan Member

    Joined:
    Jan 8, 2010
    Messages:
    487
    Hello,

    I have got a DVB-T server at home. I created a web interface that initializes the receiver and then mumudvb generates a streaming link that can be opened with VLC or similar.

    This was nice in older firefox versions because the link was opened with the vlc-plugin and it was seamless. In android also works because firefox just allows you to choose a program (kodi for instance reads the stream without problem).

    But newer versions of firefox are a PITA and even if I choose a program to open the stream it tries to download a file (of course of infinite length) and the open it in the selected program.

    Of course in pandora none of those methods works. I can simply copy the link in VLC. But, hell, I'm an engineer, it's in my DNA to overcomplicate things to unnecessary extents.

    So I was thinking how could be a way to do an interface that does some web requests and the calls VLC (is it possible to call pnd_run vlc and then open the link?). I would like to find a way of doing this as portable as possible but Pandora is my main concern right now.

    For instance I have got this solved in my computer with an Xdialog script, but I checked that this isn't available on Pandora. And I want it to have some sort of graphic interface.

    Is there any web browser that allows to script "Open with ..." options? That would also solve my problem.

    Regards.
     
    Tags:
  2. FBnil

    FBnil Ready to Champion the Pyra to the World...

    Joined:
    Dec 14, 2012
    Messages:
    2,728
    Location:
    Yurp
    Launching a PND from the Terminal
    See the example for Chromium.

    Also look into waterfox if you want to still use your old ff plugin...

    --- edit: Adding real world example

    Code:
    /usr/pandora/scripts/pnd_run.sh -p /media/PANTOFFEL/pandora/apps/vlc.pnd -e scripts/vlc.sh -a /media/PANTOFFEL/MEDIA/Quantum_Physics_Debunks_Materialism.mp4
     
    Last edited: Jan 27, 2019
  3. elvissteinjr

    elvissteinjr Very Active Member

    Joined:
    Aug 23, 2013
    Messages:
    428
    Location:
    Germany
    Regarding doing it from a web browser, registering a custom protocol comes to mind.

    Good old Opera 12 had options regarding file types and if to just pass the url to the handling application instead of downloading the file... not that this help here.
     
  4. asimov-solensan

    asimov-solensan Member

    Joined:
    Jan 8, 2010
    Messages:
    487
    That helps. I wasn't sure if it was possible to do it.

    I will try but I'm pretty sure it will behave as it does now. It will try to downlad the file before calling any application.
     
  5. elvissteinjr

    elvissteinjr Very Active Member

    Joined:
    Aug 23, 2013
    Messages:
    428
    Location:
    Germany
    Actually, couldn't you just stuff that link into a playlist file? That's common practice for internet radio streams afaik.
     
  6. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    11,100
    Location:
    Somewhere off the coast of the EU
    I just right click and either copy video link, or copy link location depending on how far the browser's got into loading the page. I can then paste that into mplayer or what have you. Granted, that's not entirely a graphical solution, but it might be enough. On pandora I think mplayer comes with the codec pack, but in case it's not up to date enough, the url to the media file should work in most up to date players.
     
  7. asimov-solensan

    asimov-solensan Member

    Joined:
    Jan 8, 2010
    Messages:
    487
    Because the link is generated on demand. I must do a http call that tells mumudvb to initialize the dialer in a specific frequency. Then the links become available.

    That's what I wrote in the fitst post. But I like to complicate things, you never know what you will learn with these kind of things.

    By the way I have been checking and seems that easiest way may be doing my own firefox extension.
     
    levi likes this.

Share This Page

Loading...