jensb89 / Netflix-to-Trakt-Import

Synchronize/Import the viewing history from Netflix to trakt.tv
98 stars 21 forks source link

TMDB SSL Error #6

Closed Jamie0691 closed 2 years ago

Jamie0691 commented 2 years ago

Hi, excellent tool and just trying to get this up and running, have filled in the config file, when running the script however see the following errors.

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.themoviedb.org', port=443): Max retries exceeded with url: /3/search/tv?api_key=&query=Gotham&page=1&language=en (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))

I have tried to search this error with no real success, thanks in advance.

jensb89 commented 2 years ago

Hi Jamie, could it be that you didn't provide a API Key? The url points to "/3/search/tv?api_key=&query=Gotham ... ". Seems like the api key is empty.

Jamie0691 commented 2 years ago

Hi Jamie, could it be that you didn't provide a API Key? The url points to "/3/search/tv?api_key=&query=Gotham ... ". Seems like the api key is empty.

Hi Jens, sorry didn't see the reply. In the config.py file I pasted in the API key that was given by TMDB under the header TMDB_API_KEY =, I have wrapped the API key in "", is that correct?

Jamie0691 commented 2 years ago

Managed to get this working on another machine, however now seeing this error

Adding epsiode to trakt: Traceback (most recent call last): File "C:\Users\Jamie\Desktop\Netflix-to-Trakt-Import\netflix2trakt.py", line 163, in <module> time = datetime.datetime.strptime(watchedTime + ' 20:15', config.CSV_DATETIME_FORMAT + ' %H:%M') File "C:\Users\Jamie\AppData\Local\Programs\Python\Python310\lib\_strptime.py", line 568, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) File "C:\Users\Jamie\AppData\Local\Programs\Python\Python310\lib\_strptime.py", line 349, in _strptime raise ValueError("time data %r does not match format %r" % ValueError: time data '26.01.2019 20:15' does not match format '%d/%m/%Y %H:%M'

This is the config.py entry CSV_DATETIME_FORMAT = "%d/%m/%Y" This is an example of the netflix export Title,Date "United 93","21/02/2022"

jensb89 commented 2 years ago

Hi Jamie, the error is "26.01.2019 20:15' does not match format '%d/%m/%Y %H:%M".

Could you please try to change the format string in the config to %d.%m.%Y ? So just change the / to .

This could be a bug indeed, seems like the "/" are converted internally already to dots. If it works with dots I can create a general fix so it will work with the / as well.

Please let me know if it helps :)

Jamie0691 commented 2 years ago

Hi Jamie, the error is "26.01.2019 20:15' does not match format '%d/%m/%Y %H:%M".

Could you please try to change the format string in the config to %d.%m.%Y ? So just change the / to .

This could be a bug indeed, seems like the "/" are converted internally already to dots. If it works with dots I can create a general fix so it will work with the / as well.

Please let me know if it helps :)

Changing the / to a . in the CSV file worked, thanks again for an excellent tool! Just wish the other streaming platforms you could export from and then could use this on them all!

jensb89 commented 2 years ago

Awesome, glad it worked :) I will work on a general fix for this problem when I can find some spare time.

Yeah, unfortunately, most other streaming platforms don't provide just a nice log, at least the few I checked :(