[FIX] strip HOST in urls

pull/32/head
Boris 1 year ago
parent 840bdedc2d
commit 892641bfac
  1. 4
      www/boris/youtube.php
  2. 3
      www/boris/youtube_watch.php
  3. 8
      www/boris/youtube_watch_step2.html
  4. 8
      www/boris/youtube_watch_step3.html
  5. 16
      zen/new_file_in_astroport.sh

@ -16,8 +16,7 @@ foreach ($videos as $v) {
list($category, $videoID, $p3, $videoName, $p5, $src, $p7, $definition, $videoURI) = explode(";", $v);
$videoURL = 'http://'. HOST. $videoURI;
$videoEco = 'http://'. HOST. '/ipns/' . $p7;
$videoEco = '/ipns/' . $p7;
$mimeType = guessTypeFromFilename($videoURI);
@ -38,7 +37,6 @@ foreach ($videos as $v) {
'thumbURL' => $thumbURL,
'category' => $category,
'mime' => $mimeType,
'url' => $videoURL,
'eco' => $videoEco,
'uri' => $videoURI,
'name' => $videoName,

@ -2,7 +2,8 @@
require_once('functions.php');
require_once('conf.php');
$videoURL = 'http://'. HOST. htmlentities($_GET['uri']);
//$videoURL = 'http://'. HOST;
$videoURL = htmlentities($_GET['uri']);
$videoName = htmlentities(urldecode($_GET['name']));
$videoMIME = htmlentities($_GET['mime']);

@ -4,13 +4,13 @@
<title>$TITLE in Astroport</title>
<meta charset="UTF-8">
<meta http-equiv="Refresh" content="7;URL=http://astroport/ipns/$IPNSLINK/${G1PUB}/">
<link rel='stylesheet' href='http://astroport/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='http://astroport/styles/astroport/logo.png' />
<link rel='stylesheet' href='/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
</head>
<body>
<header>
<h6>
<a href='http://astroport/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
<a href='/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
</h6>
</header>
<main>
@ -50,4 +50,4 @@
</article>
</main>
</body>
</html>
</html>

@ -3,8 +3,8 @@
<head>
<title>$TITLE in Astroport</title>
<meta charset="UTF-8">
<link rel='stylesheet' href='http://astroport/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='http://astroport/styles/astroport/logo.png' />
<link rel='stylesheet' href='/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
</head>
<body>
<header>
@ -16,8 +16,8 @@
<main>
<article>
<video autoplay="autoplay" controls>
<source src="http://astroport/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">
<a href="http://astroport/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">$TITLE</a>
<source src="/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">
<a href="/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">$TITLE</a>
</video>
<h1 class="video-title">

@ -298,13 +298,13 @@ cat >~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html <<EOF
<title>$TITLE in Astroport</title>
<meta charset="UTF-8">
<meta http-equiv="Refresh" content="7;URL=http://astroport/ipns/$IPNSLINK/${G1PUB}/">
<link rel='stylesheet' href='http://astroport/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='http://astroport/styles/astroport/logo.png' />
<link rel='stylesheet' href='/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
</head>
<body>
<header>
<h6>
<a href='http://astroport/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
<a href='/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
</h6>
</header>
<main>
@ -344,7 +344,7 @@ cat >~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html <<EOF
</article>
</main>
</body>
</html>
</html>
EOF
@ -358,8 +358,8 @@ cat > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html <<EOF
<head>
<title>$TITLE in Astroport</title>
<meta charset="UTF-8">
<link rel='stylesheet' href='http://astroport/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='http://astroport/styles/astroport/logo.png' />
<link rel='stylesheet' href='/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
</head>
<body>
<header>
@ -371,8 +371,8 @@ cat > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html <<EOF
<main>
<article>
<video autoplay="autoplay" controls>
<source src="http://astroport/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">
<a href="http://astroport/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">$TITLE</a>
<source src="/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">
<a href="/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">$TITLE</a>
</video>
<h1 class="video-title">

Loading…
Cancel
Save