1
0
Prechádzať zdrojové kódy

Simplify redirection setup

Sunny 2 rokov pred
rodič
commit
9dc52eea1f
2 zmenil súbory, kde vykonal 2 pridanie a 3 odobranie
  1. 1 2
      pages/index.php
  2. 1 1
      utilities/link.php

+ 1 - 2
pages/index.php

@@ -33,8 +33,7 @@
   <?php
     $rules = [
       "https://$1.bandcamp.com/",
-      "https://$1.bandcamp.com/album/$2",
-      "https://$1.bandcamp.com/track/$2",
+      "https://$1.bandcamp.com/$2/$3",
       "https://bandcamp.com/search?q=$1",
       "https://f4.bcbits.com/img/$1",
       "https://t4.bcbits.com/stream/$1/$2/$3?token=$4"

+ 1 - 1
utilities/link.php

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