TheTVDB could not connect (banned in China)

Any questions? Need some help?
Post Reply
xuewy
Posts: 13
Joined: 06 Mar 2019, 14:06

TheTVDB could not connect (banned in China)

Post by xuewy » 08 Jul 2019, 08:12

I use a Filebot Node in my Synology NAS, here is the script when I run for TV series

Code: Select all

filebot -script 'fn:amc' /volume2/Downloads --output /volume4/Media-2/ --action move -non-strict --order Airdate --conflict auto --lang en --def 'ut_label=TV' 'unsorted=y' 'clean=y' 'skipExtract=y' 'minLengthMS=0' 'minFileSize=0' 'excludeList=.excludes' --log all --log-file '/volume2/@appstore/filebot-node/data/filebot.log'
I got some error information

Code: Select all

Group: [Series:true] => [Love,Death & Robots.S01E01.中英字幕.WEBrip.720P-人人影视.V2.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [Love Death Robots]
Fetch failed: https://api.thetvdb.com/search/series?name=Love+Death+Robots
java.lang.IllegalStateException: Failed to retrieve authorization token: Connection reset
But I ping thetvdb.com in my router , it's OK.

Code: Select all

[email protected]:/# ping thetvdb.com
PING thetvdb.com (104.16.231.14): 56 data bytes
64 bytes from 104.16.231.14: seq=0 ttl=56 time=136.882 ms
64 bytes from 104.16.231.14: seq=1 ttl=56 time=137.045 ms
64 bytes from 104.16.231.14: seq=2 ttl=56 time=136.746 ms
64 bytes from 104.16.231.14: seq=3 ttl=56 time=137.566 ms
64 bytes from 104.16.231.14: seq=4 ttl=56 time=137.013 ms
64 bytes from 104.16.231.14: seq=5 ttl=56 time=136.751 ms
64 bytes from 104.16.231.14: seq=6 ttl=56 time=136.661 ms
64 bytes from 104.16.231.14: seq=7 ttl=56 time=136.797 ms
Is there something wrong when I connect thetvdb.com?

User avatar
rednoah
The Source
Posts: 16434
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TheTVDB could not connect (in China)

Post by rednoah » 08 Jul 2019, 09:10

xuewy wrote:
08 Jul 2019, 08:12
Is there something wrong when I connect thetvdb.com?
Nope, but the GFW is blocking you. I guess they banned TheTVDB because of... reasons? IDK. Internet in China is "special" to say the least, but not much we can do about that, unfortunately. I recommend using VPN at all times to get normal internet.

:arrow: viewtopic.php?f=8&t=10900
:idea: Please read the FAQ and How to Request Help.

xuewy
Posts: 13
Joined: 06 Mar 2019, 14:06

Re: TheTVDB could not connect (banned in China)

Post by xuewy » 08 Jul 2019, 14:07

But my router already configured SSR that I can browse google , youtube ,Twitter etc. That‘s why you see in my router the ping result is OK.

User avatar
rednoah
The Source
Posts: 16434
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TheTVDB could not connect (banned in China)

Post by rednoah » 08 Jul 2019, 14:35

Ping is different. Ping working doesn't mean SSL connections aren't interfered with.

A HTTPS request would be more useful for testing:

Code: Select all

curl -v https://api.thetvdb.com/
The SSL connection is reset. Typically that's what the GFW does to encrypted connections. A connection reset can occur for all kinds of reasons though. But since TheTVDB works for everyone else, I assume there's something problematic between you and TheTVDB which isn't there between me and TheTVDB.

The link above might still help though. Accessing TheTVDB via a mirror, just to see if that works, narrow down the problem:
viewtopic.php?f=8&t=10900
:idea: Please read the FAQ and How to Request Help.

xuewy
Posts: 13
Joined: 06 Mar 2019, 14:06

Re: TheTVDB could not connect (banned in China)

Post by xuewy » 09 Jul 2019, 05:54

Sorry,I did not attached the full text of the error message

Code: Select all

Rename episodes using [TheTVDB]
Auto-detected query: [Titans, 泰坦 titans, 泰坦]
Fetch failed: https://api.thetvdb.com/search/series?name=Titans
java.lang.IllegalStateException: Failed to retrieve authorization token: Connection reset
	at net.filebot.web.TheTVDBClient.getAuthorizationToken(TheTVDBClient.java:131)
	at net.filebot.web.TheTVDBClient.getRequestHeader(TheTVDBClient.java:96)
	at net.filebot.web.TheTVDBClient.lambda$requestJson$0(TheTVDBClient.java:81)
	at net.filebot.CachedResource.lambda$fetchIfModified$9(CachedResource.java:215)
	at net.filebot.CachedResource.lambda$null$0(CachedResource.java:87)
	at net.filebot.CachedResource.retry(CachedResource.java:121)
	at net.filebot.CachedResource.lambda$get$1(CachedResource.java:87)
	at net.filebot.Cache.computeIf(Cache.java:90)
	at net.filebot.CachedResource.get(CachedResource.java:82)
	at net.filebot.web.TheTVDBClient.requestJson(TheTVDBClient.java:81)
	at net.filebot.web.TheTVDBClient.search(TheTVDBClient.java:139)
	at net.filebot.web.TheTVDBClient.fetchSearchResult(TheTVDBClient.java:158)
	at net.filebot.WebServices$TheTVDBClientWithLocalSearch.access$101(WebServices.java:193)
	at net.filebot.WebServices$TheTVDBClientWithLocalSearch.lambda$fetchSearchResult$4(WebServices.java:213)
Caused by: javax.net.ssl.SSLException: Connection reset
	at net.filebot.web.WebRequest.post(WebRequest.java:198)
	at net.filebot.web.TheTVDBClient.postJson(TheTVDBClient.java:75)
	at net.filebot.web.TheTVDBClient.getAuthorizationToken(TheTVDBClient.java:127)
	... 13 more
	Suppressed: java.net.SocketException: Broken pipe (Write failed)
		at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
		at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110)
		at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150)
		at java.base/sun.security.ssl.SSLSocketOutputRecord.encodeAlert(SSLSocketOutputRecord.java:81)
		at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:351)
		at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:263)
		at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:258)
		at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:137)
		at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1180)
		at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1091)
		at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402)
		at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:567)
		at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:187)
		at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1356)
		at java.base/sun.net.www.protocol.http.HttpURLConnection$8.run(HttpURLConnection.java:1323)
		at java.base/sun.net.www.protocol.http.HttpURLConnection$8.run(HttpURLConnection.java:1321)
		at java.base/java.security.AccessController.doPrivileged(AccessController.java:688)
		at java.base/java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:940)
		at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1320)
		at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:242)
		at net.filebot.web.WebRequest.post(WebRequest.java:198)
		at net.filebot.web.TheTVDBClient.postJson(TheTVDBClient.java:75)
		at net.filebot.web.TheTVDBClient.getAuthorizationToken(TheTVDBClient.java:127)
		at net.filebot.web.TheTVDBClient.getRequestHeader(TheTVDBClient.java:96)
		at net.filebot.web.TheTVDBClient.lambda$requestJson$0(TheTVDBClient.java:81)
		at net.filebot.CachedResource.lambda$fetchIfModified$9(CachedResource.java:215)
		at net.filebot.CachedResource.lambda$null$0(CachedResource.java:87)
		at net.filebot.CachedResource.retry(CachedResource.java:121)
		at net.filebot.CachedResource.lambda$get$1(CachedResource.java:87)
		at net.filebot.Cache.computeIf(Cache.java:90)
		at net.filebot.CachedResource.get(CachedResource.java:82)
		at net.filebot.web.TheTVDBClient.requestJson(TheTVDBClient.java:81)
		at net.filebot.web.TheTVDBClient.search(TheTVDBClient.java:139)
		at net.filebot.web.TheTVDBClient.fetchSearchResult(TheTVDBClient.java:158)
		at net.filebot.WebServices$TheTVDBClientWithLocalSearch.access$101(WebServices.java:193)
		at net.filebot.WebServices$TheTVDBClientWithLocalSearch.lambda$fetchSearchResult$4(WebServices.java:213)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
		at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.net.SocketException: Connection reset
	... 16 more
When I run

Code: Select all

curl -v https://api.thetvdb.com/
in my router, I got below result:

Code: Select all

*   Trying 104.16.228.14...
* TCP_NODELAY set
* Connected to api.thetvdb.com (104.16.228.14) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-CHACHA20-POLY1305
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: OU=Domain Control Validated; OU=PositiveSSL Multi-Domain; CN=ssl418142.cloudflaressl.com
*  start date: Mar  7 00:00:00 2019 GMT
*  expire date: Sep 13 23:59:59 2019 GMT
*  subjectAltName: host "api.thetvdb.com" matched cert's "*.thetvdb.com"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO ECC Domain Validation Secure Server CA 2
*  SSL certificate verify ok.
> GET / HTTP/1.1
> Host: api.thetvdb.com
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Date: Tue, 09 Jul 2019 05:45:38 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 26
< Connection: keep-alive
< Set-Cookie: __cfduid=d602b5e7ba5707fa13562688b1f58d7b61562651137; expires=Wed, 08-Jul-20 05:45:37 GMT; path=/; domain=.thetvdb.com; HttpOnly
< Cache-Control: private, max-age=600
< Vary: Accept-Language
< Www-Authenticate: JWT realm=jwt auth
< X-Powered-By: Thundar!
< X-Thetvdb-Api-Version: 2.2.0
< Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< Server: cloudflare
< CF-RAY: 4f37fe28abd2d1db-HKG
<
* Connection #0 to host api.thetvdb.com left intact
{"Error":"Not authorized"}* Closing connection 0
When I run the same command in my Synology NAS, here is the result:

Code: Select all

curl -v https://api.thetvdb.com/
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to api.thetvdb.com:443
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to api.thetvdb.com:443
Something is wrong in my Synology NAS configuration or just like you mentioned is the CN GreatWall issue?

User avatar
rednoah
The Source
Posts: 16434
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TheTVDB could not connect (banned in China)

Post by rednoah » 09 Jul 2019, 07:27

1.
Have you tried this yet?
viewtopic.php?f=8&t=10900


2.
Is your VPN outbound server based in HKG? If not, this might be a clue, telling us VPN isn't working, at least for the curl request:

Code: Select all

CF-RAY: ***-HKG

3.
Yep, looks like a general SSL connection reset issue:

Code: Select all

Caused by: javax.net.ssl.SSLException: Connection reset
	Suppressed: java.net.SocketException: Broken pipe (Write failed)
:idea: Please read the FAQ and How to Request Help.

Post Reply