elgatito / plugin.video.elementum

Elementum add-on for Kodi. Development of this addon has been stopped!
http://elementum.surge.sh
MIT License
483 stars 159 forks source link

TMDB check failed #1027

Closed ajay01994 closed 5 months ago

ajay01994 commented 6 months ago

Hi,

I haved been facing issue with TMDB chcek failed could you help me

Here is the log file - Paste url:

https://paste.kodi.tv/xuyitibupa

antonsoroko commented 6 months ago

@ajay01994 Log says

dial tcp 49.44.79.236:443: connect: connection timed out

But this ip does not look like TMDB IP address. https://www.whois.com/whois/49.44.79.236

Try to open https://api.themoviedb.org/3/movie/550 from the device where Kodi is installed, so you will see if this is your internet provider issue or not. Also try to use VPN, again it will show if it is ISP issue or not.

ajay01994 commented 6 months ago

Hi , Thanks for the response

I am running elementum on librelec kodi v 20.2 on RPI 4B . That IP Address is of my ISP . How to resolve the issue ?

antonsoroko commented 6 months ago

First of all, do what I already asked you to do:

  1. Try to open https://api.themoviedb.org/3/movie/550 from the device where Kodi is installed, so you will see if this is your internet provider issue or not. If you can't run browser in RPI then open browser on device which is in the same network with RPI.

  2. Also try to use VPN, again it will show if it is ISP issue or not.

  3. Do host api.themoviedb.org or dig api.themoviedb.org on your RPI device to see what IP address your DNS server gives for tmdb API servers.

  4. Change your DNS servers to google/cloudflare/quad9 DNS in OS settings or in elementum settings, reboot and see if you still have error.

Write your results here.

ajay01994 commented 6 months ago

Hi Thanks for the detailed steps

So for pt 1. https://api.themoviedb.org/3/movie/550. This is not opening in my network..i checked on other network also and its not opening

Pt 2. Currently i don't have VPN

Pt 3. Same both the links are not opening i.

Pt 4. Yes i tried this but same issue still persists

Thanks let me know what else can be done?

Just an update. Its blocked in my country India

https://forum.moviebase.app/t/indian-government-has-blocked-tmdb/1874

Some ppl who tried different solutions-https://github.com/movie-web/movie-web/pull/1108

antonsoroko commented 6 months ago

@ajay01994 This is interesting. The tmdb itself blocks some countries, but you have the opposite situation.

  1. Try to open that https://api.tmdb.org/3/ url (I took it from the link you provided), to be sure that it actually works for users in India. If it works - then maybe @elgatito can implement the workaround.
  2. About "Pt 3" - I meant run those commands in Linux terminal (libreelec is Linux).
  3. but if you changed dns servers and it did not help then it does not matter much. Right now the only immediate solution for you is to use VPN or proxy.
antonsoroko commented 6 months ago

@ajay01994 so?

ajay01994 commented 6 months ago

Hi , just checking a more feasible solution..

antonsoroko commented 6 months ago

@ajay01994 can you please simply open that https://api.tmdb.org/3/ url in your browser? (So we will know if this workaround works or not.)

ajay01994 commented 6 months ago

Hi this is an API link ,does this link open in your browser ? the exact same link ? does this open too Some ppl who tried different solutions-https://github.com/movie-web/movie-web/pull/1108 ? which i mentioned above ?

antonsoroko commented 6 months ago

@ajay01994 i am asking you to open this https://api.tmdb.org/3/ link in your browser to test if it works in India.

(Yes, as i wrote above, i took that alternative link to tmdb api from the issue you posted.)

this alternative API link works for me, but i am not in India.

thus i am asking you to see if this link works for you/India. please just open in it browser and say if you see something like {"status_code":7,"status_message":"Invalid API key: You must be granted a valid key.","success":false}

or open https://api.tmdb.org/3/movie/550 - it does not matter.

ajay01994 commented 6 months ago

Hi , yes it works - https://api.tmdb.org/3/movie/550 - i see this -

{"status_code":7,"status_message":"Invalid API key: You must be granted a valid key.","success":false}

antonsoroko commented 6 months ago

@ajay01994 nice, thanks. so we can make an easy fix, we can let user to specify alternative url for TMDB api in elementum's settings.

@elgatito i guess we also can make some check that will determine which api link is working for user, but since this issue only for part of India (not for all countries or even for all India) i think just an option to set alternative URL is enough. although user must to open settings and find this option, not sure if all users will be smart enough to do that. so maybe auto fix is better.

i mean, i can make a simple fix. but not sure how to make an "auto" fix.

ajay01994 commented 6 months ago

Hi @antonsoroko - This issue is with the largest internet service provider in india called "jio" . So a wide majority of ppl would be affected ,especially in major metro cities , Jio is sort of. state owned company , here policies are much similar to Russia where Govt keeps control of companies but all freedom is given only one should adhere to law . so if a better / proper auto fix could happen, That would be great !

burekas7 commented 6 months ago

@elgatito @antonsoroko I have this error too.

Log: https://paste.ubuntu.com/p/b8fwSJnHsj/plain

version: 102

elgatito commented 6 months ago

@burekas7 It is interesting:

2024-05-06 03:08:45.400 T:13524 warning <general>: [plugin.video.elementum] ERRO  reqapi       в–¶ func2            Bad status getting tmdb api key check with map[api_key:[ecbc86c92da237cb9faff6d3ddc4be6d]] on https://api.themoviedb.org/3/movie/550: 401/401 Unauthorized
2024-05-06 03:08:45.400 T:13524 warning <general>: [plugin.video.elementum] ERRO  tmdb         в–¶ tmdbCheck        HTTP error
2024-05-06 03:08:45.799 T:13524 warning <general>: [plugin.video.elementum] WARN  tmdb         в–¶ CheckAPIKey      TMDB API key failed: ecbc86c92da237cb9faff6d3ddc4be6d
...
2024-05-06 03:08:45.958 T:13524 warning <general>: [plugin.video.elementum] NOTI  tmdb         в–¶ CheckAPIKey      TMDB API key check passed, using ae4bd1b...

In your case you have custom key defined in Elementum properties, which is reported as not valid: ecbc86c92da237cb9faff6d3ddc4be6d

burekas7 commented 6 months ago

@elgatito Yes, you are right. Because with my previous version (0.1.99) I used with the same key there wasn't an error.

elgatito commented 6 months ago

@burekas7 Hard to say, there were no changes in checking TMDB keys, maybe that is a coincidence:

curl --request GET --url 'https://api.themoviedb.org/3/movie/550?api_key=ecbc86c92da237cb9faff6d3ddc4be6d'
{"status_code":7,"status_message":"Invalid API key: You must be granted a valid key.","success":false}
antonsoroko commented 6 months ago

@burekas7 this issue is about the fact that TMDB is blocked in India (and we can try to use alternative url to bypass this block) which is obvious from conversation above. i do not know why you decided to write here instead of creating new issue :-) anyway, as you can see from the message above - tmdb api says that your key is invalid. check status of your api key in tmdb website (probably here), maybe it expired or was deleted.

antonsoroko commented 6 months ago

@elgatito what do you think about adding https://api.tmdb.org/3/ as a fallback url?

we can add it as an manual option in settings (easy solution, i can do it, but most likely majority of users will never find it) or add new function to test api urls, like we have for api keys (but i man not sure how to implement this beautifully ).

elgatito commented 6 months ago

@antonsoroko I added endpoint detection to the code and localized messages to write what is happening. Can't test though, as I don't have blocks.

antonsoroko commented 6 months ago

i added that https://49.44.79.236/3 from user's log to the beginning of the list in tmdbCheckDomain() and it was skipped - so i think your fix works.

antonsoroko commented 6 months ago

@ajay01994 please install and test ~this build plugin.video.elementum-v0.1.102-6-g1911888.linux_armv7.zip~ v0.1.103

if TMDB check will fail again - please create log file with debug enabled, see https://elementum.surge.sh/contribute/log/

elgatito commented 6 months ago

@ajay01994 Elementum v0.1.103 was released with a fix to this issue.

ajay01994 commented 6 months ago

Hi @elgatito thanks for your efforts..i will check and upload the logs

ajay01994 commented 5 months ago

Hi ,

@elgatito and @antonsoroko. Thank you so much guys ... The issue is finally resolved!

ajay01994 commented 5 months ago

Hi guys the TMDB issue is now resolved however elementum burst doesn't show up much links although i have added a lot of providers still its does not load for even popular shows

Please find the log file ljnk for your reference Paste url: https://paste.kodi.tv/unenuxafac

elgatito commented 5 months ago

If you believe you have issues with Burst - create issues in Burst repository.

antonsoroko commented 5 months ago

@ajay01994 it looks like your IPS is banning all popular english torrent trackers. try some unpopular ones, then also try russians trackers - just to test if they also blocked.

in your log in the end you can see that instead of real IP addresses you again get that get https://www.whois.com/whois/49.44.79.236

anyway, create an issue in burst repo.