Scraping from TMDB based on the IMDB Id (Kodi 21.1)
#1
While scraping my movies from TMDB with the Python scraper using the IMDB Id inside the filename, Kodi switch to a search based on the name and year for 2 files.
The 2 files are :
Family Guy Presents - Something, Something, Something, Dark Side (2009) {imdb=tt1329665} - ENFR - (STENFR).mkv
The School for Good and Evil (2022) {imdb=tt2935622} - FR.mkv
In these 2 cases,
- The IMDB Id have been verified.
- It is stored in the TMDB database.
All my movies are based on this naming schema : "name (year) {imdb=id} - languages.ext" and this is apparently working correctly for all of them (around 16000) except this 2.

The complete uploaded logfile (https://paste.kodi.tv/apazefohoh.kodi) contain the scraping of 3 movies :
- one working correctly, included to be able to compare.
--- 28 Days (2000) {imdb=tt0191754} - ENFR - (STENFR).mkv (going from line 2679 to line 2913)
- the 2 with bad behavior :
--- Family Guy Presents - Something, Something, Something, Dark Side (2009) {imdb=tt1329665} - ENFR - (STENFR).mkv (going from line 2921 to line 3156)
--- The School for Good and Evil (2022) {imdb=tt2935622} - FR.mkv (going from line 3174 to line 3444)

For these 2 movies, this is not critical as there are no duplicate using the name and the year, but this will not be the same if this happen when there is a duplicate.

What is blocking the scraper from using the IMDB Id in these cases ?
Reply
#2
(2024-10-11, 16:56)jkirsch Wrote: Family Guy Presents - Something, Something, Something, Dark Side (2009) {imdb=tt1329665} - ENFR - (STENFR).mkv
The School for Good and Evil (2022) {imdb=tt2935622} - FR.mkv
In these 2 cases,
- The IMDB Id have been verified.
- It is stored in the TMDB database.
Seems there is a glitch at TMDB. Click on the following links and see where they take you. Note the imdb id's at the end of the URL.
You would need to report this to TMDB...

https://www.themoviedb.org/redirect?exte...=tt1329665
https://www.themoviedb.org/redirect?exte...=tt2935622

Try one of your working IMDB ID's to confirm the url works.
You would be better off using the TMDB ID's instead of the IMDB ID's as there is never a guarantee that the IMDB's are recorded.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#3
Don't know anything about the scraper, but looking at the linked log I see:
Code:
Calling URL "https://api.themoviedb.org/3/movie/tt0191754?...

According to the tmdb api https://developer.themoviedb.org/referen...ie-details that's not a valid endpoint.  Has to be a tmdb id (integer).

What I do in script.extendedinfo (also queries tmdb) is use this query:
Code:
api.themoviedb.org/3/find/{external_id}
to get the tmdb, then query the /movie/ endpoint.

scott s.
.
Reply
#4
(2024-10-11, 21:43)scott967 Wrote: Don't know anything about the scraper, but looking at the linked log I see:
Code:
Calling URL "https://api.themoviedb.org/3/movie/tt0191754?...

According to the tmdb api https://developer.themoviedb.org/referen...ie-details that's not a valid endpoint.  Has to be a tmdb id (integer).
Even if it is not documented, this type of link is normally perfectly working for movies (this is not the case for series).
Reply
#5
(2024-10-11, 20:55)Karellen Wrote: Seems there is a glitch at TMDB. Click on the following links and see where they take you. Note the imdb id's at the end of the URL.
You would need to report this to TMDB...

https://www.themoviedb.org/redirect?exte...=tt1329665
https://www.themoviedb.org/redirect?exte...=tt2935622

Try one of your working IMDB ID's to confirm the url works.
You would be better off using the TMDB ID's instead of the IMDB ID's as there is never a guarantee that the IMDB's are recorded.
My bad... I didn't thought of checking if these 2 links were working correctly.
I'm going to post them in our internal forums at TMDB.
Thank you.

I know that it would be better to use the TMDB Id, but my movie files include historically the IMDB Id, and it will take too much time to change them all. When I sort my movies, I add the IMDB Id to TMDB if it is missing.

For the series, which doesn't have such history, I'm directly going with the TMDB Id.
Reply
#6
(2024-10-11, 22:13)jkirsch Wrote: My bad... I didn't thought of checking if these 2 links were working correctly.
No problems. Checking the API response is not something most people will know how to do.
You check the edit screen for the movie, see the correct ID, then just expect it will work not realising there is a problem with the API.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#7
Message posted.

These 2 Ids were catched because they are redirecting to a series page (for the first) and a non-existing page (for the second).

An Id redirecting to a wrong movie page wouldn't have been automatically detected.
I think that I will have to verify all of them.
I plan to do it with the tvshow_view (I'm on MySQL) to compare for each the start of my filenames with the name detected.
Reply
#8
I mean the movie_view.
Reply
#9
(2024-10-11, 22:50)jkirsch Wrote: An Id redirecting to a wrong movie page wouldn't have been automatically detected.
Can't Travis program an integrity check? It's not the first time this issue has cropped up which is why I quickly knew what to check.
I am guessing there is a "deleted flag" or similar that can be verified- maybe it runs once a week or so?
Are you a mod there?
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#10
(2024-10-11, 23:17)Karellen Wrote: Can't Travis program an integrity check? It's not the first time this issue has cropped up which is why I quickly knew what to check.
I am guessing there is a "deleted flag" or similar that can be verified- maybe it runs once a week or so?
Are you a mod there?

For the moment, I'm waiting for his answer. I don't know the technical part.

Yes, I'm a mod there, but with a different nick than here.
Reply
#11
I didn't get a direct answer by Travis yet, but, with other mods, we have analyzed these 2 cases.

For the second one, this should come from an old bug.where the IMDB Id remain attached to a deleted movie.
Using the /find method instead of directly using the IMDB Id find only the correct entry (https://paste.kodi.tv/fimoyijujo).

For the first case, this is a special case when an entry is at the same time a movie and an episode of a series.
Using directly the IMDB Id in that case has an erratic content. Using the /find method return the 2 results (https://paste.kodi.tv/eqiyejufet) and it is possible to choose the movie.
I've suggested to force the return of the movie when the IMDB Id was directly use as this only work for movies, but I was redirected to an old (2021) Travis answer here : https://www.themoviedb.org/talk/60e4ad5c...001e676b62

So, it's unlikely that there will be evolutions and/or corrections to this way to call the API and I can only suggest to switch to the use of /find even if that imply one more call to the API per movie.

On my personal side, once I finish to create the sources for all my movies, I will use the movies table from MySQL to get all the associations between IMDB Id and TMDB Id and automate the rename process. I'm still studying what is the best method to rename the associated files (mainly subtitles).
Reply
#12
@jkirsch

Thanks for the follow up.

(2024-10-14, 19:22)jkirsch Wrote: For the first case, this is a special case when an entry is at the same time a movie and an episode of a series.
I guess this depends on which item had the IMDB ID added to it first as duplicate IMDB ID's are not allowed.
But strange that it takes you to a completely unrelated show.

(2024-10-14, 19:22)jkirsch Wrote: For the second one, this should come from an old bug.where the IMDB Id remain attached to a deleted movie.
Yea, I guessed that was the issue here when I saw the "page not found"
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#13
(2024-10-16, 02:15)Karellen Wrote:
(2024-10-14, 19:22)jkirsch Wrote: For the first case, this is a special case when an entry is at the same time a movie and an episode of a series.
I guess this depends on which item had the IMDB ID added to it first as duplicate IMDB ID's are not allowed.
But strange that it takes you to a completely unrelated show.
In this case, the IMDB Id is on the 2 entries. Duplicate IMDB Id aren't allowed inside the movies table or inside the TV table, but you can have the same Id in the 2 tables.
But, we don't know why the redirect choose this show and not the one that contains the episode.

The main cases when this can happen are listed here : https://www.themoviedb.org/bible/new_con...3e9300000a , specifically the first 2 (In the 3rd case, there are generally 2 separate IMDB entries.
Here, we are in a variation of the 2nd case : even if it's not an anthology series, the episode was released on DVD before being broadcasted as part of the series.
Reply
#14
(2024-10-16, 08:51)jkirsch Wrote: but you can have the same Id in the 2 tables.
Oh, I didn't know that.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#15
(2024-10-14, 19:22)jkirsch Wrote: On my personal side, once I finish to create the sources for all my movies, I will use the movies table from MySQL to get all the associations between IMDB Id and TMDB Id and automate the rename process. I'm still studying what is the best method to rename the associated files (mainly subtitles).
I have renamed all my movie files to use the TMDB Id instead of the IMDB Id and restarted the scrap process from scratch... Hoping that all goes well... We will know in approx 24 hours...
Reply

Logout Mark Read Team Forum Stats Members Help
Scraping from TMDB based on the IMDB Id (Kodi 21.1)0