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

Trailer method in Title class is broken #328

Open
jcvignoli opened this issue Feb 26, 2024 · 5 comments
Open

Trailer method in Title class is broken #328

jcvignoli opened this issue Feb 26, 2024 · 5 comments

Comments

@jcvignoli
Copy link

Just tested with "2001, a space odyssey".

No trailer is found, despite there are many:

https://www.imdb.com/title/tt0062622/videogallery/content_type-trailer

@duck7000
Copy link
Contributor

duck7000 commented Feb 26, 2024

Well.. imdb changed the trailer page, so this is to be expected.

if anyone is interested in fixing this the right way here is the query i use:

            $query = <<<EOF
query Video(\$id: ID!) {
  title(id: \$id) {
    primaryVideos(first: 9999) {
      edges {
        node {
          playbackURLs {
            url
          }
          thumbnail {
            url
            width
            height
          }
          runtime {
            value
          }
          contentType {
            displayName {
              value
            }
          }
          primaryTitle {
            titleText {
              text
            }
          }
        }
      }
    }
  }
}
EOF;

Figure out the rest yourself as it works the same as other GraphQL methods.
It includes other info as well but you can strip that out of you don't want it.

My trailer method is different but you can look at it as a reference

As a courtesy to show that i DO care and respect this project and maintainers.

And if anyone wonders why this is in my method:
$title = rawurlencode(rawurlencode($edge->node->primaryTitle->titleText->text));
That is because imdb has the habit to double rawurlencode the url (normally %20 == space but imdb uses %2020) Don't ask why as it is beyond me but they want to urlencode a urlencoded string just to be save i guess.

@jcvignoli
Copy link
Author

Thanks @duck7000, I actually already implemented your graphql method in my own fork. Just took out the get_headers() check which takes forever on my environnement, don't know why.

@duck7000
Copy link
Contributor

duck7000 commented Feb 26, 2024

Get_headers will check if the found url can be used as embedded url in an iframe, not all urls are allowed to do so.
Why that takes a long time in your environment is beyond me as it works fast at my server.

It wonders me though why you add this issue here but use your own fork?

@jcvignoli
Copy link
Author

Well, because I'm not a developper, and true developpers do a better work than me :)

@duck7000
Copy link
Contributor

I'm not a true developer either hah

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

2 participants