1
0
Sunny 2 rokov pred
rodič
commit
8c61d46cd1
3 zmenil súbory, kde vykonal 4 pridanie a 3 odobranie
  1. 1 0
      pages/index.php
  2. 1 1
      pages/release.php
  3. 2 2
      utilities/link.php

+ 1 - 0
pages/index.php

@@ -34,6 +34,7 @@
     $rules = [
       "https://$1.bandcamp.com/",
       "https://$1.bandcamp.com/album/$2",
+      "https://$1.bandcamp.com/track/$2",
       "https://bandcamp.com/search?q=$1",
       "https://f4.bcbits.com/img/$1",
       "https://t4.bcbits.com/stream/$1/mp3-128/$2?token=$3"

+ 1 - 1
pages/album.php → pages/release.php

@@ -1,7 +1,7 @@
 <?php
   require "../modules/querypath/src/qp.php";
 
-  $document = htmlqp(file_get_contents("https://" . urlencode($_GET["artist"]) . ".bandcamp.com/album/" . urlencode($_GET["name"])));
+  $document = htmlqp(file_get_contents("https://" . urlencode($_GET["artist"]) . ".bandcamp.com/" . urlencode($_GET["type"]) . "/" . urlencode($_GET["name"])));
   $json = json_decode($document->find("script[data-tralbum]")->attr("data-tralbum"));
 
   $title = $json->current->title;

+ 2 - 2
utilities/link.php

@@ -14,8 +14,8 @@
       return $base . "search.php?query=" . $query["q"];
     elseif (str_ends_with($host, ".bandcamp.com") && !$path)
       return $base . "artist.php?name=" . explode(".", $host)[0];
-    elseif (str_ends_with($host, ".bandcamp.com") && explode("/", $path)[0] === "album")
-      return $base . "album.php?artist=" . explode(".", $host)[0] . "&name=" . explode("/", $path)[1];
+    elseif (str_ends_with($host, ".bandcamp.com"))
+      return $base . "release.php?type=" . explode("/", $path)[0] . "&artist=" . explode(".", $host)[0] . "&name=" . explode("/", $path)[1];
     elseif ($host === "f4.bcbits.com")
       return $base . "image.php?file=" . basename($link);
     elseif ($host === "t4.bcbits.com")