Ryuk-me/Torrent-Api-py

having problem to search it's shows this message {Expecting value: line 1 column 1 (char 0)}

shaadahmmed opened this issue · 17 comments

Expecting value: line 1 column 1 (char 0)

can u please share the query you are trying to use
like : api/v1/search?site=1337x&query=avengers

api/v1/all/search?query=photoshop&limit=30
same goes for the other individual sites

@misershaad u have hosted it on heroku ?

@yadianluffy have u added redis uri ?

if not then get it from here https://redistogo.com/

or try changing redis uri

@yadianluffy u dont need one just visit that site and at bottom u will see a free option and create an account dont put anything in website column after creating account scroll down to bottom u will see free option select it and create an instance and paste that uri to .env file REDIS_URI=redis://redistogo:f99edf3de0cyryty324fe462@sole.redistogo.com:10393/ and u r good to go.

redis

yes I have hosted it in heroku

@misershaad then u are getting it is because of the heroku request timeout (which is limited to 30 sec)
and the request u r making takes more than 30 sec to complete
and i really cant do a thing to fix it.

I tried to install it on repl I installed the requirements manually and it was successfully installed then I set the environments and set the command "python main.py" and when I run the repl it has an error like this

Because fastapi (0.75.0) depends on starlette (0.17.1)
and no versions of fastapi match >0.75.0,<0.76.0, fastapi (>=0.75.0,<0.76.0) requires starlette (0.17.1).
So, because repl-python3-beta-torrent-api-py depends on both fastapi (^0.75.0) and starlette (^0.19.0), version solving failed.

at /opt/virtualenvs/python3/lib/python3.8/site-packages/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes
exit status 1

I tried to install the starlette==0.17.1 but it is not working again and again what should I do now?

@misershaad i have mentioned that u have to install each requirement manually one by one otherwise u will face this issue

@Ryuk-me Here is the same error hosting it on repl

INFO: 172.18.0.1:45610 - "GET / HTTP/1.1" 200 OK
INFO: 172.18.0.1:39910 - "GET / HTTP/1.1" 200 OK
INFO: 172.18.0.1:39914 - "GET /favicon.ico HTTP/1.1" 404 Not Found
INFO: 172.18.0.1:47090 - "GET /api/v1/search?site=1337x&query=eternals&limit=200 HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aioredis/connection.py", line 692, in connect
await self._connect()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aioredis/connection.py", line 719, in _connect
reader, writer = await asyncio.open_connection(
File "/usr/lib/python3.8/asyncio/streams.py", line 52, in open_connection
transport, _ = await loop.create_connection(
File "uvloop/loop.pyx", line 2027, in create_connection
OSError: Multiple exceptions: [Errno 111] Connection refused, [Errno 99] Cannot assign requested address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 372, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in call
return await self.app(scope, receive, send)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/fastapi/applications.py", line 211, in call
await super().call(scope, receive, send)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/starlette/applications.py", line 112, in call
await self.middleware_stack(scope, receive, send)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in call
raise exc
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in call
await self.app(scope, receive, _send)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/starlette/middleware/cors.py", line 84, in call
await self.app(scope, receive, send)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in call
raise exc
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in call
await self.app(scope, receive, sender)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/starlette/routing.py", line 656, in call
await route.handle(scope, receive, send)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/starlette/routing.py", line 259, in handle
await self.app(scope, receive, send)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/starlette/routing.py", line 61, in app
response = await func(request)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/fastapi/routing.py", line 226, in app
raw_response = await run_endpoint_function(
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/fastapi/routing.py", line 159, in run_endpoint_function
return await dependant.call(**values)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/fastapi_cache/decorator.py", line 45, in inner
ttl, ret = await backend.get_with_ttl(cache_key)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/fastapi_cache/backends/redis.py", line 14, in get_with_ttl
return await (pipe.ttl(key).get(key).execute())
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aioredis/client.py", line 4618, in execute
conn = await self.connection_pool.get_connection("MULTI", self.shard_hint)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aioredis/connection.py", line 1416, in get_connection
await connection.connect()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aioredis/connection.py", line 698, in connect
raise ConnectionError(self._error_message(e))
aioredis.exceptions.ConnectionError: Error connecting to localhost:6379. Multiple exceptions: [Errno 111] Connection refused, [Errno 99] Cannot assign requested address.

@misershaad add redis uri in environment variable of repl not in .env file

@Ryuk-me added in the secrets
image
image

@misershaad change redis_uri bro

@Ryuk-me tried not working

it should be working
@misershaad delete repl and add repo again and install requirements manually this time and get redis uri from redistogo.com and place it in REDIS_URI environment variable (thats how i made it work)

@misershaad host your api here 4b8bab9

@Ryuk-me thanks working fine on oketo