[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Wget cURL scheitern am HDHomeRun



Hallo Joachim,

On 25.04.20 15:54, Joachim Hartmann wrote:
> Wird die Seite im Browswe geöffnet und dann mit Seite speichern in deine
> Datei geschrieben, so findet man dieses:
> 
> ...
> <body>
>     <div class="B C">
>         <a href="http://mytv.zuhause.xx/";><div class="T">HDHo...
>         <div class="S">Channel Lineup<div id="scanProgress" s...
>         <div id="scanStatus" align="center"><button onclick="...
>     </div>
>     <div class="B C" style="background: #ccc">
>         <div class="T" id="channelBanner">Channels (189)</div>
>         <table id="channelTable">
> <tr>
>    <td><svg width="20px" height="15px"><use xlink:href="#icon_star" f...
>    <td><a href="http://192.168.0.140:5004/auto/v5000";>5000</a></td>
>    <td>SWR RP HD</td>
>    <td><svg width="40px" height="15px"><use xlink:href="#icon_h264"><...
> <tr>
> ...
> 
> Leider habe ich noch keinen Weg gefunden die Seite in dieser Form zu
> speichern. Das - künftige - Script soll auf einem Server ohne GUI laufen.
> Einer eine Idee?

Der Browser ersetzt relative Links durch absolute, das kann wget auch. Mit dem Parameter
 "-k" oder "--convert-links" aktivierst Du das, der passende Auszug aus der manpage wget(1):

--cut
      -k
       --convert-links
           After the download is complete, convert the links in the document
           to make them suitable for local viewing.  This affects not only the
           visible hyperlinks, but any part of the document that links to
           external content, such as embedded images, links to style sheets,
           hyperlinks to non-HTML content, etc.

           Each link will be changed in one of the two ways:

               The links to files that have been downloaded by Wget will be
               changed to refer to the file they point to as a relative link.

               Example: if the downloaded file /foo/doc.html links to
               /bar/img.gif, also downloaded, then the link in doc.html will
               be modified to point to ../bar/img.gif.  This kind of
               transformation works reliably for arbitrary combinations of
               directories.

               The links to files that have not been downloaded by Wget will
               be changed to include host name and absolute path of the
               location they point to.

               Example: if the downloaded file /foo/doc.html links to
               /bar/img.gif (or to ../bar/img.gif), then the link in doc.html
               will be modified to point to http://hostname/bar/img.gif.

           Because of this, local browsing works reliably: if a linked file
           was downloaded, the link will refer to its local name; if it was
           not downloaded, the link will refer to its full Internet address
           rather than presenting a broken link.  The fact that the former
           links are converted to relative links ensures that you can move the
           downloaded hierarchy to another directory.

           Note that only at the end of the download can Wget know which links
           have been downloaded.  Because of that, the work done by -k will be
           performed at the end of all the downloads.
--cut

Das sollte m.E. genau das sein, was du suchst.

hth,
Thomas


Reply to: