LimeDrive / ygg-rss-proxy

Proxy pour le flux RSS de YGGTorrent.
15 stars 3 forks source link

requests.exceptions.ConnectionError: 'Connection aborted.' #23

Closed TristanThomas03 closed 4 months ago

TristanThomas03 commented 4 months ago

Bonjour,

Depuis quelques semaines, j'utilise ygg-rss-proxy avec flaresolverr sur Windows, et tout allait très bien jusqu'au changement de flaresolverr il y a quelques jours. Merci pour le job !

Cette nuit, une mise à jour de flaresolverr est censée avoir réglé le problème, mais après avoir tout réinstallé, ça ne fonctionne plus.

Voici mon docker-compose :

version: "3.8"

services:
   flaresolverr:
      image: ghcr.io/flaresolverr/flaresolverr:latest
      container_name: flaresolverr
      environment:
         LOG_LEVEL: info
         CAPTCHA_SOLVER: none
      ports:
         - 8191:8191
      restart: unless-stopped

   ygg-rss-proxy:
      image: ghcr.io/limedrive/ygg-rss-proxy:latest
      container_name: ygg-rss-proxy
      environment:
         YGG_USER: <MON USER>
         YGG_PASS: <MON PASS>
         RSS_HOST: localhost
         RSS_PORT: 5000
         FLARESOLVERR_HOST: flaresolverr
         FLARESOLVERR_PORT: 8191
         LOG_LEVEL: INFO
      ports:
         - 5000:5000
      restart: unless-stopped
      depends_on:
         - flaresolverr

Et voici le script tout simple que j'utilise pour tester la requête au flux rss :

import requests

url = "http://localhost:5000/rss?action=generate&type=cat&id=2188&passkey=<MA PASSKEY>"

response = requests.get(url, headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"})
print(response)

J'obtiens l'erreur suivante :

Traceback (most recent call last):
  File "C:\Python312\Lib\site-packages\urllib3\connectionpool.py", line 715, in urlopen
    httplib_response = self._make_request(
                       ^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\urllib3\connectionpool.py", line 467, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "C:\Python312\Lib\site-packages\urllib3\connectionpool.py", line 462, in _make_request
    httplib_response = conn.getresponse()
                       ^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\http\client.py", line 1428, in getresponse
    response.begin()
  File "C:\Python312\Lib\http\client.py", line 331, in begin
    version, status, reason = self._read_status()
                              ^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\http\client.py", line 300, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python312\Lib\site-packages\requests\adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\urllib3\connectionpool.py", line 799, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\urllib3\util\retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\urllib3\packages\six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "C:\Python312\Lib\site-packages\urllib3\connectionpool.py", line 715, in urlopen
    httplib_response = self._make_request(
                       ^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\urllib3\connectionpool.py", line 467, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "C:\Python312\Lib\site-packages\urllib3\connectionpool.py", line 462, in _make_request
    httplib_response = conn.getresponse()
                       ^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\http\client.py", line 1428, in getresponse
    response.begin()
  File "C:\Python312\Lib\http\client.py", line 331, in begin
    version, status, reason = self._read_status()
                              ^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\http\client.py", line 300, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Chris\Desktop\test rss.py", line 5, in <module>
    response = requests.get(url,
               ^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\requests\sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\requests\sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\requests\adapters.py", line 501, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Merci d'avance pour votre aide !

LimeDrive commented 4 months ago

Bonjour,

Gunicorn tourne sur le port 8080 dans le container. C'est tout à fait possible de laisser sur le port 5000 coté host, voir le docker compose corrigé ci dessous. J'ai aussi enlevé le bind du port de FlareSolverr et mis la DB ainsi que les fichiers config à l'intérieur d'un volume Docker pour pour que les sessions soient persistante même en cas de mise à jour de l'image.

version: '3.8'

services:
   flaresolverr:
      image: ghcr.io/flaresolverr/flaresolverr:latest
      container_name: flaresolverr
      environment:
         LOG_LEVEL: info
         CAPTCHA_SOLVER: none
         TZ: Europe/Paris
      expose:
        - 8191
      restart: unless-stopped

   ygg-rss-proxy:
      image: ghcr.io/limedrive/ygg-rss-proxy:latest
      container_name: ygg-rss-proxy
      environment:
         YGG_USER: <MON USER>
         YGG_PASS: <MON PASS>
         RSS_HOST: localhost
         RSS_PORT: 5000
         FLARESOLVERR_HOST: flaresolverr
         LOG_LEVEL: INFO
         TZ: Europe/Paris
      volumes:
         - ygg-rss-proxy-data:/app/config
      ports:
         - 5000:8080
      restart: unless-stopped
      depends_on:
         - flaresolverr

volumes:
   ygg-rss-proxy-data:

faite un docker compose pull pour avoir les dernière image de flaresolverr ( v3.3.20 ) et ygg-rss-proxy ( v1.3.3-alpha )

TristanThomas03 commented 4 months ago

Super merci beaucoup, j'ai fait les modifs et tout fonctionne !