diff --git a/src/Torrentio/Client/HttpClient.php b/src/Torrentio/Client/HttpClient.php index 98defb7..c421ced 100644 --- a/src/Torrentio/Client/HttpClient.php +++ b/src/Torrentio/Client/HttpClient.php @@ -13,7 +13,7 @@ class HttpClient { private GuzzleClient $client; - private string $baseUrl = 'https://torrentio.strem.fun/realdebrid=%s/stream/movie/'; + private string $baseUrl = 'https://torrentio.strem.fun/realdebrid=%s/'; public function __construct( #[Autowire(env: 'REAL_DEBRID_KEY')] private string $realDebridKey, @@ -27,7 +27,7 @@ class HttpClient public function get(string $imdbId, array $cacheTags = []): array { - $cacheKey = "torrentio.{$imdbId}"; + $cacheKey = str_replace(":", ".", "torrentio.{$imdbId}"); return $this->cache->get($cacheKey, function (ItemInterface $item) use ($imdbId, $cacheTags) { $item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0)); @@ -35,7 +35,7 @@ class HttpClient $item->tag($cacheTags); } try { - $response = $this->client->get("$imdbId.json"); + $response = $this->client->get("stream/movie/$imdbId.json"); return json_decode( $response->getBody()->getContents(), true diff --git a/src/Torrentio/Client/Torrentio.php b/src/Torrentio/Client/Torrentio.php index 631acc4..dc2d62b 100644 --- a/src/Torrentio/Client/Torrentio.php +++ b/src/Torrentio/Client/Torrentio.php @@ -26,7 +26,7 @@ class Torrentio public function fetchEpisodeResults(string $imdbId, int $season, int $episode, bool $parseResults = true): array { $cacheTags = ['torrentio', 'tvshows', 'torrentio.tvshows', $imdbId, "torrentio.$imdbId", "$imdbId.$season", "torrentio.$imdbId.$season", "$imdbId.$season.$episode", "torrentio.$imdbId.$season.$episode"]; - $results = $this->client->get($imdbId, $cacheTags); + $results = $this->client->get("$imdbId:$season:$episode", $cacheTags); if (null === $results) { throw new TorrentioRateLimitException();