pizzaolive / ant_upload_checker

Check whether local films can be uploaded to ANT
https://pypi.org/project/ant-upload-checker/
MIT License
5 stars 0 forks source link

Traceback error at end of search after updating to 1.4.5 #21

Closed backstab5983 closed 4 months ago

backstab5983 commented 4 months ago

I always get this error at the end of a search:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/data/ant_upload_checker/ant_upload_checker/main.py", line 27, in <module>
    main()
  File "/data/ant_upload_checker/ant_upload_checker/main.py", line 19, in main
    films_checked_on_ant = film_searcher.check_if_films_exist_on_ant()
  File "/data/ant_upload_checker/ant_upload_checker/film_searcher.py", line 49, in check_if_films_exist_on_ant
    processed_films = self.process_api_responses(films_to_process).drop(
  File "/data/ant_upload_checker/ant_upload_checker/film_searcher.py", line 63, in process_api_responses
    processed_films["Already on ANT?"] = processed_films.apply(
  File "/home/fra/.local/lib/python3.10/site-packages/pandas/core/frame.py", line 10347, in apply
    return op.apply().__finalize__(self, method="apply")
  File "/home/fra/.local/lib/python3.10/site-packages/pandas/core/apply.py", line 916, in apply
    return self.apply_standard()
  File "/home/fra/.local/lib/python3.10/site-packages/pandas/core/apply.py", line 1063, in apply_standard
    results, res_index = self.apply_series_generator()
  File "/home/fra/.local/lib/python3.10/site-packages/pandas/core/apply.py", line 1081, in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
  File "/data/ant_upload_checker/ant_upload_checker/film_searcher.py", line 64, in <lambda>
    lambda x: self.check_if_resolution_exists_on_ant(
  File "/data/ant_upload_checker/ant_upload_checker/film_searcher.py", line 79, in check_if_resolution_exists_on_ant
    f"{api_response[0]['guid']}"
IndexError: list index out of range

Tried to recheck dependencies, and I'm getting this:

Defaulting to user installation because normal site-packages is not writeable
Processing /data/ant_upload_checker
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
  Building wheel for UNKNOWN (pyproject.toml) ... done
  Created wheel for UNKNOWN: filename=UNKNOWN-0.0.0-py3-none-any.whl size=1799 sha256=a021627adcd0e328198c7d9ca449910b99ff0c3b19f2cfc366603fcb849420ea
  Stored in directory: /tmp/pip-ephem-wheel-cache-x5b3id3q/wheels/8b/06/ea/6a89edddad63ad4b6b697a651d143393e92105ae24b603fe78
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
  Attempting uninstall: UNKNOWN
    Found existing installation: UNKNOWN 0.0.0
    Uninstalling UNKNOWN-0.0.0:
      Successfully uninstalled UNKNOWN-0.0.0
Successfully installed UNKNOWN-0.0.0

Any idea what could be wrong or how can I fix?

Thanks!

pizzaolive commented 4 months ago

Hey @backstab5983, thanks for the report.

I haven't been able to recreate that issue outside of tests but it seems like it was happening when:

I've attempted a fix with the latest version, let me know if that helps.

For the dependency message I'm not too sure, but you could try updating pip: pip install --upgrade pip

backstab5983 commented 4 months ago

Hey @backstab5983, thanks for the report.

I haven't been able to recreate that issue outside of tests but it seems like it was happening when:

  • a film was apparently found on ANT as it was returning an API response
  • a film's resolution was not extracted, so set as "" intentionally
  • but then when trying to access the given film's response, the response is an empty list where it should contain some information about the film

I've attempted a fix with the latest version, let me know if that helps.

For the dependency message I'm not too sure, but you could try updating pip: pip install --upgrade pip

Working now, thanks!