C9Glax / tranga

Docker-Container to monitor (Manga) Scanlation-Sites for download new chapters.
GNU General Public License v3.0
141 stars 13 forks source link

[It broke]: MangaSee returning Forbidden #102

Closed Resuns closed 8 months ago

Resuns commented 9 months ago

What is broken?

When searching for anything, MangaSee returns "Forbidden".

Log-output

[01/16/2024 16:20:47.503]      Mangasee | Searching Publications. Term="solo leveling"
[01/16/2024 16:20:50.607] ChromiumDownl | Page loaded.
[01/16/2024 16:20:50.615]      Mangasee | Failed to retrieve search: Forbidden

Additional stuff

It is accessible from the browser. Screenshot from 2024-01-16 11-24-29

C9Glax commented 9 months ago

image Can not reproduce. Can you check if you can access https://mangasee123.com/_search.php

Resuns commented 9 months ago

Screenshot from 2024-01-16 11-49-18

Resuns commented 9 months ago

From the docker container console:

-root@eb117b82ed78:/publish# wget https://www.mangasee123.com/_search.php
--2024-01-16 16:57:44--  https://www.mangasee123.com/_search.php
Resolving www.mangasee123.com (www.mangasee123.com)... 104.21.83.37, 172.67.211.38, 2606:4700:3035::ac43:d326, ...
Connecting to www.mangasee123.com (www.mangasee123.com)|104.21.83.37|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2024-01-16 16:57:44 ERROR 403: Forbidden.
C9Glax commented 9 months ago

okay so this seems to not be tranga-specific...

C9Glax commented 9 months ago

Is your docker-host by chance not on the same machine or network as your browser? Then maybe that IP is geo- and/or IP-blocked

Resuns commented 9 months ago

That was from the tranga-api docker container. I can access the site through other docker containers.

root@f19428ab4fec:/# wget https://www.mangasee123.com/_search.php
Connecting to www.mangasee123.com (172.67.211.38:443)
saving to '_search.php'
_search.php          100% |*******************************************************************************************************************************|  691k  0:00:00 ETA
'_search.php' saved
Resuns commented 9 months ago

It's the same machine/host.

C9Glax commented 9 months ago

Okay they are trying to access different addresses

The tranga container resolves 104.21.83.37 along with the other IPs, your other container only 172.67.211.38.

Can you also run wget -V in both containers, as the output seems different...

Edit: Your browser will likely too resolve 104.21.83.37 image

C9Glax commented 9 months ago

Also probably related #101 Seems that cloudflare has some configuration issues...

Resuns commented 9 months ago

Tranga container:

root@2a34e949fec9:/publish# wget -V
GNU Wget 1.21 built on linux-gnu.

-cares +digest -gpgme +https +ipv6 +iri +large-file -metalink +nls 
+ntlm +opie +psl +ssl/gnutls 

Wgetrc: 
    /etc/wgetrc (system)
Locale: 
    /usr/share/locale 
Compile: 
    gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc" 
    -DLOCALEDIR="/usr/share/locale" -I. -I../../src -I../lib 
    -I../../lib -Wdate-time -D_FORTIFY_SOURCE=2 
    -I/usr/include/p11-kit-1 -DHAVE_LIBGNUTLS -DNDEBUG -g -O2 
    -ffile-prefix-map=/build/wget-KAcLZ8/wget-1.21=. 
    -fstack-protector-strong -Wformat -Werror=format-security 
    -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall 
Link: 
    gcc -I/usr/include/p11-kit-1 -DHAVE_LIBGNUTLS -DNDEBUG -g -O2 
    -ffile-prefix-map=/build/wget-KAcLZ8/wget-1.21=. 
    -fstack-protector-strong -Wformat -Werror=format-security 
    -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall -Wl,-z,relro -Wl,-z,now 
    -lpcre2-8 -luuid -lidn2 -lnettle -lgnutls -lz -lpsl ftp-opie.o 
    gnutls.o http-ntlm.o ../lib/libgnu.a 

Other container is BusyBox, so wget is basic:

BusyBox v1.36.1 (2023-11-07 18:53:09 UTC) multi-call binary.

Usage: wget [-cqS] [--spider] [-O FILE] [-o LOGFILE] [--header STR]
        [--post-data STR | --post-file FILE] [-Y on/off]
        [-P DIR] [-U AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

        --spider        Only check URL existence: $? is 0 if exists
        --header STR    Add STR (of form 'header: value') to headers
        --post-data STR Send STR using POST method
        --post-file FILE        Send FILE using POST method
        -c              Continue retrieval of aborted transfer
        -q              Quiet
        -P DIR          Save to DIR (default .)
        -S              Show server response
        -T SEC          Network read timeout is SEC seconds
        -O FILE         Save to FILE ('-' for stdout)
        -o LOGFILE      Log messages to FILE
        -U STR          Use STR for User-Agent header
        -Y on/off       Use proxy

If I run -S I get:

Tranga:

Resolving www.mangasee123.com (www.mangasee123.com)... 104.21.83.37, 172.67.211.38, 2606:4700:3035::ac43:d326, ...
Connecting to www.mangasee123.com (www.mangasee123.com)|104.21.83.37|:443... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 403 Forbidden
  Date: Tue, 16 Jan 2024 17:24:40 GMT
  Content-Type: text/html; charset=UTF-8
  Content-Length: 5982
  Connection: close
  Cross-Origin-Embedder-Policy: require-corp
  Cross-Origin-Opener-Policy: same-origin
  Cross-Origin-Resource-Policy: same-origin
  Origin-Agent-Cluster: ?1
  Permissions-Policy: accelerometer=(),autoplay=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()
  Referrer-Policy: same-origin
  X-Frame-Options: SAMEORIGIN
  cf-mitigated: challenge
  Cache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  Expires: Thu, 01 Jan 1970 00:00:01 GMT
  Report-To: {"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=ouYxK9JlE20hDkANNY8L2mG9Gs5zNxf5kRiXK4PI9lPh%2B5k7ai6xLSLPFb5OSDjPeochUGEsROSOE%2B%2BMymI9HmREqeb6wRHFKwO6zI%2FJamOcbuZcne4PbvJi9ij0r89WRQxF%2FeNM"}],"group":"cf-nel","max_age":604800}
  NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
  Vary: Accept-Encoding
  Server: cloudflare
  CF-RAY: 84680dab4891c344-EWR
  alt-svc: h3=":443"; ma=86400
2024-01-16 17:24:40 ERROR 403: Forbidden.

Secondary container:

root@f19428ab4fec:/# wget -S https://www.mangasee123.com/_search.php
Connecting to www.mangasee123.com (172.67.211.38:443)
  HTTP/1.1 200 OK
  Date: Tue, 16 Jan 2024 17:21:00 GMT
  Content-Type: text/html; charset=UTF-8
  Transfer-Encoding: chunked
  Connection: close
  Vary: Accept-Encoding
  CF-Cache-Status: DYNAMIC
  Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=3bSEESHcBbL%2FQl7ZU4gdPERE7uJvg2hBCUP5alIkaciioDXp2DyZyz5oA1oCsIeP6FB2iZXQ8KMBhG7KpBNiFNHxcFRucEnGQ%2BQFfbJxOqKOOOC7X%2Fsyj61OSzXSadQlcXT5adj6"}],"group":"cf-nel","max_age":604800}
  NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
  Server: cloudflare
  CF-RAY: 846808489eb619a1-EWR
  alt-svc: h3=":443"; ma=86400
C9Glax commented 9 months ago

What I can't figure out is why the tranga-api container wget version (and probably all other HTTP-Request clients) do not try the working IPs and just return 403. A dirty workaround would be to edit the /etc/hosts file to point the Domainname at the working IP. This would of course break the container again if the IP changes, but I have no other ideas atm.