Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix episode listing #319

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Fixing the issue of receiving episode information
  • Loading branch information
mam4dali committed Sep 27, 2024
commit 7fe3575946095db565b3b02f5f7176efddddbcc8
4 changes: 3 additions & 1 deletion src/Imdb/Title.php
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,8 @@ public function episodes()

$buildId = $this->getBuildId();

$lang = !empty($this->config->language) ? $this->config->language : 'en-US';

foreach ($liElements as $li) {
$textContent = $li->textContent;
if(!is_numeric($textContent)){
Expand All @@ -2080,7 +2082,7 @@ public function episodes()
$id = 'tt'.$this->imdbid();
$action = $selectId == 'byYear' ? 'year' : 'season';

$url = "/_next/data/{$buildId}/title/{$id}/episodes.json?{$action}={$textContent}&tconst={$id}";
$url = "/_next/data/{$buildId}/{$lang}/title/{$id}/episodes.json?{$action}={$textContent}&tconst={$id}";
$req = new Request("https://" . $this->imdbsite . $url, $this->config);
$success = $req->sendRequest();
if ($success) {
Expand Down