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

Filmography and photo returns empty for some people #286

Closed
robertorodriguezgarcia opened this issue Nov 17, 2022 · 16 comments
Closed

Filmography and photo returns empty for some people #286

robertorodriguezgarcia opened this issue Nov 17, 2022 · 16 comments

Comments

@robertorodriguezgarcia
Copy link

I'm using latest Imdbphp dev revision

For some people don't get the photo and filmography. Ex: Brad Pitt, Hugh Laurie, Olivia Cooke, Leonardo DiCaprio, Tom Hanks...

@tboothman
Copy link
Owner

Who does get a photo and filmography?

@robertorodriguezgarcia
Copy link
Author

I mean in obtaining info in person.php
olivia

@GeorgeFive
Copy link

There has been a code change, and at a quick glance, it definitely affects images.

@Thomasdouscha
Copy link

Thomasdouscha commented Dec 2, 2022 via email

@GeorgeFive
Copy link

GeorgeFive commented Dec 3, 2022

This can more than likely be done much more efficiently, but this was what I came up with on short notice. Do note that the images will now be smaller, but this didn't affect my usage case.

Person.php
function photo

if (preg_match('!ipc-media--poster-m ipc-poster__poster-image ipc-media__img" style="width:100%"><img alt="(.*?)" class="ipc-image" loading="eager" src="(.*?)"!ims', $this->page["Name"], $match)) {

if ($thumb) {
$this->main_photo = $match[2];

@robertorodriguezgarcia
Copy link
Author

This issue not only happens with the photos, you can't get the filmography either.
Examples: Leonardo DiCaprio, Olivia Cooke, Halle Berry, Chris Hemsworth, Robert Downey Jr., Mark Ruffalo...

@Thomasdouscha
Copy link

It start to be terrible that cover photo of person. Where is @duck7000 ? Please help us.

@Thomasdouscha
Copy link

@Thomasdouscha I have build my own version of imdbphp because the maintainers here are resistent, don't look at PR's and if they do (after sometimes years) they respond with "i don't understand what you changed" You did notice that @tboothman did responded to this thread with a question but after that it is silent and no solution is even thought about i guess.. I mean if you are the maintainer of this repo, then MAINTAIN it, especially when somebody reports a problem. So i decided to leave this repo, and i'm sorry for all the good people here who appreciated my work. Feel free to use my version but it is very much stripped down for my needs, so person is completely removed.

It is a very pity ! you are very useful and helper man :) I really really worried about that. I looked at your repo and s you said that is very much stripped down unfortunately myself. I hope that you will add some components as person.php.

@duck7000
Copy link
Contributor

duck7000 commented Dec 8, 2022

Imdb is/finished redesign the person pages so i think that the whole person class eventually will fail

So your best hope is that the maintainer(s) will pick this up. I'm not going to as i have no interest in this, sorry
If that changes in the future i will add it to my stripped down version.

@duck7000
Copy link
Contributor

duck7000 commented Dec 9, 2022

Well the photo was a easy fix so change the existing method photo() with this:
Thumb is now 140x207, big is 304x400

    #--------------------------------------------------------[ Photo specific ]---

    /** Get cover photo
     * @param optional boolean thumb get the thumbnail (140x207, default) or the
     *        bigger variant (304x400 - FALSE)
     * @return mixed photo (string url if found, FALSE otherwise)
     * @see IMDB person page / (Main page)
     */
    public function photo($thumb = true)
    {
        if (empty($this->main_photo)) {
            $this->getPage("Name");
            if (preg_match('!<div.*?class="sc-21f2de71-7 kvyqcm".*?>*.*?<img.*?src="(.*?)"!ims', $this->page["Name"], $match)) {
                if ($thumb) {
                    $this->main_photo = $match[1];
                } else {
                    $this->main_photo = str_replace('._V1_QL75_UY207_CR9,0,140,207_', '._V1_', $match[1]);
                }
            } else {
                return false;
            }
        }
        return $this->main_photo;
    }

@duck7000
Copy link
Contributor

duck7000 commented Dec 9, 2022

Filmograf appears to be a page change

In person.php:
Change line 253 with: $page = $this->getPage("Fullcredits");

replace protected function getUrlSuffix() with:

    protected function getUrlSuffix($pageName)
    {
        switch ($pageName) {
            case "Name"        :
                $urlname = "/";
                break;
            case "Bio"         :
                $urlname = "/bio";
                break;
            case "Publicity"   :
                $urlname = "/publicity";
                break;
            case "Fullcredits"   :
                $urlname = "/fullcredits";
                break;
            default            :
                throw new \Exception("Could not find URL for page $pageName");
        }
        return $urlname;
    }

This should add back all functions but it is a simple fix and can/will break again i guess

@robertorodriguezgarcia
Copy link
Author

Thank you very much @duck7000 :)

@duck7000
Copy link
Contributor

@robertorodriguezgarcia Thanks but i shouldn't be doing this, it is a shame that the maintainer(s) didn't do anything!

@Thomasdouscha
Copy link

Yes , you shouldn't be doing this. But you did, thanks for it.
In my oppinion you should keep to support it . May be maintainers have some problems about time or jobs may be they are very busy. Try to talk them.

@duck7000
Copy link
Contributor

@Thomasdouscha
Well i tried many times, politely or otherwise but somehow they refuse anything that is no problem to them or they deny that there is a problem.
And yes they maybe busy but be honest about that (@jreklund did, so he is honest about that) At the other hand if you are saying that you are maintain this repo why don't they do it then?
Or at least admit openly that @tboothman is not going to maintain this repo.
It feels to me like an up hill battle, that's why i created my own version

@jreklund
Copy link
Collaborator

jreklund commented Jan 7, 2023

Solved in v7.4.0+

@jreklund jreklund closed this as completed Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants