xbmc / metadata.tvshows.themoviedb.org.python

themoviedb.org TV Show scraper in Python for Kodi 18 (Leia) or later.
GNU General Public License v3.0
20 stars 26 forks source link

Leia_ Add Tv Show Trailer #32

Closed tielis closed 3 years ago

tielis commented 3 years ago

This PR is quite different from the one in Matrix.

First, when I was testing Leia, I randomly found one broken trailer link. Then I discovered that the trailer_check function is working great when catching videos that does not exist, however there are some videos not available only in some counties, but they are good link in other countries, and the trailer_check function would not catch these videos if you are in one of those not-available countries. For example in my country, the majority of "Better Call Saul" trailers are unavailable here, but the trailer_check func. is approving them. So I came up with another solution and now I am not using that "oembed YouTube" link anymore, instead I am using the normal YouTube link.

Second, to make the function more efficient, the condition if result.get('type') == 'Trailer' is coming before the link is actually tested. Only if it doesn't find any "perfect" link that it will look for backups.

Please let me know your thoughts, then I can make the changes in Matrix or here.