aboutsummaryrefslogtreecommitdiffstats
path: root/resolver.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2025-12-14 17:03:14 -0500
committerlolcat <will@lolcat.ca>2025-12-14 17:03:14 -0500
commit0243e4edf21e7cdf09cfce9035bbca8ee3dd0076 (patch)
tree759367a6f20c0db29534f29f872200713f504bbb /resolver.php
parentfd155b192e507752f4c6268547f7a81fb09986b8 (diff)
bypass soundclouds recent bullshit
Diffstat (limited to 'resolver.php')
-rw-r--r--resolver.php66
1 files changed, 66 insertions, 0 deletions
diff --git a/resolver.php b/resolver.php
new file mode 100644
index 0000000..cf7173d
--- /dev/null
+++ b/resolver.php
@@ -0,0 +1,66 @@
+<?php
+
+$resolver = new resolver();
+
+class resolver{
+
+ public const resolvers = [
+ "sc"
+ ];
+
+ public function __construct(){
+
+ include "data/config.php";
+
+ if(
+ !isset($_GET["scraper"]) ||
+ !is_string($_GET["scraper"]) ||
+ !in_array($_GET["scraper"], self::resolvers)
+ ){
+
+ $this->do400("Missing or invalid scraper");
+ return;
+ }
+
+ if(
+ !isset($_GET["target"]) ||
+ !is_string($_GET["target"])
+ ){
+
+ $this->do400("Missing or invalid target");
+ return;
+ }
+
+ $scraper = $_GET["scraper"];
+ $target = $_GET["target"];
+
+ try{
+
+ include "resolver/{$scraper}.php";
+ $resolver = new $scraper();
+ $link = $resolver->resolve($target);
+
+ if(is_string($link)){
+
+ header("Location: {$link}");
+ }
+ }catch(Exception $error){
+
+ $this->do404("Fuck! Failed to resolve URL: " . $error->getMessage());
+ }
+ }
+
+ public function do400($message){
+
+ header("Content-Type: text/plain");
+ http_response_code(400);
+ echo $message;
+ }
+
+ public function do404($message){
+
+ header("Content-Type: text/plain");
+ http_response_code(404);
+ echo $message;
+ }
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage